New in Chargebee: Explore Reveal and understand your payment performance end-to-end.Try Now
Docschargebee docs
HomeBillingPaymentsRevRecGrowthReveal
Support

Product Updates


  • Release Notes

Getting Started


  • Overview
  • Chargebee Billing Data Centers
  • Object Relationship Model
  • Understanding Sites
  • Developer Resources
  • Chargebee Tech Glossary
  • Articles and FAQ

Implementing Chargebee


  • Implementation Guide
  • Go-live Checklist
  • Articles and FAQ

AI in Chargebee


  • Chargebee Agents
  • Chargebee Copilot
  • Chargebee MCP Server (Model context protocol)

Product Catalog


  • Product Catalog Overview
  • Coupons
  • Articles and FAQ

Subscriptions


  • Working with Subscriptions
  • Billing
  • Orders
  • Articles and FAQ

Customers


  • Managing Customers
  • Account Hierarchy
  • Email Notifications
  • Branding
  • Configure Multiple Languages
  • Articles and FAQ

Invoices, Credit Notes and Quotes


  • Invoices
  • Credit Notes
  • Quotes [Legacy]
  • Transactions
  • Articles and FAQ

Taxes


  • Overview
  • Configuring Taxes
  • Country-specific Taxes
  • Articles and FAQ

Hosted Capabilities


  • Overview
  • Hosted Checkout
    • Integration Options
    • Features
    • Configuring Checkout
    • Configuring Fields and Labels
    • FAQ
  • Hosted Self-Serve Portal
  • Hosted Pages Features
  • Additional Hosted Pages
  • Payment Components
  • Managing payments with ChargebeeJS
  • Mobile-Optimized Hosted Pages
  • Articles and FAQ

Site Configuration


  • Users & Roles
  • Custom Fields & Metadata
  • Mandatory Fields
  • File Attachments & Comments
  • Advanced Filter Options
  • Multicurrency Pricing
  • Multi-decimal Support
  • Configuring Reason Codes
  • Events and Webhooks
  • API Keys
  • Time Zone
  • Time Machine
  • Transfer Configurations
  • Articles and FAQ

Reports and Analytics


  • RevenueStory
  • Home Dashboard
  • Frequently Asked Questions
  • FAQs for Classic Reports Sunset
  • Articles and FAQ

Integrations


  • Sales
  • Customer Support and Success
  • Finance
  • Tax
  • Marketing
  • Stitch
  • Collaboration
  • Contract Management
  • Order Management
  • Mobile Subscriptions (Legacy)
  • Other Integrations
  • Articles and FAQ

Data Privacy & Security


  • Two Factor Authentication
  • SAML Single Sign-On
  • System for Cross-Domain Identity Management (SCIM)
  • EU-GDPR
  • Consent Management
  • Personal Data Management
  • Compliance Certificates
  • HIPAA Guidelines
  • PCI Recommendations and Integration Types
  • Articles and FAQ

Data Operations


  • Bulk Operations
  • Migration
  • Articles and FAQ
  1. Billing
  2. Hosted Capabilities
  3. Hosted Checkout
  4. Integration Options
  1. Billing
  2. Hosted Capabilities
  3. Hosted Checkout
  4. Integration Options

Integration options

Chargebee offers the following options to integrate the hosted checkout based on your application or website's framework and business model:

  • Hosted Pages API: Recommended if you want to authenticate the user on your end, override payment-related information, handle returning users, and collect additional information.
  • Drop-in Script.
  • Plan-Specific URL.

When to use API vs. drop-in script

image

Hosted Pages API

Using the Hosted Pages API to create in-app Checkout is the recommended approach when you already maintain a user-management or authentication system. It gives you control to override predefined information for a particular instance, such as changing the price of an item or providing an additional trial period.

Note

The API generates a Checkout URL that expires 3 hours after creation.

Benefits of using API integration:

  • Manage authentication and collect additional information in your application or website.
  • Override plan and add-on pricing during checkout.
  • Optimize trial tenure. For example, you can offer a 14-day trial to one customer and a one-month trial to another.

Example

Here's an example of when you might choose Checkout via API over the Drop-in Script:

Jenna runs a digital weight loss and fitness app. She wants to collect user information such as the client's height, weight, food habits, and so on, along with their address and email, and store it in her database instead of Chargebee. She would still like to use Chargebee's Checkout as she does not want to handle the details of PCI Compliance.

Jenna can use the API integration to collect additional information on the frontend and rely on Chargebee's Hosted Pages API for payment details.

To learn more about the integration and implementation of Checkout via API, read our developer documentation.

You can use hosted checkout via APIs for the following workflows:

  • Checkout for new subscriptions
  • Checkout for existing subscription upgrades
  • Checkout for one-time purchases

Drop-in script

The Drop-in Script is a plug-in type, easy-to-use solution that requires minimal developer help. You can easily create a checkout page by adding a script generated for the plan item on your HTML page.

Checkout integrated using the Drop-in Script is Level 1 PCI compliant. Therefore, you need to fill out this questionnaire before integrating.

Note:

You should review the following documents from the above page before integrating Checkout using the Drop-in Script:

  1. SAQ Instructions and Guidelines
  2. Understanding SAQs for PCI DSS

The SAQs must be filled out based on the applicability as per the guideline document and shared with the payment gateway. No document needs to be submitted to Chargebee.

To use the Drop-in Script to integrate Checkout, follow these steps:

  • Click Settings > Configure Chargebee > Checkout and Self-Serve Portal > Integrate with Chargebee.
image
  • Select the Plan and Add-on from the drop-down list.
image
  • Copy the Header script and paste it within the <head> tag of the HTML page.
image
  • Copy the Checkout Button Code and paste it in the body of the HTML page.
image

Here is a sample checkout:

image

You can use Checkout via Drop-in for the following workflows:

  • Checkout for new subscriptions
  • Checkout for one-time purchases

Learn more on how to integrate Checkout using the Drop-in Script.

Plan-specific URL

You can manually create a checkout URL and embed it in your application or website's Checkout button. When the checkout button is clicked, the Checkout is displayed.

This approach is the easiest. Through this integration, the checkout window opens in a new tab. Products in the Checkout URL cannot be altered during checkout since the integration does not support dynamic modification. Complex business logic such as price override, user authentication, and so on, are not possible through this integration.

Note

In this integration approach, if the user clicks the checkout link when on a WebView tab, the checkout window will not work. This is because the integration only supports opening the checkout window in a new tab.

Example for a plan-specific URL:

https://{your-site}/hosted_pages/plans/no-trial
?coupon_ids[0]=fifty
&addons[id][0]=day-pass
&addons[quantity][0]=2
&customer[email]=vivek@chargebee.com
&customer[cf_test]=customer%20custom%20field
&customer[cf_date]=1991-09-16
&subscription[cf_sub_test]=subscription%20custom%20field

Here's the syntax to create a plan-specific URL:

https://<site-name>.chargebee.com/hosted_pages/plans/<plan-id>

Replace the <site-name> and <plan-id> placeholders with your Chargebee site subdomain and Plan ID. For example, if the site name is docstest-test and the plan ID is sapphire, then this is how the URL would look:

https://docstest-test.chargebee.com/hosted_pages/plans/sapphire

This approach is recommended if your application or website's code does not accept JavaScript.

List of supported query parameters

SectionURL Parameter
Plan/hosted_pages/plans/<plan_id>/subscription[plan_quantity]
Addonaddons[id][0], addons[quantity][0]
Couponscoupon_ids[0]
Customer

All parameters available for Checkout a new subscription.

Exceptions: taxability, consolidated_invoicing

Subscriptionsubscription[plan_quantity], subscription[start_date], subscription[<custom_field_name>]
Billing address

All parameters available here.

Exceptions: validation_status

Shipping Address

All parameters available here.

Exceptions: validation_status

You can integrate hosted checkout via plan-specific URL for the following workflows:

  • Checkout for new subscriptions
  • Checkout for one-time purchases

Articles & FAQs

Pre-filling/Passing custom fields to hosted pages (via Plan URL)
Why is the checkout page not loading?
Can I purchase one time add-on for a subscription from the customer portal?
Managing the Payment Source Redirect URL
Redirect URL not working

Show more

Was this article helpful?