Skip to main content
GET
/
memberships
/
{id}
JavaScript
import Whopsdk from 'whopsdk';

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

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

console.log(membership.id);
{
  "id": "mem_xxxxxxxxxxxxxx",
  "status": "trialing",
  "created_at": 1701406800,
  "updated_at": 1701406800,
  "member": {
    "id": "mber_xxxxxxxxxxxxx"
  },
  "user": {
    "id": "user_xxxxxxxxxxxxx",
    "username": "<string>",
    "name": "<string>"
  },
  "renewal_period_start": 1701406800,
  "renewal_period_end": 1701406800,
  "cancel_at_period_end": true,
  "cancellation_reason": "<string>",
  "canceled_at": 1701406800,
  "currency": "usd",
  "company": {
    "id": "biz_xxxxxxxxxxxxxx",
    "title": "<string>"
  },
  "plan": {
    "id": "plan_xxxxxxxxxxxxx"
  },
  "promo_code": {
    "id": "promo_xxxxxxxxxxxx"
  },
  "license_key": "<string>",
  "metadata": {}
}

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required
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
integer
required

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

Example:

1701406800

updated_at
integer
required

A timestamp of when the membership was last updated

Example:

1701406800

member
object | null
required

The Member that this Membership belongs to.

user
object | null
required

The user this membership belongs to

renewal_period_start
integer | 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:

1701406800

renewal_period_end
integer | 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:

1701406800

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
integer | null
required

The epoch timestamp of when the customer initiated a cancellation.

Example:

1701406800

currency
enum<string> | null
required

The currency the membership is in. The available currencies on the platform

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

The Company this Membership belongs to.

plan
object
required

The Plan this Membership is for.

promo_code
object | null
required

The Promo Code that is currently applied to this Membership.

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

I