Promotions API
Create A Coupon Code
POST /stores/{store_hash}/v3/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 headerrequired
Parameters
- store_hash in path - string
- Content-Type in header with default of application/json - stringrequired
The MIME type of the request body.
- promotion_id in path - stringrequired
The ID of the associated promotion.
Body
codestring
required<= 50 charactersA unique code that can be used to manually apply a discount. Only letters, numbers, white spaces, underscores, and hyphens are allowed.
max_usesinteger
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'smax_uses
field.Example: 10
max_uses_per_customerinteger
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
Response
Body
dataobject
A
CouponCode
object encapsulates attributes of a coupon code.metaobject
Empty meta object, which may be used at a later time.
example-1
Delete A Coupon Code
DELETE /stores/{store_hash}/v3/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 headerrequired
Parameters
- store_hash in path - string
- promotion_id in path - stringrequired
The ID of the associated promotion.
- code_id in path - stringrequired
The ID of the coupon code to delete.
example
Response
The deletion was successful or the resource does not exist.