Applying Coupons at Checkout
Customer Experience
When a customer is on the Inflow hosted checkout page:
- They see a "Have a coupon?" or discount code field.
- They enter the coupon code (e.g.,
SUMMER20). - The system validates the code in real time.
- If valid, the discount is applied and the updated total is displayed.
- The customer completes payment at the discounted price.
Behind the Scenes
The checkout page uses two API endpoints to handle coupons:
Step 1: Validate
POST /checkout/validate-coupon/{paymentId}
Body: { "code": "SUMMER20" }
This checks:
- Does the coupon code exist?
- Is the coupon still active (not expired)?
- Has the usage limit been reached?
- Is the coupon applicable to this payment?
If valid, it returns the discount details (type, value, resulting amount).
Step 2: Apply
POST /checkout/apply-coupon/{paymentId}
Body: { "code": "SUMMER20" }
This:
- Applies the discount to the payment
- Updates the payment amount
- Records the coupon usage
Discounts with Subscriptions
When a coupon is applied to a subscription checkout:
- The discount applies to the first payment (and possibly subsequent payments, depending on the coupon configuration).
- The subscription offer's regular price is not permanently changed.
Tax Calculation with Coupons
Tax is calculated on the discounted amount:
| Pricing Mode | Calculation |
|---|---|
| TAX_EXCLUSIVE | Tax = (discounted price) x (tax rate) |
| TAX_INCLUSIVE | Tax is extracted from the discounted total |
Tips
- Create clear, memorable coupon codes (e.g.,
WELCOME10,ANNUAL50). - Set usage limits to control your discount budget.
- Use expiration dates for time-limited promotions.
- Monitor coupon usage from the Dashboard to track campaign performance.
Updated 1 day ago