PUT
/
coupons
/
{id}

Authorizations

Authorization
string
headerrequired

Value for the Authorization header parameter.

Path Parameters

id
string
required

Coupon identifier

Body

code
string
required

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

name
string
required

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

type
enum<string>
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.
Available options:
percentage,
fixed_amount
frequency
enum<string>
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.
Available options:
once,
limited,
lifetime
percentage
integer | null

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

Required range: 0 < x < 100
fixedAmount
object | null

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.

maxRedemptionsPerCustomer
integer | null
default: null

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

maxRedemptions
integer | null
default: null

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

expiresAt
string | null
default: null

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

limitedToPlans
object[]

The plans this coupon should be applied to.

excludedFromPlans
object[]

The plans this coupon should not be applied to.

limitedToProducts
object[]

The products this coupon should be applied to.

excludedFromProducts
object[]

The products this coupon should not be applied to.

isEnabled
boolean
default: true

Whether this coupon is enabled or not.

Response

200 - application/json
code
string
required

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

name
string
required

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

type
enum<string>
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.
Available options:
percentage,
fixed_amount
frequency
enum<string>
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.
Available options:
once,
limited,
lifetime
id
string

The id of this coupon.

percentage
integer | null

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

Required range: 0 < x < 100
fixedAmount
object | null

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.

maxRedemptionsPerCustomer
integer | null
default: null

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

maxRedemptions
integer | null
default: null

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

expiresAt
string | null
default: null

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

limitedToPlans
object[]

The plans this coupon should be applied to.

excludedFromPlans
object[]

The plans this coupon should not be applied to.

limitedToProducts
object[]

The products this coupon should be applied to.

excludedFromProducts
object[]

The products this coupon should not be applied to.

isEnabled
boolean
default: true

Whether this coupon is enabled or not.

createdAt
string

The date and time when the resource was created.

updatedAt
string

The date and time when the resource was last updated.

reedemptions
boolean

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