Skip to main content
POST
Create Promotion Code

Authorizations

Authorization
string
header
required

Service (M2M) access token issued by POST /auth/token using the client_credentials grant. Required scopes, where known, are listed on each operation below.

Headers

Idempotency-Key
string

Deduplicates retried requests with the same key and parameters instead of creating a second resource. Recommended: an opaque, randomly-generated value such as a UUID.

Body

application/json
provider_coupon_id
string
required

Provider coupon id (the payment provider coupon id) the promotion code applies to.

code
string
required

Promotion code value (e.g., "SUMMER20").

active
boolean

Whether the code is active; defaults to true.

max_redemptions
number

Max total redemptions. Positive integer.

provider_customer_id
string

Restrict the code to a single provider customer.

expires_at
number

Expiry as a Unix timestamp in seconds; must be in the future.

metadata
object

String key/value pairs forwarded to the provider.

restrictions
object

Optional usage restrictions. minimum_amount and minimum_amount_currency must be provided together.

Response

Success.

data
object
required