API Version
Product Catalog
Library

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

https://{site}.chargebee.com/api/v2/pricing_page_sessions

Model Class

id
optional, string, max chars=70

Unique identifier generated for each pricing page session requested.


url
optional, string, max chars=250

Unique URL for the pricing page that can be included in your website.


created_at
optional, timestamp(UTC) in seconds

Indicates when this pricing page session is generated.


expires_at
optional, timestamp(UTC) in seconds

Indicates when this pricing page session will expire. After this, the pricing page cannot be accessed.


id id
optional, string, max chars=70

Unique identifier generated for each pricing page session requested.


url url
optional, string, max chars=250

Unique URL for the pricing page that can be included in your website.


created_at created_at
optional, timestamp(UTC) in seconds

Indicates when this pricing page session is generated.


expires_at expires_at
optional, timestamp(UTC) in seconds

Indicates when this pricing page session will expire. After this, the pricing page cannot be accessed.


Try in API Explorer

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.

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/pricing_page_sessions/create_for_new_subscription \
     -u {site_api_key}:\
     -d "pricing_page[id]"="01HTPJN1JKBQ3BQ3ZH7V8X2Z9Q" \
     -d "subscription[id]"="__test__KyVnHhSBWmCoF2tJ" \
     -d "customer[id]"="__test__8asqlU6yBgeA3k" 
copy
Click to Copy
200:
OK
STATUS

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

Method

redirect_url[]
optional, string, max chars=250

The customers will be redirected to this URL upon successful checkout.

business_entity_id[]
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.

auto_select_local_currency[]
optional, boolean, default=false
  • false: The first currency in the dropdown list is selected.
  • true: Automatically determines the currency based on the visitor's geolocation. For example, if the visitor is from the United States and this flag is enabled, USD is selected as the currency-if it's available on the pricing page. Similarly, if the visitor is from India, INR is selected. If the visitor's country currency isn't available, the first currency in the dropdown list is selected.
pricing_page[id]
required, string, max chars=50
subscription[id]
optional, string, max chars=50
customer[id]
optional, string, max chars=50
customer[email]
optional, string, max chars=70
customer[first_name]
optional, string, max chars=150
customer[last_name]
optional, string, max chars=150
customer[company]
optional, string, max chars=250
customer[phone]
optional, string, max chars=50
customer[locale]
optional, string, max chars=50
billing_address[first_name]
optional, string, max chars=150
billing_address[last_name]
optional, string, max chars=150
billing_address[email]
optional, string, max chars=70
billing_address[company]
optional, string, max chars=250
billing_address[phone]
optional, string, max chars=50
billing_address[line1]
optional, string, max chars=150
billing_address[line2]
optional, string, max chars=150
billing_address[line3]
optional, string, max chars=150
billing_address[city]
optional, string, max chars=50
billing_address[state_code]
optional, string, max chars=50
billing_address[state]
optional, string, max chars=50
billing_address[zip]
optional, string, max chars=20
billing_address[country]
optional, string, max chars=50
billing_address[validation_status]
optional, enumerated string, default=not_validated
Possible values are
not_validated

Address is not yet validated.

valid

Address was validated successfully.

partially_valid

The address is valid for taxability but has not been validated for shipping.

invalid

Address is invalid.

Show all values[+]
shipping_address[first_name]
optional, string, max chars=150
shipping_address[last_name]
optional, string, max chars=150
shipping_address[email]
optional, string, max chars=70
shipping_address[company]
optional, string, max chars=250
shipping_address[phone]
optional, string, max chars=50
shipping_address[line1]
optional, string, max chars=150
shipping_address[line2]
optional, string, max chars=150
shipping_address[line3]
optional, string, max chars=150
shipping_address[city]
optional, string, max chars=50
shipping_address[state_code]
optional, string, max chars=50
shipping_address[state]
optional, string, max chars=50
shipping_address[zip]
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_validated

Address is not yet validated.

valid

Address was validated successfully.

partially_valid

The address is valid for taxability but has not been validated for shipping.

invalid

Address is invalid.

Show all values[+]
discounts[apply_on][0..n]
optional, enumerated string
Possible values are
invoice_amount

The 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_price

The 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_time

The discount stays attached to the subscription till it is applied on an invoice once. It is removed after that from the subscription.

forever

The discount is attached to the subscription and applied on the invoices till it is explicitly removed .

limited_period

The 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
discounts[amount][0..n]
optional, in cents, min=0
discounts[period][0..n]
optional, integer, min=1
discounts[period_unit][0..n]
optional, enumerated string
Possible values are
day

A period of 24 hours.

week

A period of 7 days.

month

A period of 1 calendar month.

year

A period of 1 calendar year.

Show all values[+]
discounts[included_in_mrr][0..n]
optional, boolean
discounts[item_price_id][0..n]
optional, string, max chars=100
discounts[quantity][0..n]
optional, integer, min=1
discounts[label][0..n]
optional, string, max chars=100
pricing_page_session pricing_page_session
always returned
Resource object representing pricing_page_session

Sample admin console URL

https://{site}.chargebee.com/admin-console/pricing_page_sessions/123x
Try in API Explorer

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.

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/pricing_page_sessions/create_for_existing_subscription \
     -u {site_api_key}:\
     -d "pricing_page[id]"="01HTPJN1JKBQ3BQ3ZH7V8X2Z9Q" \
     -d "subscription[id]"="__test__KyVnHhSBWmCoF2tJ" 
copy
Click to Copy
200:
OK
STATUS

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

Method

redirect_url[]
optional, string, max chars=250

The customers will be redirected to this URL upon successful checkout.

pricing_page[id]
required, string, max chars=50
subscription[id]
required, string, max chars=50
discounts[apply_on][0..n]
optional, enumerated string
Possible values are
invoice_amount

The 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_price

The 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_time

The discount stays attached to the subscription till it is applied on an invoice once. It is removed after that from the subscription.

forever

The discount is attached to the subscription and applied on the invoices till it is explicitly removed .

limited_period

The 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
discounts[amount][0..n]
optional, in cents, min=0
discounts[period][0..n]
optional, integer, min=1
discounts[period_unit][0..n]
optional, enumerated string
Possible values are
day

A period of 24 hours.

week

A period of 7 days.

month

A period of 1 calendar month.

year

A period of 1 calendar year.

Show all values[+]
discounts[included_in_mrr][0..n]
optional, boolean
discounts[item_price_id][0..n]
optional, string, max chars=100
discounts[quantity][0..n]
optional, integer, min=1
discounts[label][0..n]
optional, string, max chars=100
pricing_page_session pricing_page_session
always returned
Resource object representing pricing_page_session

Sample admin console URL

https://{site}.chargebee.com/admin-console/pricing_page_sessions/123x