Skip to main content
POST
cURL

Autorisierungen

Authorization
string
header
erforderlich

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

Body

The new Coupon resource

code
string
erforderlich

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

Beispiel:

"10OFF"

name
string
erforderlich

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

Beispiel:

"10% off"

type
any
erforderlich

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.
Beispiel:

"percentage"

frequency
any
erforderlich

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.
Beispiel:

"limited"

percentage
integer | null

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

Erforderlicher Bereich: 0 <= x <= 100
Beispiel:

10

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.

Beispiel:

3

maxRedemptionsPerCustomer
integer | null
Standard:null

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

Beispiel:

null

maxRedemptions
integer | null
Standard:null

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

Beispiel:

null

expiresAt
string<date-time> | null
Standard:null

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

Beispiel:

null

limitedToPlans
string<uuid>[]

The plans this coupon should be applied to.

excludedFromPlans
string<uuid>[]

The plans this coupon should not be applied to.

limitedToProducts
string<uuid>[]

The products this coupon should be applied to.

excludedFromProducts
string<uuid>[]

The products this coupon should not be applied to.

isEnabled
boolean
Standard:true

Whether this coupon is enabled or not.

Beispiel:

true

Antwort

Coupon resource created

code
string
erforderlich

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

Beispiel:

"10OFF"

name
string
erforderlich

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

Beispiel:

"10% off"

type
any
erforderlich

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.
Beispiel:

"percentage"

frequency
any
erforderlich

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.
Beispiel:

"limited"

id
string
read-only

The id of this coupon.

percentage
integer | null

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

Erforderlicher Bereich: 0 <= x <= 100
Beispiel:

10

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.

Beispiel:

3

maxRedemptionsPerCustomer
integer | null
Standard:null

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

Beispiel:

null

maxRedemptions
integer | null
Standard:null

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

Beispiel:

null

expiresAt
string<date-time> | null
Standard:null

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

Beispiel:

null

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
Standard:true

Whether this coupon is enabled or not.

Beispiel:

true

createdAt
string<date-time>
read-only

The date and time when the resource was created.

Beispiel:

"2021-01-01T00:00:00+00:00"

updatedAt
string<date-time>
read-only

The date and time when the resource was last updated.

Beispiel:

"2021-01-01T00:00:00+00:00"

reedemptions
boolean
read-only

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