Coupons
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
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 |
|---|---|---|
| 428 | PRECONDITION_REQUIRED | No If-Match header. |
| 412 | RESOURCE_CHANGED | The resource changed after you read it; read it again. |
| 404 | RESOURCE_NOT_FOUND | The ID does not exist in this store. |
| 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 | EMPTY_MUTATION | No field was sent. |
| 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. |
Shared codes are listed in Errors.