The pricing_page_session resource allows you to create a pricing page that incorporates customer and subscription details. This page helps customers choose a plan, start a new subscription, or modify an existing one. Each session is distinct and has a limited duration, ensuring a unique and time-sensitive experience.
This endpoint streamlines the generation of a pricing page session to enable new subscription creation workflows using Chargebee's hosted pricing pages (Atomic Pricing). By providing a subscription ID and/or customer ID as a parameter, you'll obtain a pricing page session URL.
Note: Full access key authentication is needed for this API request.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sets the context for this operation to the business entity specified. Applicable only when multiple business entities have been created for the site. When this parameter is provided, new subscription and customer resources are created within the business entity.
Parameters for customer pass parameters as customer[<param name>]
customer[id]
optional, string, max chars=50 The unique ID of the customer for which this hosted_page should be created. When not provided, a new customer is created with the ID set to the value provided for subscription[id]. If subscription[id] is unavailable, then the customer ID is autogenerated.
optional, string, max chars=50 Determines which region-specific language Chargebee uses to communicate with the customer. In the absence of the locale attribute, Chargebee will use your site's default language for customer communication.
optional, string, max chars=50 The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code as AZ (not US-AZ). For Tamil Nadu (India), set as TN (not IN-TN). For British Columbia (Canada), set as BC (not CA-BC).
optional, string, max chars=50 The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.
Note: If you enter an invalid country code, the system will return an error.
Brexit
If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI (the code for United Kingdom β Northern Ireland) is available as an option.
optional, enumerated string, default=not_validated The address verification status.
Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
optional, string, max chars=50 The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code as AZ (not US-AZ). For Tamil Nadu (India), set as TN (not IN-TN). For British Columbia (Canada), set as BC (not CA-BC).
optional, string, max chars=50 The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.
Note: If you enter an invalid country code, the system will return an error.
Brexit
If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI (the code for United Kingdom β Northern Ireland) is available as an option.
optional, enumerated string, default=not_validated The address verification status.
Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
Parameters for discounts. Multiple discounts can be passed by specifying unique indices. pass parameters as discounts[<param name>][<idx:0..n>]
discounts[apply_on][0..n]
optional, enumerated string The amount on the invoice to which the discount is applied.
Possible values are
invoice_amountThe discount is applied to the invoice sub_total.
Note:
This enum value is not supported for pricing_page_sessions resource, soon this value will be available for this resource. For more details please reach out to atomic-pricing@chargebee.com
specific_item_priceThe discount is applied to the invoice.line_item.amount that corresponds to the item price specified by item_price_id.
invoice_amountThe discount is applied to the invoice sub_total.
Note:
This enum value is not supported for pricing_page_sessions resource, soon this value will be available for this resource. For more details please reach out to atomic-pricing@chargebee.com
specific_item_priceThe discount is applied to the invoice.line_item.amount that corresponds to the item price specified by item_price_id.
required, enumerated string, default=forever Specifies the time duration for which this discount is attached to the subscription.
Possible values are
one_timeThe discount stays attached to the subscription till it is applied on an invoice once. It is removed after that from the subscription.foreverThe discount is attached to the subscription and applied on the invoices till it is explicitly removed.limited_periodThe discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by period and period_unit.
one_timeThe discount stays attached to the subscription till it is applied on an invoice once. It is removed after that from the subscription.foreverThe discount is attached to the subscription and applied on the invoices till it is explicitly removed.limited_periodThe discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by period and period_unit.
optional, in cents, min=0 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 type is fixed_amount.
optional, integer, min=1 The duration of time for which the discount is attached to the subscription, in period_units. Applicable only when duration_type is limited_period.
optional, boolean The discount is included in MRR calculations for your site. This attribute is only applicable when duration_type is one_time and when the feature is enabled in Chargebee. Also, If the site-level setting is to exclude one-time discounts from MRR calculations, this value is always returned false.
optional, string, max chars=100 The id of the item price in the subscription to which the discount is to be applied. Relevant only when apply_on is specific_item_price.
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.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Parameters for discounts. Multiple discounts can be passed by specifying unique indices. pass parameters as discounts[<param name>][<idx:0..n>]
discounts[apply_on][0..n]
optional, enumerated string The amount on the invoice to which the discount is applied.
Possible values are
invoice_amountThe discount is applied to the invoice sub_total.
Note:
This enum value is not supported for pricing_page_sessions resource, soon this value will be available for this resource. For more details please reach out to atomic-pricing@chargebee.com
specific_item_priceThe discount is applied to the invoice.line_item.amount that corresponds to the item price specified by item_price_id.
invoice_amountThe discount is applied to the invoice sub_total.
Note:
This enum value is not supported for pricing_page_sessions resource, soon this value will be available for this resource. For more details please reach out to atomic-pricing@chargebee.com
specific_item_priceThe discount is applied to the invoice.line_item.amount that corresponds to the item price specified by item_price_id.
required, enumerated string, default=forever Specifies the time duration for which this discount is attached to the subscription.
Possible values are
one_timeThe discount stays attached to the subscription till it is applied on an invoice once. It is removed after that from the subscription.foreverThe discount is attached to the subscription and applied on the invoices till it is explicitly removed.limited_periodThe discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by period and period_unit.
one_timeThe discount stays attached to the subscription till it is applied on an invoice once. It is removed after that from the subscription.foreverThe discount is attached to the subscription and applied on the invoices till it is explicitly removed.limited_periodThe discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by period and period_unit.
optional, in cents, min=0 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 type is fixed_amount.
optional, integer, min=1 The duration of time for which the discount is attached to the subscription, in period_units. Applicable only when duration_type is limited_period.
optional, boolean The discount is included in MRR calculations for your site. This attribute is only applicable when duration_type is one_time and when the feature is enabled in Chargebee. Also, If the site-level setting is to exclude one-time discounts from MRR calculations, this value is always returned false.
optional, string, max chars=100 The id of the item price in the subscription to which the discount is to be applied. Relevant only when apply_on = specific_item_price.