POST
/
coupons

Authorizations

Authorization
string
header
required

Value for the Authorization header parameter.

Body

code
string
required

The code that can be used to apply this coupon or to use it with the api.

frequency
any
required

The frequency at which a coupon should be applied.

Possible values:

  • once: The coupon will be applied once for the first billing period.
  • limited: The coupon will be applied for a limited number of billing periods.
  • lifetime: The coupon will be applied forever.
name
string
required

The name of this coupon, which will be displayed to the user in the checkout process, customer front, etc.

type
any
required

The type of this coupon.

Possible values:

  • percentage: A percentage will be taken off the total plan amount.
  • fixed_amount: A fixed amount will be taken off the total plan amount. It will never go below 0.
excludedFromPlans
string[]

The plans this coupon should not be applied to.

excludedFromProducts
string[]

The products this coupon should not be applied to.

expiresAt
string | null
default:
null

The date and time this coupon will expire. If null, there is no expiration date.

fixedAmount
object

The fixed amount this coupon should apply. Required for type fixed_amount.

frequencyInterval
integer | null

The number of billing periods the coupon will be applied for. Required for frequency limited.

isEnabled
boolean
default:
true

Whether this coupon is enabled or not.

limitedToPlans
string[]

The plans this coupon should be applied to.

limitedToProducts
string[]

The products this coupon should be applied to.

maxRedemptions
integer | null
default:
null

The number of times this coupon can be redeemed in total. If null, there is no limit.

maxRedemptionsPerCustomer
integer | null
default:
null

The number of times this coupon can be redeemed by a customer. If null, there is no limit.

percentage
integer | null

The percentage this coupon should apply. Required for type percentage.

Required range: 0 < x < 100

Response

201 - application/json
code
string
required

The code that can be used to apply this coupon or to use it with the api.

frequency
any
required

The frequency at which a coupon should be applied.

Possible values:

  • once: The coupon will be applied once for the first billing period.
  • limited: The coupon will be applied for a limited number of billing periods.
  • lifetime: The coupon will be applied forever.
name
string
required

The name of this coupon, which will be displayed to the user in the checkout process, customer front, etc.

type
any
required

The type of this coupon.

Possible values:

  • percentage: A percentage will be taken off the total plan amount.
  • fixed_amount: A fixed amount will be taken off the total plan amount. It will never go below 0.
createdAt
string

The date and time when the resource was created.

excludedFromPlans
object[]

The plans this coupon should not be applied to.

excludedFromProducts
object[]

The products this coupon should not be applied to.

expiresAt
string | null
default:
null

The date and time this coupon will expire. If null, there is no expiration date.

fixedAmount
object

The fixed amount this coupon should apply. Required for type fixed_amount.

frequencyInterval
integer | null

The number of billing periods the coupon will be applied for. Required for frequency limited.

id
string

The id of this coupon.

isEnabled
boolean
default:
true

Whether this coupon is enabled or not.

limitedToPlans
object[]

The plans this coupon should be applied to.

limitedToProducts
object[]

The products this coupon should be applied to.

maxRedemptions
integer | null
default:
null

The number of times this coupon can be redeemed in total. If null, there is no limit.

maxRedemptionsPerCustomer
integer | null
default:
null

The number of times this coupon can be redeemed by a customer. If null, there is no limit.

percentage
integer | null

The percentage this coupon should apply. Required for type percentage.

Required range: 0 < x < 100
reedemptions
boolean

Has this coupon been redeemed by a customer? If yes, it cannot be edited or deleted anymore.

updatedAt
string

The date and time when the resource was last updated.