Coupons
Create and manage discounts with coupons and promotion codes. Offer percentage discounts, fixed amounts, or extended trial periods with flexible rules and limits.
How coupons work
The coupon system has three components:
- Coupons - Reusable discount templates with rules and limits
- Promotion codes - Customer-facing codes that link to coupons
- Discounts - Applied instances of coupons on subscriptions or invoices
Discount types
Duration options
Control how long a discount lasts:
Creating a coupon
Create coupons in the dashboard or via API:
Dashboard
API
- Navigate to Coupons in the sidebar
- Click Create Coupon
- Configure discount type, amount, and duration
- Set optional limits (max redemptions, expiration date)
- Save the coupon
Promotion codes
Promotion codes are shareable codes that customers enter at checkout. Each code links to a coupon and can have its own restrictions.
Creating a promotion code:
Promotion code restrictions
Add additional rules to promotion codes:
Promotion code restrictions are checked in addition to the coupon’s rules. Both must pass for the discount to apply.
Product restrictions
Limit coupons to specific products:
When product IDs are specified, the discount only applies to line items matching those products.
Applying discounts
Discounts can be attached at different levels:
More specific discounts take priority over general ones.
Coupon states
Coupons have a lifecycle with automatic state transitions:
Checkout integration
Apply coupons during checkout session creation:
Or allow customers to enter codes at checkout:
Invoice discount calculation
When an invoice is generated:
- Check for invoice-level discount
- Fall back to subscription-level discount
- Fall back to customer-level discount
Percentage discounts:
Fixed amount discounts (distributed proportionally):
Validating promotion codes
Check if a code is valid before applying:
The response indicates whether the code can be used and any restrictions that apply.
Best practices
Create coupons with business rules, then distribute via multiple promotion codes.
Always configure max_redemptions for promotional campaigns to control costs.
Set expiration dates to create urgency and manage campaign timelines.
Use different promotion codes for different channels to measure effectiveness.
[MBCC]