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

Headers

Idempotency-Key
string

A unique key (up to 255 printable ASCII characters). The same key from your app within 24 hours answers the first result again, with Idempotent-Replayed: true, instead of creating twice.

Maximum string length: 255

Body

application/json

Only starts_at and expires_at take null.

method
enum<string>
required

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

Available options:
code,
automatic
discount_type
enum<string>
required

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
code
string

Letters of any language, digits, - and _. Trimmed and saved lowercased. Required on a code coupon; "" (or left out) on an automatic one.

Maximum string length: 64
title
string

One line, trimmed, no <. Required on an automatic coupon.

Maximum string length: 255
value_type
enum<string>
default:fixed
Available options:
fixed,
percentage
value
number

Above 0 for amount_off_products and amount_off_order; at most 100 as a percentage.

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
default:0

0 is no limit.

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

RFC 3339, from 2000-01-01T00:00:00Z to 2100-01-01T00:00:00Z. Kept in UTC, to the microsecond.

expires_at
string<date-time> | null

Not before starts_at.

applies_to
enum<string>
default:all

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>
default:quantity
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>
default:free
Available options:
free,
percentage,
fixed
get_value
number

Above 0 unless get_value_type is free; at most 100 as a percentage.

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
default:false
combines_with_order
boolean
default:false
combines_with_shipping
boolean
default:false
applicable_items
object[]

No item twice.

Maximum array length: 100

Response

The coupon created. Location is its path.

coupon
object
required