Create a promotion code


A Promotion Code represents a customer-redeemable code for a coupon. Multiple codes for a single coupon can be created.

Errors

In addition to the Errors applicable to all API endpoints, the following errors are specific to creating a promotion code:

status code error code description
404 coupon.not-found No coupon was found meeting the requirements. Make sure to specify the right coupon id and API key.test objects can only be accessed using test keys and live object with live keys.
409 promotion-code.exists The promotion code {code} already exists. The code needs to be unique across all of your promotion codes.
Body Params

Create Promotion Code

boolean
Defaults to false

Has the value true (default) if the promotion code is active and can be used, or the value false if it is not.

string
required
length between 1 and 80

The customer-facing code. Regardless of case, this code must be unique across all your promotion codes.

string
required

The unique identifier for the Coupon object.

string

Three-letter ISO currency code, in uppercase. Must be a supported currency.

integer

Time at which the Promotion Code expires. Measured in milliseconds since the Unix epoch.

boolean
Defaults to false

A Boolean indicating if the Promotion Code should only be redeemed for customers without any successful order with the merchant. Defaults to false if not set.

integer

Maximum number of times this Promotion Code can be redeemed, in total, across all customers, before it is no longer valid.

metadata
object

Set of up to 20 key-value pairs that you can attach to the object.

number

The minimum amount required to redeem this Promotion Code (e.g., the amount of the order must be ¥10,000 or more to be applicable).

boolean
Defaults to false

A Boolean indicating if the Promotion Code should only be redeemed once by any given customer. Defaults to false if not set.

Responses

Language
Credentials
Click Try It! to start a request and see the response here! Or choose an example:
application/json