Getting Started

Product Catalog



Invoices, Credit Notes and Quotes



Site Configuration

Data Privacy & Security

Data Operations

Reports and Analytics

Revenue Recognition


Customer Portal using Chargebee's API 

Chargebee provides a variety of options for your customers to help manage their accounts. Apart from offering a pre-built customer portal, Chargebee also provides the following options if you would require a self-service portal for your customers:

  1. Chargebee's pre-built Hosted Customer Portal with in-built Authentication
  2. Chargebee's Hosted Customer Portal with your website's authentication
  3. Customization to the existing customer portal - Open Source
  4. Using your Custom Portal with Chargebee's Authentication

If you have your own self service portal and would want to just use Chargebee's Authentication to sign in a customer follow the steps here.

1. Chargebee's Customer Portal with in-built Authentication 

Chargebee provides a pre-built customer portal with in-built authentication. You could get started with the default portal right away, with a few tweaks to suit your business needs. This option is discussed in detail here.

2. Chargebee's Customer Portal with your Website's Authentication 

Let us assume customers already log into your website to access your application. Now, to manage their subscriptions, you wouldn't want them to sign in again to access Chargebee's customer portal.

In such cases, you can redirect customers directly to Chargebee's Portal using the API. This is referred to as SSO - Single Sign On.

Follow these steps to support portal access via SSO:

  1. On the Chargebee UI, under Settings > Configure Chargebee > Checkout & Self-Serve Portal > Customers can access the self-serve portal choose Via Single Sign On API.
  2. Include a link/button on your site that leads customers to the portal for managing their account.
  3. When customers click the link, handle the link request at your server's end and create a portal session for the customer using Chargebee's "Create a portal session" API.
  4. Redirect the user to the access URL present in the "Portal Session" resource returned by the API call that was made in the previous step.
  • The access URL will be valid for only an hour from the time it was created.
  • Once accessed, the session is valid until the user logs out from the portal or the Logout API is invoked from your application for that particular session.
  • The Access URL cannot be reused. So create a new Portal session each time you need to provide access to the portal.

3. Customizing Chargebee's existing Customer Portal - Open Source 

If you would want to build additional features on top of Chargebee's pre-built customer portal, we have an open source code   which can be forked.

4. Using your Custom Portal with Chargebee's Authentication 

Chargebee allows you to integrate your custom self-service portal by building user authentication on top of Chargebee. If you would want to allow access to parts of your website only to subscribers (like a paywall), you can integrate Chargebee's authentication without having to handle it from your end.

When customers are led to your custom self-service portal from your website, redirect them to the Login URL:

The following parameters should be passed along with the Login URL:

  • return_url - The URL that users should be redirected to upon successful authentication.
  • cancel_url - The URL that users should be redirected to when they want to go back to your website during login.

The domain name used in the Return/Cancel URL should be added as a 'Allow-list Domain' in Chargebee. Add just the domain name in Chargebee and not the entire URL: E.g.

Upon successful authentication, a portal session is created for the user and Chargebee redirects the user to the return_url along with the following parameters:

  • auth_session_id - Identifier to the authenticated session.
  • auth_session_token - Token for the session which should be sent later to activate this session.

With the auth_session_id & auth_session_token parameters, using Activate a Portal Session API , validate the session details and create a session for that user in your website.

Was this article helpful?