Coupon Codes Single

Coupon Codes (Single)

Create A Coupon Code

POST /promotions/{promotion_id}/codes

Request

Create a new code for the promotion.

Note: The default rate limit for this endpoint is 40 concurrent requests.

Authentication

  • X-Auth-Token in header

Parameters

  • store_hash in path - string
  • Accept in header with default of application/json - string
    required
    The MIME type of the response body.
  • Content-Type in header with default of application/json - string
    required
    The MIME type of the request body.
  • promotion_id in path - string
    required
    The ID of the associated promotion.

Body

object | application/json
  • code
    string
    required

    A unique code that can be used to manually apply a discount. Only letters, numbers, white spaces, underscores, and hyphens are allowed.
    <= 50 characters
  • max_uses
    integer

    The maximum number of times you can use this coupon code. The default value is 0, which represents unlimited uses. The parent promotion's max_uses field overrides the coupon code's max_uses field.
    Example: 10
  • max_uses_per_customer
    integer

    The maximum number of times a specific customer can use this coupon code. The default value is 0, which represents unlimited uses.
    Example: 5

example

{
"code": "string",
"max_uses": 10,
"max_uses_per_customer": 5
}

Response

Body

object | application/json
  • data
    object

    A CouponCode object encapsulates attributes of a coupon code.
  • meta
    object

    Empty meta object, which may be used at a later time.

example-1

{
"data": {
"id": 1,
"code": "TEST_COUPON",
"max_uses": 10,
"max_uses_per_customer": 5,
"current_uses": 0,
"created": "2019-01-20T22:00:00+00:00"
},
"meta": {}
}

Delete A Coupon Code

DELETE /promotions/{promotion_id}/codes/{code_id}

Request

Deletes a coupon code.

Note: The default rate limit for this endpoint is 40 concurrent requests.

Authentication

  • X-Auth-Token in header

Parameters

  • store_hash in path - string
  • Accept in header with default of application/json - string
    required
    The MIME type of the response body.
  • promotion_id in path - string
    required
    The ID of the associated promotion.
  • code_id in path - string
    required
    The ID of the coupon code to delete.

example

curl --request DELETE \
--url 'https://api.bigcommerce.com/stores/[store_hash]/v3/promotions/[promotion_id]/codes/[code_id]' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: {{token}}'

Response

The deletion was successful or the resource does not exist.
Did you find what you were looking for?