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]={item_price_id}&subscription_items[quantity][0]={quantity}
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&subscription_items[quantity][0]=5
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. exceptions: taxability, consolidated_invoicing |
Subscription | subscription[start_date] subscription[<custom_field_name>] |
Billing address | All parameters available here can be used. exceptions: validation_status |
Shipping Address | All parameters available here can be used. exceptions: validation_status |