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.
Sample pricing page session [ JSON ]
{
"id": "__test__VZlifqcdrl4Itq1go1b5lZY5cu2OJYYaNp",
"url": "https://hosted.atomicpricing.com/sites/01HTPJMZXNJ2CGQ9FP6W2BJA9B/pricing-session/__test__VZlifqcdrl4Itq1go1b5lZY5cu2OJYYaNp",
"created_at": 1709792318,
"expires_at": 1709795918,
"object": "pricing_page_session"
}
API Index URL GET
https://{site}.chargebee.com/api/v2/pricing_page_sessions
optional, string, max chars=70 Unique identifier generated for each pricing page session requested.
optional, string, max chars=250 Unique URL for the pricing page that can be included in your website.
optional, timestamp(UTC) in seconds Indicates when this pricing page session is generated.
optional, timestamp(UTC) in seconds Indicates when this pricing page session will expire. After this, the pricing page cannot be accessed.
optional, string, max chars=70 Unique identifier generated for each pricing page session requested.
optional, string, max chars=250 Unique URL for the pricing page that can be included in your website.
optional, timestamp(UTC) in seconds Indicates when this pricing page session is generated.
optional, timestamp(UTC) in seconds Indicates when this pricing page session will expire. After this, the pricing page cannot be accessed. 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.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Response [ JSON ]
Show more...
{
"pricing_page_session": {
"id": "__test__VZlifqcdrl4Itq1go1b5lZY5cu2OJYYaNp",
"url": "https://hosted.atomicpricing.com/sites/01HTPJMZXNJ2CGQ9FP6W2BJA9B/pricing-session/__test__VZlifqcdrl4Itq1go1b5lZY5cu2OJYYaNp",
"created_at": 1709792318,
"expires_at": 1709795918,
"object": "pricing_page_session"
}
}
URL Format
POST
https://{site}.chargebee.com/api/v2/pricing_page_sessions/create_for_new_subscription
optional, string, max chars=250 The customers will be redirected to this URL upon successful checkout.
optional, string, max chars=50 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.
pricing_page[[0..n]][0..n]
optional, string Parameters for pricing_page subscription[[0..n]][0..n]
optional, string Parameters for subscription
optional, string Parameters for customer billing_address[[0..n]][0..n]
optional, string Parameters for billing_address shipping_address[[0..n]][0..n]
optional, string Parameters for shipping_address
optional, array Parameters for discounts. Multiple discounts can be passed by specifying unique indices.
Parameters for pricing_page
pass parameters as pricing_page[<param name>]
required, string, max chars=50
Parameters for subscription
pass parameters as subscription[<param name>]
optional, string, max chars=50
Parameters for customer
pass parameters as customer[<param name>]
optional, string, max chars=50 optional, string, max chars=70 optional, string, max chars=150 optional, string, max chars=150 optional, string, max chars=250 optional, string, max chars=50 optional, string, max chars=50
Parameters for billing_address
pass parameters as billing_address[<param name>]
billing_address[first_name] optional, string, max chars=150 billing_address[last_name] optional, string, max chars=150 optional, string, max chars=70 optional, string, max chars=250 optional, string, max chars=50 optional, string, max chars=150 optional, string, max chars=150 optional, string, max chars=150 optional, string, max chars=50 billing_address[state_code] optional, string, max chars=50 optional, string, max chars=50 optional, string, max chars=20 optional, string, max chars=50 billing_address[validation_status] optional, enumerated string, default=not_validated 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.
Show all values[+]
Parameters for shipping_address
pass parameters as shipping_address[<param name>]
shipping_address[first_name] optional, string, max chars=150 shipping_address[last_name] optional, string, max chars=150 optional, string, max chars=70 shipping_address[company] optional, string, max chars=250 optional, string, max chars=50 optional, string, max chars=150 optional, string, max chars=150 optional, string, max chars=150 optional, string, max chars=50 shipping_address[state_code] optional, string, max chars=50 optional, string, max chars=50 optional, string, max chars=20 shipping_address[country] optional, string, max chars=50 shipping_address[validation_status] optional, enumerated string, default=not_validated 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.
Show all values[+]
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 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
. Show all values[+] discounts[duration_type][0..n] required, enumerated string, default=forever 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
. Show all values[+] discounts[percentage][0..n] optional, double, min=0.01, max=100.0 optional, in cents, min=0 discounts[period_unit][0..n] optional, enumerated string Possible values are
dayA period of 24 hours.weekA period of 7 days.monthA period of 1 calendar month.yearA period of 1 calendar year.
Show all values[+] discounts[included_in_mrr][0..n] discounts[item_price_id][0..n] optional, string, max chars=100 discounts[quantity][0..n] optional, string, max chars=100
always returned required
Resource object representing pricing_page_session
Sample admin console URL
https://{site}.chargebee.com/admin-console/pricing_page_sessions/123x
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.
This API is not enabled for live sites by default. Please contact
support to get this enabled.
Sample Response [ JSON ]
Show more...
{
"pricing_page_session": {
"id": "__test__VZlifqcdrl4Itq1go1b5lZY5cu2OJYYaNp",
"url": "https://hosted.atomicpricing.com/sites/01HTPJMZXNJ2CGQ9FP6W2BJA9B/pricing-session/__test__VZlifqcdrl4Itq1go1b5lZY5cu2OJYYaNp",
"created_at": 1709792318,
"expires_at": 1709795918,
"object": "pricing_page_session"
}
}
URL Format
POST
https://{site}.chargebee.com/api/v2/pricing_page_sessions/create_for_existing_subscription
optional, string, max chars=250 The customers will be redirected to this URL upon successful checkout. pricing_page[[0..n]][0..n]
optional, string Parameters for pricing_page subscription[[0..n]][0..n]
optional, string Parameters for subscription
optional, array Parameters for discounts. Multiple discounts can be passed by specifying unique indices.
Parameters for pricing_page
pass parameters as pricing_page[<param name>]
required, string, max chars=50
Parameters for subscription
pass parameters as subscription[<param name>]
required, string, max chars=50
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 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
. Show all values[+] discounts[duration_type][0..n] required, enumerated string, default=forever 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
. Show all values[+] discounts[percentage][0..n] optional, double, min=0.01, max=100.0 optional, in cents, min=0 discounts[period_unit][0..n] optional, enumerated string Possible values are
dayA period of 24 hours.weekA period of 7 days.monthA period of 1 calendar month.yearA period of 1 calendar year.
Show all values[+] discounts[included_in_mrr][0..n] discounts[item_price_id][0..n] optional, string, max chars=100 discounts[quantity][0..n] optional, string, max chars=100
always returned required
Resource object representing pricing_page_session
Sample admin console URL
https://{site}.chargebee.com/admin-console/pricing_page_sessions/123x