Create Promotion Code

View as Markdown
Create a new promotion code linked to a coupon.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

account_idstringRequired

Request

This endpoint expects an object.
coupon_idstringRequired
ID of the coupon this code applies
codestringRequired1-100 characters
The promotion code string
activebooleanOptionalDefaults to true
Whether the code is active
max_redemptionsinteger or nullOptional>=1
Maximum number of times this code can be redeemed
expires_atdatetime or nullOptional
When this promotion code expires
restrictionsobject or nullOptional
Restrictions on promotion code usage
metadatamap from strings to any or nullOptional
Arbitrary metadata

Response

Successful Response
idstring
coupon_idstring
codestring
activeboolean
max_redemptionsinteger or null
times_redeemedinteger
expires_atdatetime or null
restrictionsmap from strings to any or null
metadatamap from strings to any or null
created_atdatetime
updated_atdatetime

Errors

422
Unprocessable Entity Error