Create a code or automatic discount
POST
/ admin/ v1/ stores/ {store_id}/ discounts- discounts:write
- Idempotency-Key supported
Create a code or automatic discount.
Path parameters
store_idstringrequiredThe store's ID, like
store_01k8qs5s…. Apps get it with the install, in the OAuth redirect and the token response.
Headers
Idempotency-KeystringSend the same key to retry safely: the first answer is replayed for 24 hours.
shop-api-versionYYYY-MMThe version to answer in. Without it, your app’s pinned version, else the newest.
Body
titlestringrequiredmethodenumrequired- code
- automatic
- unique_codes
effectobject | object | object | object | object | objectrequiredWhat a discount does.
title_translationsobjectThe name shoppers see in the store's other languages, by locale (
{"ar": "…"}).codestring · or nullRequired for code discounts: 1–64 letters, digits,
-or_.requirementobject | object | object · or nullDefaults to none.
eligibilityobject | object | object | object · or nullDefaults to everyone.
combines_withobject · or nullDefaults to combining with nothing.
Returns
201 Discount created.
Errors
- 403
forbiddenMissing permission. - 409Code taken or automatic discount limit reached.
- 422
validation_failedValidation failed.