cancelSubscriptionItem()
Cancels the given Subscription Item.
Returns the cancelled BillingSubscriptionItem object.
function cancelSubscriptionItem(subscriptionItemId: string, params?: { endNow?: boolean }): Promise<BillingSubscriptionItem>- Name
subscriptionItemId- Type
string- Description
The ID of the Subscription Item to cancel.
- Name
params?- Type
{ endNow?: boolean; }- Description
The parameters for the request.
- Name
params?.endNow?- Type
boolean- Description
Whether the Subscription Item should be canceled immediately. If
false, the Subscription Item will be canceled at the end of the current billing period.
const response = await clerkClient.billing.cancelSubscriptionItem('subi_123', { endNow: true })Backend API (BAPI) endpoint
This method in the SDK is a wrapper around the BAPI endpoint DELETE /billing/subscription_items/{id}. See the BAPI reference for more information.
Feedback
Last updated on