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

Create a pre-cancel hosted page

Creates a hosted_page resource of type pre_cancel . Route canceling users to this page to provide them a retention experience and start saving revenue. The hosted page is created in accordance with the retention experience configured in the Chargebee Growth app , along with the data provided as input to this endpoint. Call the endpoint before your customer clicks the Cancel button, and when they do, route them to the url in the endpoint response.

Sample Request

Sample Result[JSON]

URL Format

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

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.
pass_thru_content
optional, string, max chars=2048

Additional data to be passed to Chargebee Growth. Only the value of pass_thru_content.custom is sent to Chargebee Growth. It is sent as the value of the custom property. The fields provided in pass_thru_content.custom must be preconfigured in Chargebee Growth.

Although only pass_thru_content.custom is sent to Chargebee Growth, all of pass_thru_content is stored by Chargebee Billing and is retrievable as an attribute of the hosted_page. .

cancel_url
optional, string, max chars=250

The customer is sent to this URL if they finally decide to cancel the subscription, despite the attempt to retain them.

redirect_url
optional, string, max chars=250

The customer is sent to this URL upon successful retention. In other words, this is the page to which the customer is sent when they decide not to cancel the subscription.

locale
optional, string, max chars=50
subscription
Parameters for subscription
pass parameters as subscription[<param name>]

Returns

Hosted page object

Resource object representing hosted_page