Create Coupon - Add Discount Codes to Your Subscription Bot
Generate a new discount code for your subscription bot. Configure percentage or fixed-amount discounts, set auto-apply rules, restrict usage to specific plans or user types, and control whether the coupon applies to first payments only or renewals too.
/v2/projects/{project_id}/couponsAuthorization
Path Parameters
The unique identifier of the project.
Request Body
The coupon code users will enter.
Display name for the coupon.
A description of the coupon.
Type of discount: percentage or fixed.
The discount percentage (required for percentage type).
The fixed discount amount (required for fixed type).
Currency for fixed discounts (e.g., USD). Required for fixed type.
Whether to auto-apply this coupon. Default: false
Who can use: all, new_users, existing_users. Default: all
When applicable: any, first_payment, renewals. Default: any
Which plans: all or specific. Default: all
Custom metadata for the coupon.
curl -X POST "https://api.botsubscription.com/v2/projects/f47ac10b-58cc-4372-a567-0e02b2c3d479/coupons" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"code": "SUMMER2024",
"description": "Summer promotion discount",
"discount_type": "percentage",
"discount_value": 20,
"max_redemptions": 100,
"plan_ids": ["plan_abc123"],
"valid_from": "2024-06-01T00:00:00.000Z",
"valid_until": "2024-08-31T23:59:59.000Z"
}'{
"ok": true,
"request_id": "11111111-1111-1111-1111-111111111111",
"method": "POST",
"path": "/v2/projects/YOUR_PROJECT_ID/coupons",
"code": 201,
"data": {
"coupon_id": "11111111-1111-1111-1111-111111111111",
"code": "SUMMER2024",
"display_name": "Summer Sale",
"description": "Summer promotion discount",
"coupon_type": "percentage",
"percentage": "20",
"auto_apply": false,
"status": "active",
"total_redemptions": 0,
"total_reservations": 0,
"invitee_mode": "all",
"renewal_constraint": "any",
"payment_count_comparator": "any",
"lifetime_revenue_comparator": "any",
"plan_scope": "all",
"created_at": "2024-05-15T10:00:00.000Z",
"metadata": {}
}
}Last updated: