POST
/
v1
/
discounts

Headers

x-api-key
string
required

Body

application/json
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
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
applies_to_products
string[]

The list of product IDs to which this discount applies.

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".

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.

expiry_date
string

The expiry date of the discount.

max_redemptions
number

The maximum number of redemptions for the discount.

percentage
number

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

Response

200 - application/json
amount
number
required

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

code
string
required

The discount code. A unique identifier for the discount.

id
string
required

Unique identifier for the object.

mode
enum<string>
required

String representing the environment.

Available options:
test,
live,
sandbox
name
string
required

The name of the discount.

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
type
enum<string>
required

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

Available options:
percentage,
fixed
applies_to_products
string[]

The list of product IDs to which this discount applies.

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.

expiry_date
string

The expiry date of the discount.

max_redemptions
object

The maximum number of redemptions allowed for the discount.

percentage
number

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