PATCH

Update Discount Rule


Updates a discount rule.

Each time the discount rule is updated, revision increments by 1. The existing revision must be included when updating the discount rule. This ensures you're working with the latest discount rule information, and it prevents unintended overwrites.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Manage eCommerce - all permissions
Manage Stores - all permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
PATCH
https://www.wixapis.com/ecom/v1/discount-rules/{discountRule.id}

Path Params
discountRule.idstringRequired

Discount rule ID.

Body Params
discountRuleDiscountRuleRequired

Discount rule info.

Response Object
discountRuleDiscountRule

Updated discount rule.

Update Discount Rule Example 1
Request
cURL
curl -X PATCH \ 'https://www.wixapis.com/ecom/v1/discount-rules/update/35120105-1327-4624-8f7f-2720dcbab4d6' \ -H 'Content-Type: application/json' \ -H 'Authorization: <AUTH>' \ --data-binary '{ "discountRule": { "id": "35120105-1327-4624-8f7f-2720dcbab4d6", "name": "discount new name", "revision": "5" } }'
Response
JSON
{ "discountRule": { "id": "35120105-1327-4624-8f7f-2720dcbab4d6", "revision": "6", "createdDate": "2022-08-08T07:46:16.487Z", "updatedDate": "2022-08-08T07:46:16.487Z", "active": true, "name": "discount new name", "trigger": { "itemQuantityRange": { "scopes": [ { "id": "all_215238eb-22a5-4c36-9e7b-e7c08025e04e", "type": "CATALOG_ITEM", "catalogItemFilter": { "catalogAppId": "215238eb-22a5-4c36-9e7b-e7c08025e04e", "catalogItemIds": [] } } ], "from": 5, "to": null }, "triggerType": "ITEM_QUANTITY_RANGE", "activeTimeInfo": null, "discounts": { "values": [ { "targetType": "SPECIFIC_ITEMS", "specificItemsInfo": { "scopes": [ { "id": "all_215238eb-22a5-4c36-9e7b-e7c08025e04e", "type": "CATALOG_ITEM", "catalogItemFilter": { "catalogAppId": "215238eb-22a5-4c36-9e7b-e7c08025e04e", "catalogItemIds": [] } } ] }, "percentage": 15, "discountType": "PERCENTAGE" } ] }, "status": "LIVE", "usageCount": 0 } } }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Event TriggersThis method triggers the following events:
Did this help?