ESTAGE Support
IdeasMy tickets

Create a coupon or store discount

Permission coupons:writeRate limit writesIdempotent with Idempotency-Key

Two types. coupon_type product: discount + discount_type (percent | fixed | free), with products[] and tags[] to limit it. coupon_type commerce (store discount): kind order | product | buy_x_get_y | free_shipping; method code (default) or automatic; discount_type percent | fixed (with value), or free (buy_x_get_y only); applies_to for kind product; buy/get for buy_x_get_y; optional min_subtotal, min_quantity, customer_orders_min/max, once_per_customer, combines_with. code is always required — for an automatic discount it is the title shown on the cart. is_active defaults to true. Product, collection and tag ids must belong to this project.

More examples: - Product coupon: {"code":"VIP20","coupon_type":"product","discount":20,"discount_type":"percent","products":[812]} - Off some products: {"code":"TEES5","coupon_type":"commerce","kind":"product","discount_type":"fixed","value":5,"applies_to":{"collection_ids":[31]}} - Buy 2 get 1 free: {"code":"B2G1","coupon_type":"commerce","kind":"buy_x_get_y","discount_type":"free","buy":{"quantity":2,"collection_ids":[31]},"get":{"quantity":1,"collection_ids":[31]}} - Automatic free shipping: {"code":"Free shipping over $75","coupon_type":"commerce","method":"automatic","kind":"free_shipping","min_subtotal":75}

POSThttps://api.estage.com/v1/coupons

Authorization

ESTAGE-API-Keystringheaderrequired

A project key, est_live_…, from Settings → API keys. Call from server code only.

Body

application/json
codestringrequired≤ 255 chars

What the buyer types; unique in the project. For an automatic discount (method automatic) it is the title the buyer sees on the cart. title is accepted as an alias.

coupon_typestringrequired

product: a coupon on products sold through product checkout (discount, discount_type, products, tags). commerce: a store discount (method, kind, discount_type, value, applies_to, buy/get, minimums, combines_with).

One of product, commerce

is_activebooleandefault true
usage_countintegernullable≥ 1

How many times it can be used in total; null = unlimited.

start_datestringdate
end_datestringdate
commentsstringnullable≤ 2000 chars

Internal note.

discountintegernullable≥ 0

coupon_type product only (required there): the amount, a whole number — percent or money depending on discount_type. For commerce, value is used.

discount_typestringnullable

Required for coupon_type product, and for commerce kinds except free_shipping. For commerce, free is allowed only with kind buy_x_get_y; for a 100% off elsewhere use percent 100.

One of percent, fixed, free

recurring_rebillsboolean

coupon_type product only.

productsarray of integernullable≤ 500 items

coupon_type product only: product ids of this project the coupon applies to. Ignored for commerce (use applies_to).

tagsarray of integernullable≤ 100 items

coupon_type product only: contact tag ids of this project; only buyers with one of these tags can use the coupon. Ignored for commerce.

methodstringnullabledefault "code"

commerce only: code = the buyer types code; automatic = applied to every qualifying cart.

One of code, automatic

kindstringnullable

commerce only, required there. order: off the whole order. product: off the products in applies_to. buy_x_get_y: buy what buy says, get get discounted. free_shipping: shipping is free (value and discount_type are ignored).

One of order, product, buy_x_get_y, free_shipping

valuenumbernullable≥ 0

commerce only: required for percent (above 0, at most 100) and fixed (money in the store currency). Ignored for free and free_shipping.

applies_toobjectnullable

commerce kind product only: which products are discounted. Omitted or all lists empty = every product. Ignored for other kinds.

Show 3 fields
product_idsarray of integer

Products of this project.

product_typesarray of string

Product type values (as on the product).

collection_idsarray of integer

Collections of this project.

buyobjectnullable

commerce kind buy_x_get_y only (required there): what the buyer must buy — quantity or amount, plus an optional product scope.

Show 5 fields
quantityinteger≥ 1
amountnumber≥ 0

Spend at least this much instead of a quantity.

product_idsarray of integer
product_typesarray of string
collection_idsarray of integer
getobjectnullable

commerce kind buy_x_get_y only: what the buyer gets discounted (by discount_type/value, or free).

Show 5 fields
quantityintegerdefault 1≥ 1
max_repeatsinteger≥ 1

How many times the offer can apply in one order.

product_idsarray of integer
product_typesarray of string
collection_idsarray of integer
min_subtotalnumbernullable≥ 0

commerce only: the cart subtotal needed.

min_quantityintegernullable≥ 1

commerce only: the number of items needed.

customer_orders_minintegernullable≥ 0

commerce only: the buyer must have at least this many earlier orders.

customer_orders_maxintegernullable≥ 0

commerce only: the buyer must have at most this many earlier orders (0 = first order only).

once_per_customerboolean

commerce only.

combines_withobjectnullable

commerce only: which other discount classes this one may stack with. Missing keys = false.

Show 3 fields
productboolean
orderboolean
shippingboolean

Headers

Idempotency-Keystring≤ 255 chars

Any unique string per attempt. A retry with the same key gets the first answer back instead of doing the work twice.

RequestcURL
curl --request POST \
  --url 'https://api.estage.com/v1/coupons' \
  --header 'ESTAGE-API-Key: est_live_your-api-key' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: your-unique-key' \
  --data '{
    "code": "SUMMER10",
    "coupon_type": "commerce",
    "kind": "order",
    "discount_type": "percent",
    "value": 10,
    "min_subtotal": 50,
    "end_date": "2027-01-31"
  }'
Created
{
  "data": {
    "id": 412,
    "code": "SUMMER10",
    "coupon_type": "commerce",
    "method": "code",
    "kind": "order",
    "discount_type": "percent",
    "discount": 10,
    "value": "10.00",
    "applies_to": null,
    "buy": null,
    "get": null,
    "min_subtotal": "50.00",
    "min_quantity": null,
    "customer_orders_min": null,
    "customer_orders_max": null,
    "once_per_customer": false,
    "combines_with": {
      "product": false,
      "order": false,
      "shipping": false
    },
    "products": null,
    "tags": null,
    "recurring_rebills": false,
    "usage_count": null,
    "used_count": 0,
    "is_active": true,
    "usable_now": true,
    "start_date": null,
    "end_date": "2027-01-31",
    "comments": null,
    "summary": "10% off the order",
    "created_at": "2026-11-02T14:05:31Z",
    "updated_at": "2026-11-02T14:05:31Z"
  }
}
Example. Errors are { error: { code, message, details } }.