Sell online
Discounts and promotion codes
Apply server-controlled coupons without losing the original total.
Create coupons with a percentage or fixed minor-unit amount, then decide where a coupon can be used. A promotion code is customer-facing; the coupon is the underlying rule. Validate eligibility, duration, currency, expiry, and usage limits on the server.
The example total is illustrative. Your server must calculate the discount from the current catalog and persist the pre-discount amount, discount amount, and final amount. Never trust a discount amount posted by the browser.