Create Promo Code
Changed onCreates a promo code for an account.
Request
- Base URLhttps://api.whop.com/api/v1
- AuthHTTP bearer
Headers
Pins the request to a dated API version.
A unique key that makes this request safe to retry. See Idempotent requests.
Request body
The discount. For percentage, a whole percent from 0.01 to 100 (25 means 25% off). Responses return it as a fraction, 0.25. For flat_amount, an amount in base_currency units, such as dollars (5 means $5.00).
The code customers enter at checkout. Stored lowercase.
How many billing cycles the discount applies to: 0 for every payment, 1 for the first payment only, N to cover the first N payments.
How many times the code can be used. Required unless unlimited_stock is true.
Allow unlimited uses. When false or omitted, stock is required.
Example request
{
"account_id": "biz_xxxxxxxxxxxxxx",
"amount_off": 25,
"base_currency": "usd",
"code": "AFFILIATE25",
"expires_at": "2026-01-01T12:00:00.000Z",
"new_users_only": true,
"one_per_customer": true,
"product_id": "prod_xxxxxxxxxxxxxx",
"promo_duration_months": 3,
"promo_type": "percentage",
"stock": 200,
"variant_ids": [
"plan_xxxxxxxxxxxxxx"
]
}Response
promo code created
Account that owns the promo code.
Discount amount. Percentage discounts are represented as a decimal fraction.
Whether the promo code is restricted to churned customers.
Code entered at checkout.
When the promo code was created, as an ISO 8601 timestamp.
Currency used for a fixed-amount discount.
How long the discount applies.
Whether the promo code applies only to existing memberships.
When the promo code expires, as an ISO 8601 timestamp.
Promo code ID, prefixed promo_.
Custom key-value metadata stored on the promo code.
Whether the promo code is restricted to new customers.
Whether each customer may redeem the promo code only once.
Billing intervals the discount applies to.
Whether the discount is percentage-based or a fixed amount.
Promo code lifecycle status.
Maximum uses when stock is limited.
Whether the promo code has no redemption limit.
When the promo code was updated, as an ISO 8601 timestamp.
Memberships that used the promo code.
Example response
{
"account": {
"id": "biz_xxxxxxxxxxxxxx",
"title": "Shine Time Auto Detailing"
},
"affiliate": {
"id": "aff_xxxxxxxxxxxxxx",
"user": {
"id": "user_xxxxxxxxxxxxxx",
"name": "Dana Whitfield",
"profile_pic": "https://ui-avatars.com/api/",
"username": "danawhitfield"
}
},
"amount_off": 0.1,
"code": "welcome",
"created_at": "2026-01-01T12:00:00.000Z",
"currency": "usd",
"duration": "repeating",
"expires_at": "2026-01-01T12:00:00.000Z",
"id": "promo_xxxxxxxxxxxxxx",
"metadata": {},
"new_users_only": true,
"one_per_customer": true,
"product": {
"id": "prod_xxxxxxxxxxxxxx",
"title": "Ceramic Coating Masterclass"
},
"promo_duration_months": 1,
"promo_type": "percentage",
"status": "active",
"stock": 25,
"updated_at": "2026-01-01T12:00:00.000Z",
"uses": 1
}Changes
- warning
added the new
hnlenum value to thecurrencyresponse property for the response status - info
added the new
hnlenum value to the request propertybase_currency
- warning
- warning
removed the request property
plan_ids
1 more change in this revision
- warning