Chargebee Integration: APIv2

This guide explains how to integrate Chargebee purchases and subscriptions into LeadDyno. Chargebee is a leading subscription billing software powering end-to-end recurring billing, subscription management & auto invoicing. With this integration, you can send transaction details to LeadDyno, along with the affiliate ID in order to track the affiliate's conversion and commission.

Important Note:

  • If you are a customer who has been using the original Chargebee integration, we have a dedicated guide which can be found here. This hyperlinked guide is applicable to APIv1 users. Unsure if this includes you? Send us a note and we’ll help you along your way!
  • For new users, Chargebee will automatically assign you to APIv2. 

 In this article


The Chargebee integration requires the following before you can successfully connect with LeadDyno. 

1.  Chargebee Site address and 

2.  Chargebee API Key

To start, log in to your Chargebee account. Next, simply follow the steps below.  

Chargebee Site Address 

First, let’s get your site address. It’s the URL that is found at the top of your Chargebee dashboard. To get your Chargebee site address, please check the URL of your dashboard, it should follow the format {site} For example, in the image below the Chargebee site address is, and in this instance what you need is "ldd-ssc-test"

Chargebee API Key

Once you have the Chargebee site address, the next step is to generate the API Key inside your Chargebee account. To find this key, just follow these steps: 

1. Go to your Chargebee Home Page, and click on SettingsConfigure Chargebee;

2. Once this is done, choose API Keys under API Keys and Webhooks;

3. Choose Add API Key;

4. Select Read-Only Key → All (Please select "All" after selecting "Read-Only Key);

5. Copy the API Key from Chargebee.


Ok, it’s time to take the information you’ve gathered from Chargebee (including the site Address and Chargebee API Key) and go ahead and login to your LeadDyno account. Now that you’re logged in, follow these steps to complete the integration:

1. Connect the Chargebee integration from your LeadDyno Account via AppsOnline Payment

2. When you scroll down, Chargebee is listed as one of the apps as seen in the image below. Go ahead and click “ add"

3. Copy the API Key and Site Address you grabbed from  Chargebee and fill in the corresponding information for your Chargebee Site and the API Key. Once this is done please click " Connect"

4. The next step will be to add the Javascript below to the header of your website. Adding this script enables LeadDyno to track when visitors make a purchase. Not sure how to add this script to your website header? We recommend reaching out to the provider for your website to guide you on how to do this.

<script src=""></script>
<script type="text/javascript" src=""> </script>

LeadDyno.key = "PUBLIC_API_Key";

$(document).ready(function() {
  var cbInstance = Chargebee.getInstance();
  cbInstance.setCheckoutCallbacks(function(cart) {
    return {
      success: function(hostedPageId) {
        LeadDyno.recordVisit({ 'purchase_code': hostedPageId, channel: 'chargebee' }, null, true);


The "PUBLIC_API_Key" part will need to be replaced with your LeadDyno public key which can be found in the Settings section of LeadDyno.

Chargebee WebHook

Setting up the Chargebee webhooks enables LeadDyno to listen only (read-only permission) to Chargebee events, so LeadDyno can track the purchase details and associate the related affiliate compensation for purchases made via Chargebee. 

Navigate to the Webhook Settings page in Chargebee, and then,

  1. Create a new webhook named "LeadDyno"
  2. Enter the Webhook URL as: (Replace it with your private LeadDyno API key)
  3. Keep the other configurations unchanged and click Create Webhook.

Completing the above setup will enable LeadDyno to track any lead conversions or cancellations made and even calculate the affiliate compensation for purchases.

Limitations / Known Issues

The Chargebee APIv2 integration is currently compatible only with Chargebee's In-App Checkout. This integration is not compatible with other checkout versions such as Full Page Checkout.

If that’s hard to follow or you need some additional help along the way, as always, we are here to help. Contact us at any time and our Support team will be there for you.