Quick installation of Chargebee Retention in 3 steps

Modified on: Mon, 10 Oct, 2022 at 6:14 PM

Scope

Quick installation of Chargebee Retention in 3 steps

How to configure Chargebee Retention via API?


Summary

The technical requirements for installing Chargebee Retention with Chargebee Billing or any of our supported billing providers can be outlined in 3 easy steps. The following guide can work with any e-commerce platform or front-end framework so long as you have access to updating the source code on the page where the user clicks cancel.

1) Add an API key from your subscription billing provider in the Chargebee Retention settings. 

2) Apply the id="bb-cancel" a selector to the button or link element that the user clicks to initiate a cancel session. 

3) Drop our snippet in the of the page somewhere below the button and populate the request payload with the user's subscription ID

Solution

The technical requirements for installing Chargebee Retention with Chargebee Billing, or any of our supported billing providers are fairly straightforward and can be outlined in 3 easy steps. The following guide can work with any e-commerce platform or front-end framework so long as you have access to updating the source code on the page where the user clicks cancel.

1) Add an API key from your subscription billing provider in the Chargebee Retention settings. 

What's this for? The API key allows Chargebee Retention access to look up your user and modify the subscription for cancels, discounts, plan changes, and billing extensions or pauses

In the Chargebee application go to Settings  > Configure Chargebee > API Keys and click Add API Key.

Use a full access key if you would like Chargebee Retention to make subscription updates. Then assign the key an access level and click Create Key.  

Copy the new key and open the Chargebee Retention application. Head over to Settings > Integrations > Chargebee and add the key with your site name and API key.

Chargebee is connected. Now you'll need to edit the page where your cancel button lives in your application.

2) Apply the id="bb-cancel" a selector to the button or link element that the user clicks to initiate a cancel session. 

What's this for? This tells the Chargebee Retention snippet which button should direct the user to their personalized cancel experience. Our javascript will target this button and fall back to the URL in the href attribute if there are any issues in the hand-off to Chargebee Retention


<button id="bb-cancel" href="">Cancel Subscription</button>

3) Drop our snippet in the <body> of the page somewhere below the button and populate the request payload with the user's subscription id like so.

What's this for? This step identifies your user in Chargebee Retention, syncs the subscription information in Chargebee and directs them to their personalized cancel experience should they choose to click cancel
<script
type="text/javascript"
src="https://app.brightback.com/js/current/?compiled=true"
></script>
<script type="text/javascript">
if (window.Brightback) {
window.Brightback.handleData({
app_id: <BRIGHTBACK APP ID> //static value connecting your Brightback account
subscription_id: <CHARGEBEE SUBSCRIPTION ID> //dynamic value identifying the user
});
}
</script>

The above implementation steps are all you need to get started and can be accomplished in less than one day or even a few minutes for each task. We also support many customization options and install variations such as installing in a single page app, pulling in custom data, white-labeling your pages with a vanity domain, and much more.  Questions? Please reach out if you have any questions at retention-support@chargebee.com.

Related Articles

How to integrate Chargebee Retention and Chargebee Billing?

How to configure Recurly billing integration in Chargebee Retention?


Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.
×