OpenSky-commerce / Documentation

Coupons & Discounts

Open Sky Commerce includes a coupon system that lets you create discount codes for use at checkout. Codes can be percentage-based or fixed-amount.

Creating a Coupon

  1. Go to Admin → Coupons → Add Coupon.
  2. Enter a unique coupon code (e.g., SUMMER20).
  3. Set the discount type: Percentage or Fixed Amount.
  4. Enter the discount value (e.g., 20 for 20% off, or 10 for $10 off).
  5. Optionally set an expiry date and maximum usage count.
  6. Save the coupon.

How Customers Use Coupons

Customers enter coupon codes on the cart page or at checkout. Valid codes are applied immediately and the discount is shown in the order summary before payment.

Coupon Validation

Coupon validation is server-side. The following checks are performed:

  • Code exists in the database
  • Code has not expired (if an expiry date is set)
  • Usage count has not exceeded the maximum (if a limit is set)

Coupon Data Model

Coupons are stored in the Coupon table. You can also seed initial coupons from seed-data/Coupon.json via the demo data import script.