Introducing OpenTelemetry for Chargebee SDKs — trace every API call in any telemetry tool.
Chargebeechargebee API

Extend subscription

This API generates a hosted page URL to extend the billing cycle of a subscription.

Use one of the following methods to open the hosted page:

  • In-app modal: Use Chargebee.js openCheckout() to open the hosted page in a modal popup in your website or application.
  • Standalone page: Redirect the customer to the hosted page url.

Do not embed the hosted page in your own iframe.

Sample Request

Sample Result[JSON]

URL Format

POST https://[site].chargebee.com/api/v2/hosted_pages/extend_subscription

Input Parameters

brand_id
optional, string, max chars=50

The unique ID of the brand this hosted page should be linked to. Applicable only when multiple brands have been created for the site. This need not match the brand of the customer or subscription in the request; when the two differ, the value provided here is used for the hosted page. An alternative way of passing this parameter is by means of the chargebee-brand-id custom HTTP header; when both are provided, they must specify the same brand.

Default behavior

  • When not provided, the hosted page is linked to the brand of the customer or subscription in the request.
expiry
optional, integer, min=1, max=500

Expiry (in days) for the link generated. No expiry will be set if this is not specified.

billing_cycle
optional, integer, min=1

The number of billing cycles by which the subscription should be extended.

Default behavior

  • If the subscription's plan has billing_cycles set, that value is used.
  • If the plan's billing cycles attribute is not set, 1 is used.
subscription
Parameters for subscription
pass parameters as subscription[<param name>]

Returns

Hosted page object

Resource object representing hosted_page