Skip to main content
PATCH
Update 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.

Path Parameters

id
string
required

The discount ID

Body

application/json

Discount update payload

name
string

The name of the discount.

Maximum string length: 40
Example:

"Summer Sale"

type
enum<string>

The type of the discount. Fixed once the discount has been redeemed, or while a checkout confirmed with it in the last 7 days holds it (409 discount_redeemed); the same applies to amount, percentage, currency, duration and duration_in_months. Changing it needs the new amount or percentage.

Available options:
percentage,
fixed
amount
integer

The amount of a fixed discount, in minor units (cents) as a whole number. Fixed once the discount has been redeemed.

Required range: x >= 2
Example:

2000

percentage
number

The percentage, for a percentage discount. Fixed once the discount has been redeemed.

Required range: 1 <= x <= 100
Example:

15

currency
string

The currency of a fixed discount. Fixed once the discount has been redeemed.

Example:

"USD"

expiry_date
string<date-time> | null

The expiry date of the discount, in the future. null removes the expiry.

Example:

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

max_redemptions
integer | null

The maximum number of redemptions. null removes the limit. Below the redemptions so far answers 409 max_redemptions_below_redeemed.

Required range: 1 <= x <= 2147483647
Example:

100

duration
enum<string>

The duration type. Fixed once the discount has been redeemed.

Available options:
forever,
once,
repeating
duration_in_months
integer | null

The number of months for a repeating discount. Fixed once the discount has been redeemed. A discount that is repeating after the update needs it: null there, or duration: repeating without months on a discount that has none, answers 400 invalid_duration_in_months.

Required range: 1 <= x <= 1200
Example:

6

applies_to_products
string[]

Product IDs. When this list or applies_to_product_external_ids is sent, their union replaces the whole product set; when neither is sent, the set stays as it is.

Example:
applies_to_product_external_ids
string[]

Products named by their external_id, at most 100, combined with applies_to_products. A key no product of your store has answers 400 reference_not_found.

Maximum array length: 100
Example:
external_id
string | null

Your own key for the discount, unique in your store: 1 to 255 characters: letters, digits, _, -, . and :. null removes it. A key another discount uses answers 409 external_id_taken.

Example:

"spring-2026"

Response

Successfully updated the 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"

external_id
string | null
required

Your own key for the discount, unique in your store. null when the discount has none.

Example:

"spring-2026"

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