The 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. Discount rules are known as automatic discounts in the dashboard.
With the Discount Rules API, you can:
To use the Discount Rules API, import { discountRules }
from the wix-ecom-backend
module:
Discount rule: A set of conditions (scope and trigger) that dictate whether an item/product 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.
Scope: A group of catalog items that qualify for a discount.
Specific Products
and All Products
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.