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

const client = new Whop({
  apiKey: process.env['WHOP_API_KEY'], // This is the default and can be omitted
});

const membership = await client.memberships.retrieve('mem_xxxxxxxxxxxxxx');

console.log(membership.id);
{
  "id": "mem_xxxxxxxxxxxxxx",
  "status": "trialing",
  "created_at": "2023-12-01T05:00:00.401Z",
  "updated_at": "2023-12-01T05:00:00.401Z",
  "manage_url": "<string>",
  "member": {
    "id": "mber_xxxxxxxxxxxxx"
  },
  "user": {
    "id": "user_xxxxxxxxxxxxx",
    "username": "johndoe42",
    "name": "John Doe"
  },
  "renewal_period_start": "2023-12-01T05:00:00.401Z",
  "renewal_period_end": "2023-12-01T05:00:00.401Z",
  "cancel_at_period_end": true,
  "cancellation_reason": "<string>",
  "canceled_at": "2023-12-01T05:00:00.401Z",
  "currency": "usd",
  "company": {
    "id": "biz_xxxxxxxxxxxxxx",
    "title": "<string>"
  },
  "plan": {
    "id": "plan_xxxxxxxxxxxxx"
  },
  "promo_code": {
    "id": "promo_xxxxxxxxxxxx"
  },
  "product": {
    "id": "prod_xxxxxxxxxxxxx",
    "title": "<string>"
  },
  "license_key": "<string>",
  "metadata": {},
  "payment_collection_paused": true
}

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

The ID of the membership or a license key

Example:

"mem_xxxxxxxxxxxxxx"

Response

A successful response

A membership represents a purchase between a User and a Company for a specific Product.

id
string
required

The ID of the membership

Example:

"mem_xxxxxxxxxxxxxx"

status
enum<string>
required

The status of the membership.

Available options:
trialing,
active,
past_due,
completed,
canceled,
expired,
unresolved,
drafted
created_at
string<date-time>
required

The timestamp, in seconds, that this Membership was created at.

Example:

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

updated_at
string<date-time>
required

A timestamp of when the membership was last updated

Example:

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

manage_url
string | null
required

The URL for the customer to manage their membership.

member
object
required

The Member that this Membership belongs to.

user
object
required

The user this membership belongs to

renewal_period_start
string<date-time> | null
required

The timestamp in seconds at which the current billing cycle for this subscription start. Only applies for memberships that have a renewal plan.

Example:

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

renewal_period_end
string<date-time> | null
required

The timestamp in seconds at which the current billing cycle for this subscription ends. Only applies for memberships that have a renewal plan.

Example:

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

cancel_at_period_end
boolean
required

Whether this Membership is set to cancel at the end of the current billing cycle. Only applies for memberships that have a renewal plan.

cancellation_reason
string | null
required

The reason that the member canceled the membership (filled out by the member).

canceled_at
string<date-time> | null
required

The epoch timestamp of when the customer initiated a cancellation.

Example:

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

currency
enum<string> | null
required

The currency the membership is in.

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,
cny
company
object
required

The Company this Membership belongs to.

plan
object
required

The Plan this Membership is for.

promo_code
object
required

The Promo Code that is currently applied to this Membership.

product
object
required

The Product this Membership grants access to.

license_key
string | null
required

The license key for this Membership. This is only present if the membership grants access to an instance of the Whop Software app.

metadata
object
required

A JSON object used to store software licensing information. Ex. HWID

payment_collection_paused
boolean
required

Whether the membership's payments are currently paused.