Promotions
Promo codes for discounts, fixed amounts off, or free shipping.
Where to find it
Admin: /commerce/promotions
Storefront: promo code input on checkout page
Discount types
| Type | Example |
|---|---|
percentage | 10% off, capped at $50 |
fixed | $25 off |
free_shipping | Free shipping, no discount to items |
Configuration
| Field | Purpose |
|---|---|
| Code | Customer-facing code (e.g. SAVE10) |
| Name | Internal label |
| Discount type / value | What the discount does |
| Min order amount | Require cart to meet this minimum |
| Max discount | Cap on percentage discount |
| Usage limit | Total times this code can be used (global) |
| Per-customer limit | Max times one customer can use it |
| Applies to | all, category, or product with target IDs |
| Start / expire dates | Optional time window |
| Active flag | Disable without deleting |
Customer flow
- Customer enters code at checkout
POST /checkout/validate-promovalidates:- Code exists and is active
- Date window valid
- Under usage limit (global + per customer)
- Cart meets min amount
- Applies to cart items (if category/product specific)
- Returns discount amount or free shipping flag
- Checkout summary shows the discount
- Order submission applies + increments usage counter
Server-side enforcement
Promo validation always happens server-side during order creation — even if a customer tampers with client-side data, the server recomputes. Usage tracking is atomic per order.
Related features
- Bundles — automatic multi-product discounts (no code needed)
- Cart & Checkout