extendSubscriptionItemFreeTrial() - Billing | Clerk Docs
extendSubscriptionItemFreeTrial()
Extends the free trial for the given Subscription Item.
Returns the updated BillingSubscriptionItem object.
function extendSubscriptionItemFreeTrial(subscriptionItemId: string, params: { extendTo: Date }): Promise<BillingSubscriptionItem>
Parameters
Name
subscriptionItemId
Typestring
Description
The ID of the Subscription Item to extend the free trial for.Name
params
Type{ extendTo: Date; }
Description
The parameters for the request.Name
params.extendTo
TypeDate
Description
The date to extend the free trial to. Must be in the future and not more than 365 days from the current trial end date.
Usage
const response = await clerkClient.billing.extendSubscriptionItemFreeTrial('subi_123', {
extendTo: new Date('2026-12-31'),
})
Backend API (BAPI) endpoint
This method in the SDK is a wrapper around the BAPI endpoint POST /billing/subscription_items/{subscription_item_id}/extend_free_trial. See the BAPI reference for more information.