Skip to main content
POST
cURL
Adds an API code to a reward, such as one per customer from a sales deal. customerId limits it to one of your customers; maxRedemptions, expiresAt and firstTimeOnly limit it further. A catalog push leaves API codes alone. A code already active, on any reward, returns 409 promotion_code_taken. Needs the Catalog permission at Write.

Authorizations

Authorization
string
header
required

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

Path Parameters

rewardId
string
required

The reward's ID.

Required string length: 1 - 100
Pattern: ^[a-zA-Z0-9_-]+$

Body

application/json
code
string
required

What the customer types, such as LAUNCH20. Matched without case and stored in upper case. Unique among the environment's active codes.

Pattern: ^[A-Za-z0-9_-]{3,40}$
maxRedemptions
integer | null

How many times the code can be used. Null: no limit.

Required range: x <= 2147483647
expiresAt
string<date-time> | null

No new redemptions after this time.

firstTimeOnly
boolean

Only for a customer who has never paid for a plan or credit pack.

customerId
string

Only this customer (your ID for them) may use the code.

Required string length: 1 - 255

Response

The reward with its new code. A catalog push leaves API codes alone.

item
object
required
changed
boolean
required