Update a coupon
Saves the coupon whole: send every field as it should be, not only what changed. A field left out goes back to its default. The exceptions are appliesTo and targets, which stay as they are when appliesTo is left out, and customerTag, which stays as it is when left out.
Needs the coupons.write permission (Change Coupons).
Authorizations
A secret API key, made under Developers in the dashboard: Authorization: Bearer shoply_sk_...
Headers
A word of your own for this one change, up to 180 letters, digits, dots, dashes, underscores and colons. Sent again with the same key, the request is not carried out twice: the first answer comes back, with Idempotent-Replay: true.
Path Parameters
The store's ID. A key reaches the store it was made in: GET /key answers which.
The coupon.
Query Parameters
The time zone a bare date in expiresAt is read in, as an IANA name. Left out, UTC.
"Europe/Berlin"
Body
What a buyer types. 3 to 64 letters, digits, hyphens or underscores, kept in capitals. One coupon a code in a store.
"WELCOME10"
How much comes off: 1 to 100 for percent, an amount for fixed.
10
A share of the order, or an amount in the store's currency.
percent, fixed How many orders may use it. 0 is no limit.
The smallest order it works on, before discounts. 0 is any order.
When it stops working: a date (2026-12-31, good to the end of that day) or a date and time. Empty is never.
"2026-12-31"
Whether buyers can use it.
The coupon category it is filed in. Left out, it goes in the store's Default category.
Every product, or only the ones in targets.
all, some The products it works on when appliesTo is some. Each names a product, and optionally one variant of it.
Who may use it: empty for anybody with the code, vip, or the ID of one of the store's tags. The buyer's email has to wear the tag when the code is applied and when they pay.
The updatedAt you last read. Sent, the change is refused with stale_write if the record has changed since. Left out, it is saved whatever happened in between.

