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.
POST/v2/projects/{project_id}/coupons
Authorization
Bearer TokenRequired
Path Parameters
project_idstringrequired
The unique identifier of the project.
Request Body
codestringrequired
The coupon code users will enter.
display_namestringrequired
Display name for the coupon.
descriptionstring
A description of the coupon.
coupon_typestringrequired
Type of discount: percentage or fixed.
percentagestring
Discount percentage as a decimal string, greater than 0 and at most 100 (required for percentage type).
amountstring
Fixed discount amount as a decimal string (required for fixed type).
currencystring
Currency for fixed discounts (e.g., USD). Required for fixed type.
auto_applyboolean
Whether to auto-apply this coupon. Default: false
usage_limitinteger
Total redemptions allowed across all users.
per_user_limitinteger
Redemptions allowed per user.
invitee_modestring
Who can use: all, inviteesOnly, nonInvitees. Default: all
renewal_constraintstring
When applicable: any, renewalOnly, churnedOnly. Default: any
plan_scopestring
Which plans: all, include, exclude. Default: all (plan_ids required when include or exclude).
plan_idsarray
Plan UUIDs to include or exclude, per plan_scope.
starts_atnumber | string
Validity start: Unix milliseconds or ISO-8601 string.
ends_atnumber | string
Validity end: Unix milliseconds or ISO-8601 string. Must be after starts_at.