Skip to main content

getUserBillingSubscription()

Important

Billing regularly introduces new features and UI changes to Clerk's components. If you'd like to remain on a specific version of Clerk's components or SDK, you can follow the steps in the pinning documentation.

Gets the BillingSubscription for the given User.

function getUserBillingSubscription(userId: string): Promise<BillingSubscription>
  • Name
    userId
    Type
    string
    Description

    The ID of the User to get the Billing Subscription for.

Note

Using clerkClient varies based on the SDK you're using. Refer to the overview for usage details, including guidance on how to access the userId and other properties.

const userId = 'user_123'

const subscription = await clerkClient.billing.getUserBillingSubscription(userId)

Backend API (BAPI) endpoint

This method in the SDK is a wrapper around the BAPI endpoint GET /users/{user_id}/billing/subscription. See the BAPI reference for more information.

Feedback

What did you think of this content?

Last updated on