Mandatory discounts on Vareons and promo automation
Mandatory discounts are automatic promotions managed at /dashboard/mandatory-discounts separately from regular coupons, applied to eligible carts without a code via POST /api/mandatory-discounts/public/get-active, and stored on the order as an isMandatory line.
Last verified: 2026-09-19
The list opens at /dashboard/mandatory-discounts with stats and delete, creation at /dashboard/mandatory-discounts/create with Title, Type such as Percentage, Fixed Amount, Free Shipping, or Mandatory Gift, Value, start/end dates, and Active or Paused status, and editing at /dashboard/mandatory-discounts/[id]/edit.
They use the same Coupon model with data.isMandatory: true and are managed through GET/POST, GET/PUT/DELETE, and GET stats with mandatory-discounts.view, create, edit, and delete permissions. Supported types are percentage, fixed, free_shipping, free_product, and buy_x_get_y, where free_product and buy_x_get_y add a gift line to the cart via useDiscounts.
On cart change, useDiscounts fetches active mandatory discounts, useCheckoutTotals sums mandatory plus coupon and loyalty into the grandTotal, PricingBreakdown shows the lines, then buildOrderPayload builds discounts[] with isMandatory and freeProductId, so POST /api/orders/create persists the lines and updates analytics and redemptions. Deleting stops application immediately for new carts without touching old orders.
Setup steps in Vareons
Open Mandatory Discounts
From the dashboard open /dashboard/mandatory-discounts and review the list and stats.
Create a mandatory discount
Click Create or New Mandatory Discount, enter the Title, choose the Type, and enter the Value when needed.
Set scope, dates, and status
Set start/end dates and Active or Paused status, then save so the discount appears in the list.
Test the cart without a code
Open the storefront, add an eligible product, and confirm the discount applied automatically with its line and gift line for free_product.
Edit or delete when needed
To edit open /dashboard/mandatory-discounts/[id]/edit; for immediate stop use Delete.
Frequently asked questions
What is the difference between a coupon and a mandatory discount?
A coupon lives at /dashboard/discounts and may need a code, while a mandatory discount lives at /dashboard/mandatory-discounts and applies automatically without a code unless excluded.
Which mandatory discount types exist?
Percentage, fixed amount, free shipping, free_product mandatory gift, and buy X get Y.
Does the customer enter a code?
No. It applies automatically to the eligible cart via get-active and appears as an imposed discount.
Where does a mandatory discount appear on the order?
As a line in data.discounts[] with isMandatory: true and freeProductId for gifts, reflected in data.totals.discountTotal.
What happens when a mandatory discount is deleted?
It stops immediately for new carts, while old orders keep their original lines.
Troubleshooting
1) If a mandatory discount does not apply, confirm Active status, cart eligibility, and that free_product has a valid gift product. 2) For an unexpected discount, review /dashboard/mandatory-discounts because they apply unless excluded. 3) If the gift is missing, check the gift line in the cart and its stock impact. 4) For an immediate stop, use Delete instead of waiting for dates to end.
Important limitations
• They apply unless explicitly excluded, so review them before price changes. • The free_product and BxGy gifts affect inventory. • Deletion is immediate for new carts and does not rewrite old orders.