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:
When more than one discount could apply, only the single highest-value coupon is used — discounts do not stack. Ties are broken in favor of the more specific level (invoice, then subscription, then customer).
Coupon states
Coupons have a lifecycle with automatic state transitions:
Checkout integration
Apply coupons during checkout session creation:
Or let customers enter a code on the hosted checkout page. The promo code
field is shown when the account’s checkout field settings enable it
(enable_promo_code). The customer’s entered code is applied to the session
through the token-scoped hosted-checkout endpoint:
Invoice discount calculation
When an invoice is generated, discounts attached at the invoice, subscription, and customer levels are all collected, and only the single highest-value coupon is applied (discounts do not stack). On a value tie, the more specific level wins, in this order:
- Invoice-level discount
- Subscription-level discount
- Customer-level discount
Percentage discounts:
The result is truncated down to the smallest currency unit — a 16.67% discount on 999 cents gives 166 cents, not 166.53.
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.