Skip to main content
POST
cURL
Create a distribution code for an existing Offer with one or more sequential discount phases. The code owns redemption restrictions.

Authorizations

x-api-key
string
header
required

Headers

Idempotency-Key
string

Unique key used to safely retry this write for 24 hours without applying it twice.

Required string length: 1 - 200
Commet-Version
string
default:2026-08-27

API version used by this reference. Send this header to select this contract explicitly.

Body

application/json
code
string
required
Minimum string length: 1
offerId
string
required
Minimum string length: 1
billingInterval
enum<string> | null
Available options:
weekly,
monthly,
quarterly,
semiannual,
yearly,
one_time
maxRedemptions
integer
Required range: x <= 9007199254740991
expiresAt
string<date-time>
planIds
string[]
firstPurchaseOnly
boolean

Whether the code only applies to a customer's first purchase: one with no paid invoice above zero and no paid subscription. Defaults to false.

Response

Success

id
string
required
code
string
required
offerId
string
required
billingInterval
enum<string> | null
required
Available options:
weekly,
monthly,
quarterly,
semiannual,
yearly,
one_time
maxRedemptions
integer | null
required
Required range: -9007199254740991 <= x <= 9007199254740991
expiresAt
string<date-time> | null
required
isActive
boolean
required
redemptionCount
integer
required
Required range: -9007199254740991 <= x <= 9007199254740991
firstPurchaseOnly
boolean
required

Whether the code only applies to a customer's first purchase: one with no paid invoice above zero and no paid subscription.

managedBy
enum<string> | null
required

Integration that manages this record, or null when the merchant does. While an integration manages it, its terms change only in that integration and edits answer 409 managed_by_integration.

Available options:
dub
createdAt
string<date-time>
required
updatedAt
string<date-time>
required
object
string
required
Allowed value: "promo_code"
livemode
boolean
required