Skip to main content
POST
Create a discount.

Authorizations

x-api-key
string
header
required

API key for authentication. You can find your API key in the Creem dashboard under Settings > API Keys.

Body

application/json

Discount creation payload

name
string
required

The name of the discount.

Example:

"Holiday Sale"

type
enum<string>
required

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

Available options:
percentage,
fixed
duration
enum<string>
required

The duration type for the discount.

Available options:
forever,
once,
repeating
Example:

"repeating"

applies_to_products
string[]
required

The list of product IDs to which this discount applies.

Example:
code
string

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

Example:

"HOLIDAY2024"

amount
number

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

Example:

20

currency
string

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

Example:

"USD"

percentage
number

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

Example:

15

expiry_date
string<date-time>

The expiry date of the discount.

Example:

"2024-12-31T23:59:59Z"

max_redemptions
number

The maximum number of redemptions for the discount.

Example:

100

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.

Example:

6

Response

Successfully created a discount

id
string
required

Unique identifier for the object.

mode
enum<string>
required

String representing the environment.

Available options:
test,
prod,
sandbox
object
string
required

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

Example:

"discount"

status
enum<string>
required

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

Available options:
deleted,
active,
draft,
expired,
scheduled
Example:

"active"

name
string
required

The name of the discount.

Example:

"Holiday Sale"

code
string
required

The discount code. A unique identifier for the discount.

Example:

"HOLIDAY2024"

type
enum<string>
required

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

Available options:
percentage,
fixed
Example:

"percentage"

amount
number

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

Example:

20

currency
string

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

Example:

"USD"

percentage
number

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

Example:

15

expiry_date
string<date-time>

The expiry date of the discount.

Example:

"2024-12-31T23:59:59Z"

max_redemptions
number

The maximum number of redemptions allowed for the discount.

Example:

100

duration
enum<string>

The duration type for the discount.

Available options:
forever,
once,
repeating
Example:

"repeating"

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.

Example:

6

applies_to_products
string[]

The list of product IDs to which this discount applies.

Example:
redeem_count
number

The number of times this discount has been redeemed.

Example:

15