Coupon Codes (Bulk)
Get Coupon Codes
GET https://api.bigcommerce.com/stores/{store_hash}/v3/promotions/{promotion_id}/codesRequest
Get codes for a particular promotion.
Note: The default rate limit for this endpoint is 10 concurrent requests.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- promotion_id in path - stringrequiredThe ID of the associated promotion.
- before in query - string
A cursor that can be used for backwards pagination. Will fetch results before the position corresponding to the cursor. Cannot be used with the 'page' query parameter. Cannot be used with the 'after' query parameter.
- after in query - string
A cursor that can be used for forwards pagination. Will fetch results after the position corresponding to the cursor. Cannot be used with the 'page' query parameter. Cannot be used with the 'before' query parameter.
- page in query - integer
Query parameter that specifies the page number in a paginated list of resources. This field is deprecated and the 'before' and 'after' cursor parameters should be used instead.
- limit in query - integer
Query parameter that limits the number of items displayed per page in a paginated list of resources. When none is specified a default value of 50 is used.
example
Response
Body
dataarray[object]
example-1
Delete Multiple Coupon Codes
DELETE https://api.bigcommerce.com/stores/{store_hash}/v3/promotions/{promotion_id}/codesRequest
Deletes multiple coupon codes relating to the given promotion. Currently, batches are limited to 50 coupon codes.
Notes
- "id:in" query param is required to delete coupon codes. If not provided, or provided with the wrong data format, a 422 error code is returned.
- 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 - stringrequiredThe MIME type of the response body.
- id:in in query - arrayrequired
A comma-separated list of promotions to filter or target with this operation.
Example: ?id:in=11,12,13,14
Type: array[integer] - promotion_id in path - stringrequiredThe ID of the associated promotion.
example
Response
Generate Multiple Coupon Codes
POST https://api.bigcommerce.com/stores/{store_hash}/v3/promotions/{promotion_id}/codegenRequest
Generate a batch of coupon codes for a particular bulk coupon promotion.
Note:
- batch_size (number of codes generated per request) is limited to 250. If batch_size is not an integer or larger than 250, it will return a 422 error code.
- The default rate limit for this endpoint is 10 concurrent requests.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- Content-Type in header with default of application/json - stringrequiredThe MIME type of the request body.
- Accept in header with default of application/json - stringrequiredThe MIME type of the response body.
- promotion_id in path - stringrequiredThe ID of the associated promotion.
Body
batch_sizeinteger
requiredThe number of coupon codes to generate in each batch. The maximum value is 250.Min: 1Max: 250Example: 5max_usesinteger
The maximum number of times each coupon code can be used. The default value is 1. The value 0 means unlimited usage.Min: 0Max: 100000Example: 10max_uses_per_customerinteger
The maximum number of times a specific customer can use each coupon code. The default value is 1. The value 0 means unlimited usage.Min: 0Max: 100000Example: 5
example
Response
Body
dataobject