Skip to main content
PATCH
cURL

Authorizations

Authorization
string
header
required

An access token from the OAuth flow (eo_at_...). It lasts one hour; refresh it with the refresh token. See Authentication.

Path Parameters

id
string<uuid>
required

The coupon's ID.

Body

application/json

Every field is optional; only the fields sent change. null clears starts_at or expires_at and is refused anywhere else. applicable_items replaces the coupon's items.

method
enum<string>

code: the shopper types the code at checkout. automatic: applied without a code.

Available options:
code,
automatic
code
string

Letters of any language, digits, - and _. Trimmed and saved lowercased. "" removes the code.

Maximum string length: 64
title
string

One line, trimmed, no <.

Maximum string length: 255
discount_type
enum<string>

amount_off_products: off the products' prices. amount_off_order: off the order. free_shipping: off the shipping cost. buy_x_get_y: buy some items, get others free or discounted.

Available options:
amount_off_products,
amount_off_order,
free_shipping,
buy_x_get_y
value_type
enum<string>
Available options:
fixed,
percentage
value
number

An amount in the store's currency, with at most 4 decimals.

Required range: 0 <= x <= 100000000
min_order_amount
number

An amount in the store's currency, with at most 4 decimals.

Required range: 0 <= x <= 100000000
min_quantity
integer
Required range: 0 <= x <= 1000000
max_discount_amount
number

An amount in the store's currency, with at most 4 decimals.

Required range: 0 <= x <= 100000000
usage_limit
integer

0 is no limit.

Required range: 0 <= x <= 1000000000
is_active
boolean
starts_at
string<date-time> | null

null removes the start.

expires_at
string<date-time> | null

null removes the expiry.

applies_to
enum<string>

specific_products and specific_categories need applicable_items.

Available options:
all,
specific_products,
specific_categories
buy_quantity
integer
Required range: 0 <= x <= 1000000
buy_requirement_type
enum<string>
Available options:
quantity,
amount
buy_amount
number

An amount in the store's currency, with at most 4 decimals.

Required range: 0 <= x <= 100000000
get_quantity
integer
Required range: 0 <= x <= 1000000
get_value_type
enum<string>
Available options:
free,
percentage,
fixed
get_value
number

An amount in the store's currency, with at most 4 decimals.

Required range: 0 <= x <= 100000000
max_uses_per_order
integer
Required range: 0 <= x <= 1000000
max_shipping_discount
number

An amount in the store's currency, with at most 4 decimals.

Required range: 0 <= x <= 100000000
exclude_shipping_over
number

An amount in the store's currency, with at most 4 decimals.

Required range: 0 <= x <= 100000000
combines_with_product
boolean
combines_with_order
boolean
combines_with_shipping
boolean
applicable_items
object[]

Replaces every item of the coupon. No item twice.

Maximum array length: 100

Response

The coupon.

coupon
object
required