About Discount Rules API

The Wix eCommerce Discount Rules API allows you to create and manage discount rules. Discount rules are sets of triggers and scopes that together define the necessary conditions for a discount to apply to items in the cart/checkout.

With the Discount Rules API, you can:

Before you begin

  • Currently only item-level discounts are supported. Discounts for an entire cart/checkout are not yet supported.
  • Up to 5 triggers can be chained together.

Terminology

  • Discount rule: A set of conditions (scope and trigger) that dictate whether an item qualifies for a specified discount.

  • Discount: The change applied to an item's price when conditions are met. Discounts can reduce an item's price by percentage or a specified amount, and also by setting an item to a fixed price.

    • Discounts must have a defined scope/s
  • Scope: A group of catalog items that qualify for a discount.

    • Every catalog has up to 2 scopes "out of the box". For example, Wix Stores has Specific Products and All Products scopes.
    • Scopes are required in default triggers and discount objects.
    • Triggers and discounts can have multiple scopes.
  • Trigger: A set of conditions that must be met for a discount to become applicable. Triggers can be chained so that more than 1 condition must be met.

    • Default triggers: These built-in triggers fire when a specified minimum/maximum item quantity (for example, "at least 5 items") or cart subtotal ("no more than $100") is reached. For this trigger to fire, the items must also be part of a defined scope.
    • Custom triggers: Using the Custom Trigger Integration service plugin you can provide any set of conditions you want. For example, a trigger that only fires for grey items, or only between 8pm-10pm on Mondays and Thursdays.
Did this help?

Discount Rule Object


Manage Discount Rules.

Properties
idstringRead-onlyformat GUID

Discount rule ID.


revisionintegerRead-onlyformat int64

Revision number, which increments by 1 each time the discount rule is updated. To prevent conflicting changes, the current revision must be passed when updating the discount rule.


createdDatestringRead-onlyformat date-time

Date and time the discount rule was created.


updatedDatestringRead-onlyformat date-time

Date and time the discount rule was last updated.


activeboolean

Whether the discount rule is active.

Default: true


namestringminLength 1maxLength 50

Discount rule name.


triggerTrigger

Discount rule trigger. A set of conditions that must be met for the discounts to be applied. Not passing a trigger will cause the discount to always apply.


activeTimeInfoActiveTimeInfo

Time frame in which the discount rule is active.


discountsDiscounts

List of discounts that are applied when one or more triggers are met.

Notes:

  • Currently, only 1 discount can be defined per discount rule.
  • A discount rule can be applied on multiple items per cart.
  • A discount rule can only be applied once per item.

statusstringRead-only

Discount rule status.


usageCountintegerRead-only

Number of times the discount rule was used.

DiscountRule
JSON
{ "id": "15bac455-10d0-4478-8358-e06f697f6180", "revision": "8", "createdDate": "2022-08-07T08:12:22.347Z", "updatedDate": "2022-08-09T07:45:44.044Z", "active": true, "name": "My Amazing 10% Discount", "trigger": { "and": { "triggers": [ { "subtotalRange": { "scopes": [ { "id": "specific_215238eb-22a5-4c36-9e7b-e7c08025e04e", "type": "CATALOG_ITEM", "catalogItemFilter": { "catalogAppId": "215238eb-22a5-4c36-9e7b-e7c08025e04e", "catalogItemIds": [ "f150b16a-79ef-ef81-50f9-22e2df631822", "187a07f6-b670-0650-c891-d60aeb797ee0" ] } } ], "from": "100", "to": null }, "triggerType": "SUBTOTAL_RANGE" }, { "itemQuantityRange": { "scopes": [ { "id": "specific_215238eb-22a5-4c36-9e7b-e7c08025e04e", "type": "CATALOG_ITEM", "catalogItemFilter": { "catalogAppId": "215238eb-22a5-4c36-9e7b-e7c08025e04e", "catalogItemIds": [ "f150b16a-79ef-ef81-50f9-22e2df631822", "187a07f6-b670-0650-c891-d60aeb797ee0" ] } } ], "from": 5, "to": null }, "triggerType": "ITEM_QUANTITY_RANGE" } ] }, "triggerType": "AND" }, "activeTimeInfo": { "start": "2022-08-07T08:11:00Z", "end": "2022-08-11T07:43:00Z" }, "discounts": { "values": [ { "targetType": "SPECIFIC_ITEMS", "specificItemsInfo": { "scopes": [ { "id": "specific_215238eb-22a5-4c36-9e7b-e7c08025e04e", "type": "CATALOG_ITEM", "catalogItemFilter": { "catalogAppId": "215238eb-22a5-4c36-9e7b-e7c08025e04e", "catalogItemIds": [ "f150b16a-79ef-ef81-50f9-22e2df631822", "187a07f6-b670-0650-c891-d60aeb797ee0" ] } } ] }, "percentage": 10, "discountType": "PERCENTAGE" } ] }, "status": "LIVE", "usageCount": 6 }
Did this help?

POST

Create Discount Rule


Creates a new discount rule.

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
POST
https://www.wixapis.com/ecom/v1/discount-rules

Body Params
discountRuleDiscountRuleRequired

Discount rule info.

Response Object
discountRuleDiscountRule

Discount rule.

Request
cURL
curl -X POST \ 'https://www.wixapis.com/ecom/v1/discount-rules/create' \ -H 'Content-Type: application/json' \ -H 'Authorization: <AUTH>' \ --data-binary '{ "discountRule": { "active": true, "name": "15% on all products when buying more than 5 items", "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" }, "discounts": { "values": [ { "targetType": "SPECIFIC_ITEMS", "specificItemsInfo": { "scopes": [ { "id": "all_215238eb-22a5-4c36-9e7b-e7c08025e04e", "type": "CATALOG_ITEM", "catalogItemFilter": { "catalogItemIds": [], "catalogAppId": "215238eb-22a5-4c36-9e7b-e7c08025e04e" } } ] }, "discountType": "PERCENTAGE", "percentage": 15 } ] } } }'
Response
JSON
{ "discountRule": { "id": "f6a7b058-62c3-44aa-a23a-e6d0898dcdc2", "revision": "1", "createdDate": "2023-06-27T09:33:04.796Z", "updatedDate": "2023-06-27T09:33:04.796Z", "active": true, "name": "15% on all products when buying more than 5 items", "trigger": { "itemQuantityRange": { "scopes": [ { "id": "all_215238eb-22a5-4c36-9e7b-e7c08025e04e", "type": "CATALOG_ITEM", "catalogItemFilter": { "catalogAppId": "215238eb-22a5-4c36-9e7b-e7c08025e04e", "catalogItemIds": [] } } ], "from": 5 }, "triggerType": "ITEM_QUANTITY_RANGE" }, "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
428Failed Precondition

There is 1 error with this status code:

See the entire list and learn more about Wix errors.

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

GET

Get Discount Rule


Retrieves a discount rule.

Authentication

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

Permissions
Manage eCommerce - all permissions
Read eCommerce - all read permissions
Manage Stores - all permissions
Read Stores - all read permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
GET
https://www.wixapis.com/ecom/v1/discount-rules/{discountRuleId}

Path Params
discountRuleIdstringRequired

ID of the discount rule to retrieve.

Response Object
discountRuleDiscountRule

The requested discount rule.

Get Discount Rule Example 1
Request
cURL
curl 'https://www.wixapis.com/ecom/v1/discount-rules/15bac455-10d0-4478-8358-e06f697f6180' \ -H 'Authorization: <AUTH>'
Response
JSON
{ "id": "15bac455-10d0-4478-8358-e06f697f6180", "revision": "8", "createdDate": "2022-08-07T08:12:22.347Z", "updatedDate": "2022-08-09T07:45:44.044Z", "active": true, "name": "My Amazing 10% Discount", "trigger": { "and": { "triggers": [ { "subtotalRange": { "scopes": [ { "id": "specific_215238eb-22a5-4c36-9e7b-e7c08025e04e", "type": "CATALOG_ITEM", "catalogItemFilter": { "catalogAppId": "215238eb-22a5-4c36-9e7b-e7c08025e04e", "catalogItemIds": [ "f150b16a-79ef-ef81-50f9-22e2df631822", "187a07f6-b670-0650-c891-d60aeb797ee0" ] } } ], "from": "100", "to": null }, "triggerType": "SUBTOTAL_RANGE" }, { "itemQuantityRange": { "scopes": [ { "id": "specific_215238eb-22a5-4c36-9e7b-e7c08025e04e", "type": "CATALOG_ITEM", "catalogItemFilter": { "catalogAppId": "215238eb-22a5-4c36-9e7b-e7c08025e04e", "catalogItemIds": [ "f150b16a-79ef-ef81-50f9-22e2df631822", "187a07f6-b670-0650-c891-d60aeb797ee0" ] } } ], "from": 5, "to": null }, "triggerType": "ITEM_QUANTITY_RANGE" } ] }, "triggerType": "AND" }, "activeTimeInfo": { "start": "2022-08-07T08:11:00Z", "end": "2022-08-11T07:43:00Z" }, "discounts": { "values": [ { "targetType": "SPECIFIC_ITEMS", "specificItemsInfo": { "scopes": [ { "id": "specific_215238eb-22a5-4c36-9e7b-e7c08025e04e", "type": "CATALOG_ITEM", "catalogItemFilter": { "catalogAppId": "215238eb-22a5-4c36-9e7b-e7c08025e04e", "catalogItemIds": [ "f150b16a-79ef-ef81-50f9-22e2df631822", "187a07f6-b670-0650-c891-d60aeb797ee0" ] } } ] }, "percentage": 10, "discountType": "PERCENTAGE" } ] }, "status": "LIVE", "usageCount": 6 }
Did this help?

DELETE

Delete Discount Rule


Deletes a discount rule.

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
DELETE
https://www.wixapis.com/ecom/v1/discount-rules/{discountRuleId}

Path Params
discountRuleIdstringRequired

ID of the discount rule to delete.

Response Object
Returns an empty object.
Delete Discount Rule Example 1
Request
cURL
curl -X DELETE \ 'https://www.wixapis.com/ecom/v1/discount-rules/delete/c31f8d152077bab24065f01c0e3152b746c54ce0' \ -H 'Authorization: <AUTH>'
Response
JSON
{}
Event TriggersThis method triggers the following events:
Did this help?

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 } } }
Event TriggersThis method triggers the following events:
Did this help?

POST

Query Discount Rules


Query discount rules using WQL (Wix Query Language). Total entries (pagingMetadata.total) will be returned only for the first page.

Note: discountRule.status can't be used for querying.

Authentication

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

Permissions
Manage eCommerce - all permissions
Read eCommerce - all read permissions
Manage Stores - all permissions
Read Stores - all read permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/ecom/v1/discount-rules/query

Body Params
queryQuery

Query options.

Response Object
discountRulesArray <DiscountRule>

List of discount rules.


pagingMetadataPagingMetadata

Details on the paged set of results returned.

Query Discount Rules

Query Discount rules by active and start date fields, sorted by name

Request
cURL
curl -X POST \ 'https://www.wixapis.com/ecom/v1/discount-rules/query' \ -H 'Content-Type: application/json' \ -H 'Authorization: <AUTH>' \ --data-binary '{ "query": { "sort": [ { "fieldName": "name", "order": "ASC" } ], "filter": { "active": true, "activeTimeInfo.start": { "$gt": "2021-08-01T00:00:00Z" } }, "cursorPaging": { "limit": 2 } } }'
Response
JSON
{ "discountRules": [ { "id": "15bac455-10d0-4478-8358-e06f697f6180", "revision": "8", "createdDate": "2022-08-07T08:12:22.347Z", "updatedDate": "2022-08-09T07:45:44.044Z", "active": true, "name": "10% discount when buying over 100$ and 5 items", "trigger": { "and": { "triggers": [ { "subtotalRange": { "scopes": [ { "id": "specific_215238eb-22a5-4c36-9e7b-e7c08025e04e", "type": "CATALOG_ITEM", "catalogItemFilter": { "catalogAppId": "215238eb-22a5-4c36-9e7b-e7c08025e04e", "catalogItemIds": [ "f150b16a-79ef-ef81-50f9-22e2df631822", "187a07f6-b670-0650-c891-d60aeb797ee0" ] } } ], "from": "100", "to": null }, "triggerType": "SUBTOTAL_RANGE" }, { "itemQuantityRange": { "scopes": [ { "id": "specific_215238eb-22a5-4c36-9e7b-e7c08025e04e", "type": "CATALOG_ITEM", "catalogItemFilter": { "catalogAppId": "215238eb-22a5-4c36-9e7b-e7c08025e04e", "catalogItemIds": [ "f150b16a-79ef-ef81-50f9-22e2df631822", "187a07f6-b670-0650-c891-d60aeb797ee0" ] } } ], "from": 5, "to": null }, "triggerType": "ITEM_QUANTITY_RANGE" } ] }, "triggerType": "AND" }, "activeTimeInfo": { "start": "2022-08-07T08:11:00Z", "end": "2022-08-11T07:43:00Z" }, "discounts": { "values": [ { "targetType": "SPECIFIC_ITEMS", "specificItemsInfo": { "scopes": [ { "id": "specific_215238eb-22a5-4c36-9e7b-e7c08025e04e", "type": "CATALOG_ITEM", "catalogItemFilter": { "catalogAppId": "215238eb-22a5-4c36-9e7b-e7c08025e04e", "catalogItemIds": [ "f150b16a-79ef-ef81-50f9-22e2df631822", "187a07f6-b670-0650-c891-d60aeb797ee0" ] } } ] }, "percentage": 10, "discountType": "PERCENTAGE" } ] }, "status": "LIVE", "usageCount": 1 }, { "id": "35120105-1327-4624-8f7f-2720dcbab4d6", "revision": "40", "createdDate": "2023-02-28T11:56:05.996Z", "updatedDate": "2023-04-02T08:34:37.998Z", "active": false, "name": "10$ off Duffle Bags", "trigger": null, "activeTimeInfo": { "start": "2023-02-28T11:55:00Z", "end": null }, "discounts": { "values": [ { "targetType": "SPECIFIC_ITEMS", "specificItemsInfo": { "scopes": [ { "id": "collections_215238eb-22a5-4c36-9e7b-e7c08025e04e", "type": "CUSTOM_FILTER", "customFilter": { "appId": "215238eb-22a5-4c36-9e7b-e7c08025e04e", "params": { "collectionIds": [ "c31f8d152077bab24065f01c0e3152b746c54ce0" ] } } } ] }, "fixedAmount": "10", "discountType": "FIXED_AMOUNT" } ] }, "status": "LIVE", "usageCount": 6 } ], "pagingMetadata": { "count": 2, "offset": null, "total": 8, "cursors": { "next": "c21acd2f5eb388517dd9c781a9ba42b9e51ca540.ElAqTgo-ChRhY3RpdmVUaW1lSW5mby5zdGFydBImKiQKIgoDJGd0EhsqGQoXCgokdGltZXN0YW1wEgkRAAAAKvCvd0IKDAoGYWN0aXZlEgIgACIkMzUxMjAxMDUtMTMyNy00NjI0LThmN2YtMjcyMGRjYmFiNGQ2", "prev": null } } }
Did this help?

Discount Rule Created


Triggered when a discount rule is created.

Permissions
Manage eCommerce - all permissions
Read eCommerce - all read permissions
Manage Stores - all permissions
Read Stores - all read permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.ecom.discounts.v1.discount_rule.


slugstring

Event name. Expected created.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


createdEventCreatedEvent

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "data": { "eventType": "wix.ecom.discounts.v1.discount_rule_created", "instanceId": "<app-instance-id>", "data": "<stringified-JSON>", // The identity field is sent as a stringified JSON "identity": { "identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP "anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR "memberId": "<memberId>", // in case of MEMBER "wixUserId": "<wixUserId>", // in case of WIX_USER "appId": "<appId>" // in case of APP } } }

DiscountRuleCreated
JSON
{ "entityId": "18b3a857-131e-47b1-8748-3c4d362511f3", "entityEventSequence": "1", "slug": "created", "id": "44a04c22-73cb-457c-96fd-ef4438e84490", "createdEvent": { "entity": { "usageCount": 0, "name": "15% on all products when buying more than 5 items", "revision": "1", "id": "18b3a857-131e-47b1-8748-3c4d362511f3", "status": "LIVE", "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" } ] }, "offer": "15% off\nAll products", "updatedDate": "2023-06-28T12:43:22.739Z", "createdDate": "2023-06-28T12:43:22.739Z", "active": true, "trigger": { "itemQuantityRange": { "scopes": [ { "id": "all_215238eb-22a5-4c36-9e7b-e7c08025e04e", "type": "CATALOG_ITEM", "catalogItemFilter": { "catalogAppId": "215238eb-22a5-4c36-9e7b-e7c08025e04e", "catalogItemIds": [] } } ], "from": 5 }, "triggerType": "ITEM_QUANTITY_RANGE" } } }, "entityFqdn": "wix.ecom.discounts.v1.discount_rule", "eventTime": "2023-06-28T12:43:22.747473Z", "triggeredByAnonymizeRequest": false }
Did this help?

Discount Rule Updated


Triggered when a discount rule is updated.

Permissions
Manage eCommerce - all permissions
Read eCommerce - all read permissions
Manage Stores - all permissions
Read Stores - all read permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.ecom.discounts.v1.discount_rule.


slugstring

Event name. Expected updated.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


updatedEventUpdatedEvent

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "data": { "eventType": "wix.ecom.discounts.v1.discount_rule_updated", "instanceId": "<app-instance-id>", "data": "<stringified-JSON>", // The identity field is sent as a stringified JSON "identity": { "identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP "anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR "memberId": "<memberId>", // in case of MEMBER "wixUserId": "<wixUserId>", // in case of WIX_USER "appId": "<appId>" // in case of APP } } }

DiscountRuleUpdated
JSON
{ "entityId": "18b3a857-131e-47b1-8748-3c4d362511f3", "entityEventSequence": "2", "slug": "updated", "id": "656ddf67-99fc-44ab-b3b1-6f99623328fd", "entityFqdn": "wix.ecom.discounts.v1.discount_rule", "updatedEvent": { "currentEntity": { "usageCount": 0, "name": "New discount name", "revision": "2", "id": "18b3a857-131e-47b1-8748-3c4d362511f3", "status": "LIVE", "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" } ] }, "offer": "15% off\nAll products", "updatedDate": "2023-06-28T12:51:41.482Z", "createdDate": "2023-06-28T12:43:22.739Z", "active": true, "trigger": { "itemQuantityRange": { "scopes": [ { "id": "all_215238eb-22a5-4c36-9e7b-e7c08025e04e", "type": "CATALOG_ITEM", "catalogItemFilter": { "catalogAppId": "215238eb-22a5-4c36-9e7b-e7c08025e04e", "catalogItemIds": [] } } ], "from": 5 }, "triggerType": "ITEM_QUANTITY_RANGE" } } }, "eventTime": "2023-06-28T12:51:41.489714Z", "triggeredByAnonymizeRequest": false }
Did this help?

Discount Rule Deleted


Triggered when a discount rule is deleted.

Permissions
Manage eCommerce - all permissions
Read eCommerce - all read permissions
Manage Stores - all permissions
Read Stores - all read permissions
Manage Restaurants - all permissions
Learn more about app permissions.
Event BodyEvent Body Event data is received as a JSON Web Token (JWT). It may be delayed. Be sure to verify the data was sent by Wix.
Event Data
idstring

Unique event ID. Allows clients to ignore duplicate webhooks.


entityFqdnstring

Fully qualified domain name of the entity associated with the event. Expected wix.ecom.discounts.v1.discount_rule.


slugstring

Event name. Expected deleted.


entityIdstring

ID of the entity associated with the event.


eventTimestringformat date-time

Event timestamp.


triggeredByAnonymizeRequestboolean

Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).


originatedFromstring

If present, indicates the action that triggered the event.


deletedEventstruct

Event information.

Event Body

The data payload will include the following as an encoded JWT:

JSON
{ "data": { "eventType": "wix.ecom.discounts.v1.discount_rule_deleted", "instanceId": "<app-instance-id>", "data": "<stringified-JSON>", // The identity field is sent as a stringified JSON "identity": { "identityType": "<identityType>", // ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP "anonymousVisitorId": "<anonymousVisitorId>", // in case of ANONYMOUS_VISITOR "memberId": "<memberId>", // in case of MEMBER "wixUserId": "<wixUserId>", // in case of WIX_USER "appId": "<appId>" // in case of APP } } }

DiscountRuleDeleted
JSON
{ "entityId": "18b3a857-131e-47b1-8748-3c4d362511f3", "slug": "deleted", "id": "14129e3b-30e9-496f-ab3f-90d1ca82899e", "entityFqdn": "wix.ecom.discounts.v1.discount_rule", "deletedEvent": { "movedToTrash": true }, "eventTime": "2023-06-28T12:53:01.736091Z", "triggeredByAnonymizeRequest": false }
Did this help?