Developers

Coupons

Markdown

Update a coupon

Changes the value and rules of a coupon. Requires If-Match.

PATCH/stores/{storeId}/v1/coupons/{id}

Path parameters

idstringrequired

Headers

If-Matchstringrequired
ETag from a GET of this same resource projection.

Request body

codestring
namestring | null
valuenumber
The percentage from 0 to 100, or the amount in SAR.
typestring
percent fixed
activeboolean
start_datestring | null (date)
expirystring | null (date)
The last day the coupon works.
usage_limitinteger | null
scopestring
all category product
scope_idsarray<integer>
discounted_policystring
On discounted products: all applies, exclude skips them, block refuses the coupon with them.all exclude block

Response

dataobjectrequired
idstring
codestring
namestring | null
typestring
percent fixed
valuestring
Discount percentage or amount.
usageinteger
Number of uses.
usage_limitinteger | null
start_datestring | null (date)
expirystring | null (date)
activeboolean
scopestring
all category product
scope_idsarray | null
discounted_policystring
all exclude block
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

HTTPCodeMeaning
428PRECONDITION_REQUIREDNo If-Match header.
412RESOURCE_CHANGEDThe resource changed after you read it; read it again.
404RESOURCE_NOT_FOUNDThe ID does not exist in this store.
409STORE_RULE_REFUSEDA store rule refused the command. Read the resource before you try again.
422INVALID_INPUTThe store refused a value. Check the limits on this page.
422EMPTY_MUTATIONNo field was sent.
422UNKNOWN_FIELDUnknown field.
403SCOPE_REQUIREDThe token does not carry the required scope.
503APPS_SCOPE_RUNTIME_NOT_READYThe resource is not enabled on this merchant's store yet.

Shared codes are listed in Errors.

    ↑↓ moveEnter openEsc close