Features
Marketing
Promotions

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

TypeExample
percentage10% off, capped at $50
fixed$25 off
free_shippingFree shipping, no discount to items

Configuration

FieldPurpose
CodeCustomer-facing code (e.g. SAVE10)
NameInternal label
Discount type / valueWhat the discount does
Min order amountRequire cart to meet this minimum
Max discountCap on percentage discount
Usage limitTotal times this code can be used (global)
Per-customer limitMax times one customer can use it
Applies toall, category, or product with target IDs
Start / expire datesOptional time window
Active flagDisable without deleting

Customer flow

  1. Customer enters code at checkout
  2. POST /checkout/validate-promo validates:
    • 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)
  3. Returns discount amount or free shipping flag
  4. Checkout summary shows the discount
  5. 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