POST
/
v1
/
discounts

Headers

x-api-key
string
required

Body

application/json
name
string
required

The name of the discount.

type
enum<string>
required

The type of the discount, either "percentage" or "fixed".

Available options:
percentage,
fixed
amount
number
required

The fixed value for the discount. Only applicable if the type is "fixed".

duration
enum<string>
required

The duration type for the discount.

Available options:
forever,
once,
repeating
code
string

Optional discount code. If left empty, a code will be generated.

currency
string

The currency of the discount. Only required if type is "fixed".

percentage
number

The percentage value for the discount. Only applicable if the type is "percentage".

expiry_date
string

The expiry date of the discount.

max_redemptions
number

The maximum number of redemptions for the discount.

duration_in_months
number

The number of months the discount is valid for. Only applicable if the duration is "repeating" and the product is a subscription.

applies_to_products
string[]

The list of product IDs to which this discount applies.

Response

200 - application/json
id
string
required

Unique identifier for the object.

mode
enum<string>
required

String representing the environment.

Available options:
test,
live,
sandbox
object
string
required

A string representing the object’s type. Objects of the same type share the same value.

status
enum<string>
required

The status of the discount (e.g., active, inactive).

Available options:
active,
draft,
expired,
scheduled
name
string
required

The name of the discount.

code
string
required

The discount code. A unique identifier for the discount.

type
enum<string>
required

The type of the discount, either "percentage" or "fixed".

Available options:
percentage,
fixed
amount
number
required

The amount of the discount. Can be a percentage or a fixed amount.

percentage
number

The percentage of the discount. Only applicable if type is "percentage".

expiry_date
string

The expiry date of the discount.

max_redemptions
object

The maximum number of redemptions allowed for the discount.

duration
enum<string>

The duration type for the discount.

Available options:
forever,
once,
repeating
duration_in_months
object

The number of months the discount is valid for. Only applicable if the duration is "repeating" and the product is a subscription.

applies_to_products
string[]

The list of product IDs to which this discount applies.