How to create an Item Specific Checkout URL for Pc 2.0?

Modified on: Wed, 26 May, 2021 at 1:21 AM

When you create and use an item-specific URL for checkout, the user interface of the In-app Checkout is retained but is displayed as a pop-up window in a new tab. 

Here's is an example of item-specific URL for a plan:

https://{sitename}.chargebee.com/hosted_pages/checkout?subscription_items[item_price_id][0]={plan-id}

Now, to customize it for your usage, the placeholders need to be replaced with your Chargebee site name and Plan ID or Plan Price Point ID.

Example:

For a site named mars-voyage.chargebee.com having Plan Price Point ID as "mars-trip-usd-monthly" we can construct the item specific URL as below:

https://mars-voyage.chargebee.com/hosted_pages/checkout?subscription_items[item_price_id][0]=mars-trip-usd-monthly

Further, you can add addons, charges, coupons and many more to the query string (part in the URL after the question mark) to create a plan with all the necessary addons and charges attached. When a user clicks on the link, it takes them to the checkout window with all the fields pre-filled. All they have to do is enter their payment method details and checkout.

Example:

Here's how a plan when attached with addon and charge looks like in the item URL:

https://mars-voyage.chargebee.com/hosted_pages/checkout?
subscription_items[item_price_id][0]=plan-mars-bunker-rent-usd-monthly&
subscription_items[item_price_id][1]=addon-oxygen-supply-usd-daily&
subscription_items[item_price_id][2]=charge-spacesuit-with-pockets&
subscription_items[quantity][2]=5&
coupon_ids[0]=instigator-settlement

Breaking down the example, we get:

  • A monthly USD plan - which is a recurring rent for the mars bunker.
  • A daily USD addon - which is a recurring charge for consistent oxygen supply.
  • A one-time USD charge for spacesuits with pockets.
  • The quantity of five spacesuits with pockets. Note that it is associated with the spacesuit charge through indexing.
  • And finally, a coupon for being brave enough to be the first group of mars settlers.

 
List of allowed Query Parameters

Here's a list of query parameters you can use in the query string:

Module

Query Parameter

Subscription Item

subscription_items[item_price_id]

subscription_items[quantity]

Coupons

coupon_ids


Customer

All parameters available here can be used. 

exceptionstaxabilityconsolidated_invoicing

Subscription

subscription[start_date] 

subscription[<custom_field_name>]

Billing address

All parameters available here can be used.

exceptionsvalidation_status

Shipping Address

All parameters available here can be used.

exceptionsvalidation_status

M
Monica is the author of this solution article.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.