Skip to main content
GET
/
promo_codes
/
{id}
JavaScript
import Whop from '@whop/sdk';

const client = new Whop({
  appID: 'app_xxxxxxxxxxxxxx',
  apiKey: 'My API Key',
});

const promoCode = await client.promoCodes.retrieve('promo_xxxxxxxxxxxx');

console.log(promoCode.id);
{
  "id": "promo_xxxxxxxxxxxx",
  "amount_off": 6.9,
  "currency": "usd",
  "churned_users_only": true,
  "code": "<string>",
  "created_at": "2023-12-01T05:00:00.401Z",
  "existing_memberships_only": true,
  "duration": "forever",
  "expires_at": "2023-12-01T05:00:00.401Z",
  "new_users_only": true,
  "promo_duration_months": 42,
  "one_per_customer": true,
  "product": {
    "id": "prod_xxxxxxxxxxxxx",
    "title": "<string>"
  },
  "promo_type": "percentage",
  "status": "active",
  "stock": 42,
  "unlimited_stock": true,
  "uses": 42,
  "company": {
    "id": "biz_xxxxxxxxxxxxxx",
    "title": "<string>"
  }
}

Authorizations

Authorization
string
header
required

The app API key from an app from the /dashboard/developer page

Path Parameters

id
string
required
Example:

"promo_xxxxxxxxxxxx"

Response

A successful response

An object representing a promo code for a plan.

id
string
required

The ID of the promo.

Example:

"promo_xxxxxxxxxxxx"

amount_off
number
required

The amount off (% or flat amount) for the promo.

Example:

6.9

currency
enum<string>
required

The monetary currency of the promo code.

Available options:
usd,
sgd,
inr,
aud,
brl,
cad,
dkk,
eur,
nok,
gbp,
sek,
chf,
hkd,
huf,
jpy,
mxn,
myr,
pln,
czk,
nzd,
aed,
eth,
ape,
cop,
ron,
thb,
bgn,
idr,
dop,
php,
try,
krw,
twd,
vnd,
pkr,
clp,
uyu,
ars,
zar,
dzd,
tnd,
mad,
kes,
kwd,
jod,
all,
xcd,
amd,
bsd,
bhd,
bob,
bam,
khr,
crc,
xof,
egp,
etb,
gmd,
ghs,
gtq,
gyd,
ils,
jmd,
mop,
mga,
mur,
mdl,
mnt,
nad,
ngn,
mkd,
omr,
pyg,
pen,
qar,
rwf,
sar,
rsd,
lkr,
tzs,
ttd,
uzs,
rub,
btc
churned_users_only
boolean
required

Restricts promo use to only users who have churned from the company before.

code
string | null
required

The specific code used to apply the promo at checkout.

created_at
string<date-time>
required

The timestamp of when the promo was created.

Example:

"2023-12-01T05:00:00.401Z"

existing_memberships_only
boolean
required

Restricts promo use to only be applied to already purchased memberships.

duration
enum<string> | null
required

The duration of the promo. The duration setting for the promo code

Available options:
forever,
once,
repeating
expires_at
string<date-time> | null
required

The date/time of when the promo expires.

Example:

"2023-12-01T05:00:00.401Z"

new_users_only
boolean
required

Restricts promo use to only users who have never purchased from the company before.

promo_duration_months
integer | null
required

The number of months the promo is applied for.

Example:

42

one_per_customer
boolean
required

Restricts promo use to only be applied once per customer.

product
object | null
required

The access pass associated with the promo code.

promo_type
enum<string>
required

The type (% or flat amount) of the promo.

Available options:
percentage,
flat_amount
status
enum<string>
required

Indicates if the promo code is live or disabled.

Available options:
active,
inactive,
archived
stock
integer
required

The quantity limit on the number of uses.

Example:

42

unlimited_stock
boolean
required

Whether or not the promo code has unlimited stock.

uses
integer
required

The amount of times the promo codes has been used.

Example:

42

company
object
required

The company for the promo code.