POST /pricing_page_sessions/create_for_existing_subscription
This endpoint streamlines the generation of a pricing page session to enable subscription upgrade
, and downgrade
workflows using Chargebee's hosted pricing pages (Atomic Pricing
). By providing a subscription ID as a parameter, you will obtain a hosted pricing page session URL.
Note: Full access key
authentication is needed for this API request.
Servers
- {protocol}://{site}.{environment}:{port}/api/v2
- {protocol}://{site}-test.{environment}:{port}/api/v2
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
chargebee-request-origin-device |
String | No |
The device from which the customer has made the request |
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/x-www-form-urlencoded" |
chargebee-event-webhook |
String | No |
skip only webhooks Valid values:
|
chargebee-business-entity-id |
String | No |
If the site has multiple business entities, you can use this custom HTTP header to specify the business entity for which Chargebee should perform the operation. |
chargebee-event-actions |
String | No |
skip all actions to be done on the events Valid values:
|
chargebee-request-origin-user |
String | No |
The email address of your customer/user. Use this when the email address has only ASCII characters. |
chargebee-request-origin-ip |
String | No |
The IP address of the customer where the request originated |
chargebee-request-origin-user-encoded |
String | No |
The Base64-encoded email address of your customer/user. Use this if the email address has UTF-8 characters. When this header is provided, the header chargebee-request-origin-user is ignored. |
chargebee-event-email |
String | No |
skip only emails Valid values:
|
Request body fields
| Name | Type | Required | Description |
|---|---|---|---|
custom |
Object | No |
JSON object of custom attributes (key-value pairs) used for pricing page targeting or content. [Configure](https://www.chargebee.com/docs/retention/settings-and-installation/chargebee-retention-field-mappings) custom attributes in the dashboard. |
discounts |
Object | No |
Parameters for discounts |
discounts.apply_on[] |
Array | No | |
discounts.included_in_mrr[] |
Array | No |
The discount is included in MRR calculations for your site. This attribute is only applicable when |
discounts.period_unit[] |
Array | No | |
discounts.percentage[] |
Array | No |
The percentage of the original amount that should be deducted from it. |
discounts.period[] |
Array | No |
The duration of time for which the discount is attached to the subscription, in |
discounts.label[] |
Array | No |
Label for the discount |
discounts.amount[] |
Array | No |
The value of the discount. The format of this value depends on the kind of currency
you want to use for a discount. This is only applicable when |
discounts.duration_type[] |
Array | Yes | |
discounts.item_price_id[] |
Array | No |
The id of the item price
in the subscription to which the discount is to be applied. Relevant only when |
discounts.quantity[] |
Array | No |
Specifies the number of free units provided for the item, without affecting the total quantity sold |
redirect_url |
String | No |
The customers will be redirected to this URL upon successful checkout. |
subscription |
Object | No |
Parameters for subscription |
subscription.id |
String | Yes |
The unique identifier of an existing subscription for which the hosted pricing page is created. |
contract_term |
Object | No |
Parameters for contract_term |
contract_term.action_at_term_end |
String | No |
Action to be taken when the contract term completes. * evergreen -Contract term completes and the subscription renews. * cancel -Contract term completes and subscription is canceled. * renew -
Valid values:
Default value: "renew" |
contract_term.cancellation_cutoff_period |
Integer | No |
The number of days before Default value: 0 |
pricing_page |
Object | No |
Parameters for pricing page |
pricing_page.id |
String | No |
The unique identifier of the pricing table for which the hosted page is created. See documentation to obtain the pricing table id from Chargebee Growth. If you want the pricing table to be auto-selected based on your Play configuration in Chargebee Growth, do not pass this parameter. Required if You are on the legacy version of Pricing Tables (i.e. Atomic Pricing). See documentation to obtain the pricing table id. |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.