Skip to main content

extendSubscriptionItemFreeTrial()

Warning

Billing is currently in Beta and its APIs are experimental and may undergo breaking changes. To mitigate potential disruptions, we recommend pinning your SDK and clerk-js package versions.

Extends the free trial period of a Subscription Item. Returns the updated BillingSubscriptionItem.

function extendSubscriptionItemFreeTrial(
  subscriptionItemId: string,
  params: ExtendSubscriptionItemFreeTrialParams,
): Promise<BillingSubscriptionItem>
  • Name
    extendTo
    Type
    Date
    Description

    An RFC3339 timestamp to extend the free trial to. Must be in the future and not more than 365 days from the current trial end.

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

Feedback

What did you think of this content?

Last updated on