Generate Multiple Coupon Codes

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-Tokenstring
### OAuth scopes | UI Name | Permission | Parameter | |:--------|:-----------|:----------| | Marketing | modify | `store_v2_marketing` | | Marketing | read-only | `store_v2_marketing_read_only` | ### Authentication header | Header | Argument | Description | |:-------|:---------|:------------| | `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see [API Accounts and OAuth Scopes](/developer/docs/overview/api-fundamentals/api-accounts#api-accounts). | ### Further reading For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-fundamentals/api-accounts). For more about BigCommerce OAuth scopes, see [API Accounts and OAuth Scopes](/developer/docs/overview/api-fundamentals/api-accounts#api-accounts). For a list of API status codes, see [API Status Codes](/developer/api-reference/rest/overview#rest-http-status-codes).

Path parameters

promotion_idstringRequired
The ID of the associated promotion.

Headers

AcceptstringRequiredDefaults to application/json
The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body.

Request

This endpoint expects an object.
batch_sizeintegerRequired1-250
The number of coupon codes to generate in each batch. The maximum value is 250.
max_usesintegerOptional0-100000
The maximum number of times each coupon code can be used. The default value is 1. The value 0 means unlimited usage.
max_uses_per_customerintegerOptional0-100000
The maximum number of times a specific customer can use each coupon code. The default value is 1. The value 0 means unlimited usage.

Response

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

Errors

400
Bad Request Error
403
Forbidden Error
405
Method Not Allowed Error
422
Unprocessable Entity Error