Embedded Checkout
Chargebee offers multiple options to integrate its hosted checkout, such as Drop-In Script, Hosted Pages API, or Payment Link. These integration options allow you to use the checkout in your web application either as a standalone page or as an overlay. The embedded checkout feature embeds the Chargebee hosted checkout within your web pages as an iframe that Chargebee.js creates and manages. Embedded checkout provides a better integration experience compared to relying on a standalone page setup.
Note
Embedded checkout is only supported with the full-page layout.
Prerequisite
Ensure you enable and configure full-page layout in your Chargebee site. Configure your checkout settings, styling, and customization to suit your brand.
Choose a checkout integration
Before you embed the full-page checkout, decide how you want to integrate the checkout option that will display on your web page. Based on the customer's use case, choose one of the following options:
- Via Drop-In Script: Generate and copy the Drop-In Script from the Chargebee app and add the script to your HTML webpage. This takes care of creating a cart and the associated checkout flow. Learn more about Drop-In Script integration.
- Via payment link: Use the Integrate with Chargebee wizard to generate reusable payment links from the Chargebee app. Learn more about payment link integration.
- Via Hosted Pages API: Deploy a cloud solution that uses an API endpoint to make server-to-server API calls to Chargebee, obtain the hosted page, and pass the hosted page URL to the web app via APIs. This mode of integration gives you control to override the predefined configuration for a particular checkout session. Learn more about Hosted Pages API integration.
Embed checkout with Chargebee.js
For an end-to-end implementation using a cart, Hosted Pages API URL, or payment link, see Embed Chargebee Checkout in your website. The tutorial shows how to create and mount checkout, resize its container, handle callbacks, and control redirection after a successful checkout.
For the complete callback API, see setCheckoutCallbacks in the Chargebee.js Reference.
Articles & FAQs
Was this article helpful?