Skip to main content
POST
Create a coupon

Creating Coupons

Create a new coupon definition that can be used to generate promotional codes for your affiliates.

Coupon Types

  • PERCENTAGE: Discount based on a percentage (e.g., 20% off)
  • FLAT: Fixed amount discount (e.g., $10 off)

Duration Options

  • once: Applies to a single payment
  • forever: Applies to all future payments
  • repeating: Applies for a specific number of months
After creating a coupon, you’ll need to create promotional codes linked to this coupon. Promotional codes are the actual discount codes that customers will enter at checkout.

Authorizations

Authorization
string
header
required

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

Body

application/json

The coupon to create

name
string
required

Name of the coupon

Example:

"Launch 20%"

couponType
enum<string>
default:PERCENTAGE

Whether the discount is a percentage or a fixed amount

Available options:
PERCENTAGE,
FLAT
percentOff
number<float>

Percentage taken off, 1–100. Required when couponType is PERCENTAGE.

amountOff
number<float>

Fixed amount taken off. Required when couponType is FLAT.

currency
string

Currency for amountOff. Required when couponType is FLAT.

Example:

"USD"

duration
enum<string>
default:forever

How long the discount keeps applying to a subscription

Available options:
once,
forever,
repeating
durationInMonths
integer

Number of months the discount repeats for. Required when duration is repeating.

maxRedemptions
integer

Total redemptions allowed across every promotional code on this coupon. Omit for unlimited.

limitToProducts
boolean
default:false

Restrict the coupon to productIds

productIds
string[]

Products the coupon applies to

valid
boolean
default:true

Whether the coupon can be redeemed straight away

redeemBy
string<date-time>

Last date the coupon can be redeemed

externalId
string

The coupon's ID in the connected billing provider. Must be unique.

integrationType
enum<string>

The billing provider this coupon is synced with

Available options:
NONE,
STRIPE,
CHARGEBEE,
PADDLE,
SHOPIFY,
WOOCOMMERCE,
ZYLVIE,
POLAR

Response

The created coupon.

A discount definition. Promotional codes point at a coupon for their value.

id
string<uuid>

The coupon ID

name
string | null

Name of the coupon

externalId
string | null

The coupon's ID in the connected billing provider, for example a Stripe coupon ID

couponType
enum<string>

Whether the discount is a percentage or a fixed amount

Available options:
PERCENTAGE,
FLAT
percentOff
number<float> | null

Percentage taken off, 1–100. Used when couponType is PERCENTAGE.

amountOff
number<float> | null

Fixed amount taken off. Used when couponType is FLAT.

currency
string | null

Currency for amountOff, for example USD

duration
enum<string>

How long the discount keeps applying to a subscription

Available options:
once,
forever,
repeating
durationInMonths
integer | null

Number of months the discount repeats for. Only set when duration is repeating.

maxRedemptions
integer | null

Total redemptions allowed across every promotional code on this coupon. null means unlimited.

timesRedeemed
integer

How many times this coupon has been redeemed so far

couponCategory
enum<string>

Whether the coupon discounts customers or is used to pay affiliates as a non-cash reward

Available options:
CUSTOMER,
PAYOUT
limitToProducts
boolean

Whether the coupon only applies to productIds

productIds
string[]

Products the coupon is restricted to

collectionIds
string[]

Collections the coupon is restricted to

valid
boolean

Whether the coupon can currently be redeemed

redeemBy
string<date-time> | null

Last date the coupon can be redeemed

integrationType
enum<string> | null

The billing provider this coupon is synced with

Available options:
NONE,
STRIPE,
CHARGEBEE,
PADDLE,
SHOPIFY,
WOOCOMMERCE,
ZYLVIE,
POLAR
affiliateProgramId
string<uuid>

The affiliate program this coupon belongs to

createdAt
string<date-time>

When the coupon was created

updatedAt
string<date-time>

When the coupon was last updated

promotionalCodes
object[]

Promotional codes that point at this coupon

autoCouponRule
object | null

Rule used to generate codes automatically for affiliates, if configured

Last modified on July 20, 2026