Customer Portal lets your customers to manage their account and billing themselves. Chargebee supports Single Sign-on (SSO) to access the customer portal. If you already have your own authentication for your website, it allows your authenticated customers to access their portal without having to login again.
Note: You can instead allow your customers to access the portal via login page provided by Chargebee. Read more.
Please follow the below steps for supporting portal access via SSO:
- To enable the "Allow access to customer portal via API", click Settings > Configure Chargebee > Customer Facing Essentials > Checkout and Self Serve Portal > Portal.
- Provide a link in your website/application which your authenticated customers can use to access the portal (For example,
{your_website_url}/portal_link). - Handle the link request in your server code and create a portal session for the customer by calling Chargebee's "Create a portal session" API
- Forward the user to the access URL present in the "Portal Session" resource returned by the above API call.
Notes about access URL:
- The access URL should be accessed by the customer within one hour from the time it was created.
- Once accessed, the session is valid until the user logs out from the portal UI or logout API is called from your application for this session.
- Once accessed, the access url cannot be reused. Hence do not persist this URL. Whenever you need to provide access to the portal, you need to create a new portal session.
Sample Portal sessionJSON
API Index URL
Portal sessions attributes
Unique pre-authenticated portal session token to access customer portal directly.
Unique URL for accessing the customer portal. Once accessed, this cannot be reused.
Indicates the current status of the portal session.
Indicates that the portal session is just created and not yet accessed by the user.
Indicates that the portal session URL has been accessed by the user and the session is active.
Indicates that the portal session is logged out either by user or via API.
Indicates that the portal session is created and not yet activated for the customer to allow access to your website. This is applicable when you use Chargebee's authentication for your website
Indicates that the portal session is activated for the customer to allow access to your website. This is applicable when you use Chargebee's authentication for your website.
Timestamp indicating when this portal session was generated.
Specifies when the portal session URL expires. After this time, it is no longer accessible. The expiration time is set to 1 hour after the portal session is created.
Timestamp indicating when this portal session URL was accessed by the user.
Timestamp indicating when this portal session was logged out either by user or via API.
IP Address from which the portal session URL was accessed.
IP Address from which the portal session was logged out either by user or via API.