Skip to main content

Create

Creates a new coupon.

Model Attributes

amount_off integer

Amount (in the `currency` specified) that will be taken off the subtotal of any checkout.

currency string

If `amount_off` has been set, the three-letter ISO code for the currency of the amount to take off.

duration string

One of `forever`, `once`, and `repeating`. Describes how long a discount with this coupon will be applied. (The `repeating` and `forever` values only apply to subscriptions.)

duration_in_months integer

If `duration` is `repeating`, the number of months the coupon applies. Null if coupon `duration` is `forever` or `once`.

max_redemptions integer

Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid.

name string

Name of the coupon displayed to customers.

percent_off number

Percent that will be taken off the subtotal of any checkout. For example, a coupon with percent_off of 50 will make a $100 checkout $50 instead.

redeem_by integer

Date after which the coupon can no longer be redeemed.

metadata object

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

promotions array

A list of this product's promotions. (This can only be set when creating a new coupon.)

Response Attributes

id string

The UUID of the specific object.

object string

A string describing the object type returned.

amount_off integer

Amount (in the `currency` specified) that will be taken off the subtotal of any checkout.

currency string

If `amount_off` has been set, the three-letter ISO code for the currency of the amount to take off.

duration string

One of `forever`, `once`, and `repeating`. Describes how long a discount with this coupon will be applied. (The `repeating` and `forever` values only apply to subscriptions.)

duration_in_months integer

If `duration` is `repeating`, the number of months the coupon applies. Null if coupon `duration` is `forever` or `once`.

max_redemptions integer

Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid.

name string

Name of the coupon displayed to customers.

percent_off number

Percent that will be taken off the subtotal of any checkout. For example, a coupon with percent_off of 50 will make a $100 checkout $50 instead.

redeem_by integer

Date after which the coupon can no longer be redeemed.

metadata object

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

expired boolean

Taking into account the above properties, whether this coupon can still be applied to a checkout.

promotions expandable

A list of associated promotions.

times_redeemed integer

Number of times this coupon has been applied to a checkout and/or subscription.

created_at integer

Time at which the object was created. Measured in seconds since the Unix epoch.

updated_at integer

Time at which the object was last updated. Measured in seconds since the Unix epoch.