Skip to main content
Docs

getUserBillingSubscription()

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 user's billing subscription. Returns a CommerceSubscription.

function getUserBillingSubscription(userId: string): Promise<CommerceSubscription>

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 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