Skip to main content
Docs

getPlanList()

Warning

This API is experimental and subject to change while Clerk Billing is under Beta. To mitigate potential disruptions, we recommend pinning your SDK and clerk-js package versions.

Retrieves a list of billing plans. Returns a PaginatedResourceResponse object with a data property that contains an array of CommercePlan objects, and a totalCount property that indicates the total number of plans.

function getPlanList(
  params?: GetOrganizationListParams,
): Promise<PaginatedResourceResponse<CommercePlan[]>>
  • Name
    limit?
    Type
    number
    Description

    The number of results to return. Must be an integer greater than zero and less than 501. Defaults to 10.

  • Name
    offset?
    Type
    number
    Description

    Skip the first offset results when paginating. Needs to be an integer greater or equal to zero. Defaults to 0.

  • Name
    payerType?
    Type
    'org' | 'user'
    Description

    Filter plans by payer type.

Note

Importing clerkClient varies based on your framework. Refer to the Backend SDK overview for usage details, including guidance on how to access the userId and other properties.

const { data, totalCount } = await clerkClient.billing.getPlanList({ payerType: 'org' })

Backend API (BAPI) endpoint

This method in the SDK is a wrapper around the BAPI endpoint GET /commerce/plans. See the BAPI reference for more information.

Feedback

What did you think of this content?

Last updated on