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:
- 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.
-
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
andAll Products
scopes. - Scopes are required in default triggers and discount objects.
- Triggers and discounts can have multiple scopes.
- Every catalog has up to 2 scopes "out of the box". For example, Wix Stores has
-
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 SPI 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.
Creates a new discount rule.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Retrieves a discount rule.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Deletes a discount rule.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
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.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
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.
Permission Scopes
For app development, you must have one of the following permission scopes:Syntax
Triggered when a discount rule is created.
Event Body
Triggered when a discount rule is updated.
Event Body
Triggered when a discount rule is deleted.