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

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

// Automatically fetches more pages as needed.
for await (const membershipListResponse of client.memberships.list({ company_id: 'biz_xxxxxxxxxxxxxx' })) {
  console.log(membershipListResponse.id);
}
{
  "data": [
    {
      "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": {}
    }
  ],
  "page_info": {
    "end_cursor": "<string>",
    "start_cursor": "<string>",
    "has_next_page": true,
    "has_previous_page": true
  }
}

Authorizations

Authorization
string
header
required

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

Query Parameters

after
string | null

Returns the elements in the list that come after the specified cursor.

before
string | null

Returns the elements in the list that come before the specified cursor.

first
integer | null

Returns the first n elements from the list.

Example:

42

last
integer | null

Returns the last n elements from the list.

Example:

42

company_id
string
required

The ID of the company to list memberships for

Example:

"biz_xxxxxxxxxxxxxx"

direction
enum<string> | null

The direction to sort the memberships by The direction of the sort.

Available options:
asc,
desc
order
enum<string> | null

The order to sort the memberships by Which columns can be used to sort.

Available options:
id,
created_at,
status,
canceled_at,
date_joined,
total_spend
access_pass_ids
string[] | null

The access pass IDs to filter the memberships by

Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "VXNlci0xMA==") or integer (such as 4) input value will be accepted as an ID.

statuses
enum<string>[] | null

The membership status to filter the memberships by

cancel_options
enum<string>[] | null

The cancel options to filter the memberships by

plan_ids
string[] | null

The plan IDs to filter the memberships by

Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "VXNlci0xMA==") or integer (such as 4) input value will be accepted as an ID.

promo_code_ids
string[] | null

The promo code IDs to filter the memberships by

Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "VXNlci0xMA==") or integer (such as 4) input value will be accepted as an ID.

created_before
integer | null

The maximum creation date to filter by

Example:

1701406800

created_after
integer | null

The minimum creation date to filter by

Example:

1701406800

Response

A successful response

The connection type for PublicMembership.

data
array | null
required

A list of nodes.

page_info
object
required

Information to aid in pagination.

I