code is up to 64 characters and is saved in capitals. value is a number: a percentage from 0 to 100 when type is percent (the default), or an amount in SAR when type is fixed. scope limits the coupon to the category or product IDs in scope_ids. discounted_policy decides what happens on discounted products: all applies, exclude skips them, and block refuses the coupon with them. See Marketing and customer messages.
Headers
Idempotency-Keystringrequired
Request body
codestringrequired
namestring | null
valuenumberrequired
The percentage from 0 to 100, or the amount in SAR.
typestring
percentfixed
activeboolean
start_datestring | null (date)
expirystring | null (date)
The last day the coupon works.
usage_limitinteger | null
scopestring
allcategoryproduct
scope_idsarray<integer>
discounted_policystring
On discounted products: all applies, exclude skips them, block refuses the coupon with them.allexcludeblock
Response
dataobjectrequired
idstring
codestring
namestring | null
typestring
percentfixed
valuestring
Discount percentage or amount.
usageinteger
Number of uses.
usage_limitinteger | null
start_datestring | null (date)
expirystring | null (date)
activeboolean
scopestring
allcategoryproduct
scope_idsarray | null
discounted_policystring
allexcludeblock
executionobject
Who executed the request: the app, version, installation and store. Field names here are camelCase.
appIdstring (uuid)
versionIdstring (uuid)
installationIdstring (uuid)
storeIdstring (uuid)
requestIdstring (uuid)
generationinteger
routeEpochinteger
appAuthEpochinteger
grantRevisioninteger
metaobjectrequired
request_idstring (uuid)
The request ID; include it in any support request.
Errors
HTTP
Code
Meaning
400
IDEMPOTENCY_KEY_REQUIRED
No Idempotency-Key header.
409
STORE_RULE_REFUSED
A store rule refused the command. Read the resource before you try again.
422
INVALID_INPUT
The store refused a value. Check the limits on this page.
422
UNKNOWN_FIELD
Unknown field.
403
SCOPE_REQUIRED
The token does not carry the required scope.
503
APPS_SCOPE_RUNTIME_NOT_READY
The resource is not enabled on this merchant's store yet.