Update a coupon
PATCH methodhttps://api.anyshop.io/v1/coupons/{id}
Changes the fields you send and nothing else, by the same rules as creating one. An archived coupon cannot be changed. Needs a live key.
Path parameters
idstring required
Body
application/json0 required, 9 optionalcodestring What buyers type: 3 to 32 letters and digits, kept in capitalsUp to 64 characterspercent_offnumber Makes it a percent off: 0.01 to 100, at most two decimals0.01 to 100amount_offinteger Makes it an amount off the order, in minor units of the store currencyAt least 1currencystring Optional check: the store's currency, ISO 4217. Another currency is refused, since amounts off are in the store's3 charactersproductsarray of strings or null Product IDs it applies to, up to 200; null for every product1 to 200 itemsusage_limitinteger or null Uses allowed, counted in each mode on its own1 to 10,000,000once_per_emailboolean One use per buyer emailstarts_atstring or null When it starts working, ISO 8601ends_atstring or null When it stops working, ISO 8601: after starts_at, and not in the past
Headers
Idempotency-Keystring Up to 255 characters. A retry with the same key and request gets the first answer, without running twice (24 hours).
Returns
The coupon object.
Errors
Status and error.type400invalid_requestThe request is not valid;error.paramnames the field401authenticationNo API key, or it is not valid403permissionThe key does not have the scope this needs, or the store is suspended (store_suspended)404not_foundNot found in the key's store and mode409conflictConflicts with the object's state (type conflict), or an Idempotency-Key reused for another request (type idempotency, code idempotency_key_reused)429rate_limitedToo many requests; see Retry-After