Coupons & Promo Codes
Create discount coupons and shareable promotion codes to reduce prices for specific users or campaigns.
Creating coupons
Coupons define the discount terms. A coupon is a reusable discount template — promotion codes are the shareable codes that apply a coupon to a subscription.
Navigate to Billing → Coupons → New Coupon in the dashboard.
Discount type
| Type | Description | Example |
|---|---|---|
percent_off | Reduce the price by a percentage | 20% off |
amount_off | Reduce the price by a fixed amount (in smallest currency unit) | $10 off |
Duration
| Duration | Description |
|---|---|
once | Applied to the first invoice only |
repeating | Applied for a fixed number of billing periods (duration_in_months) |
forever | Applied to every invoice for the lifetime of the subscription |
Example: 3 months free trial extension coupon
{
"name": "3 Months 50% Off",
"percent_off": 50,
"duration": "repeating",
"duration_in_months": 3
}
Example: $20 one-time credit
{
"name": "$20 Welcome Credit",
"amount_off": 2000,
"currency": "usd",
"duration": "once"
}
amount_off coupons are currency-specific. If your project uses multiple currencies in the future, create separate coupons per currency. percent_off coupons are currency-agnostic.
Promotion codes
Promotion codes are user-facing codes that users enter at checkout (e.g. LAUNCH50). Each promotion code is linked to a coupon and can have its own restrictions on top of the coupon's discount terms.
Creating a single promotion code
- Open a coupon in the dashboard
- Click Add Promotion Code
- Enter a code (or leave blank to auto-generate one)
- Set optional restrictions (max redemptions, expiry date, first-time customers only)
Example promotion code
{
"code": "LAUNCH50",
"coupon_id": "cpn_abc123",
"max_redemptions": 500,
"expires_at": "2025-12-31T23:59:59Z",
"first_time_only": true
}
Applying a promotion code at checkout
Pass the promotion code to the checkout session:
curl -X POST https://your-authgate-instance.com/api/proxy/billing/checkout \
-H "Authorization: Bearer <session_token>" \
-H "Content-Type: application/json" \
-d '{
"price_id": "price_abc123",
"promotion_code": "LAUNCH50"
}'
The discount is shown on the checkout summary and applied automatically to the first invoice (or all invoices, depending on the coupon's duration).
Bulk generation and CSV import
For email campaigns or partner codes, generate multiple promotion codes at once.
Bulk generate
In the dashboard, open a coupon and click Generate Codes in Bulk. Set:
- Quantity — number of codes to generate (max 10,000 per batch)
- Prefix — optional prefix for generated codes (e.g.
PARTNER-) - Length — total code length including prefix (8–20 characters)
Generated codes are available to download as a CSV immediately after generation.
CSV import
To import your own list of codes, upload a CSV with a single code column:
code
WELCOME2025
EARLY100
FRIEND50
Navigate to Billing → Coupons → [Coupon] → Import Codes and upload the file. AuthGate validates for duplicates and invalid characters before importing.
Redemption limits and expiry
Control how and when promotion codes can be used:
- Name
max_redemptions- Type
- integer
- Description
Maximum total number of times this code can be redeemed across all users. Once the limit is reached, the code is automatically deactivated.
- Name
expires_at- Type
- string
- Description
ISO 8601 datetime after which the code can no longer be redeemed.
- Name
first_time_only- Type
- boolean
- Description
If true, only users who have never had a paid subscription in this project can redeem the code.
- Name
applies_to_plans- Type
- string[]
- Description
Optional list of plan IDs. If set, the code can only be redeemed when subscribing to one of these plans.
Coupon and promotion code redemption history is visible in the dashboard under Billing → Coupons → [Coupon] → Redemptions.