Search API Connector Documentation
Import Chargebee Data to Google Sheets
In this guide, we’ll walk through how to pull subscription data from the Chargebee API directly into Google Sheets, using the API Connector add-on. We'll first get an API key from Chargebee, and then set up a request to pull in metrics from Chargebee to your spreadsheet.
- Before You Begin
- Part 1: Get your Chargebee API Key
- Part 2: Pull Chargebee API Data into Sheets
- Part 3: More Example API URLs
- Part 4: Handle Pagination
- Part 5: API Documentation
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Get Your Chargebee API Key
- Log in to Chargebee and click Settings > Configure Chargebee > API keys from the menu.
- On the API keys and webhooks page, you'll see that a full-access test key has already been automatically created for you. Click to copy it to your clipboard.
- One last step: Basic Access Authentication requires us to encode our authentication info to base 64. You can do this by entering the Chargebee API key you just copied into this form. Your encoded credentials will appear underneath.
The encoding script runs in your browser, and none of your credentials are seen or stored by this site.
- Keep your encoded string handy, as we'll need it in a minute. Congrats, you now have access to the Chargebee API!
Part 2: Pull Chargebee API Data into Sheets
Now let's get some data into Sheets. For this example request we'll request a list of active subscriptions. Enter your own domain where it says
your_site (you can find your own site-domain value by looking in the URL bar when you're logged in), and your encoded key where it says
- Open up Google Sheets and click Extensions > API Connector > Open > Create request.
- In the request form enter the following:
- Request URL:
- Create a new tab and click Set current to use that tab as your data destination.
- Name your request and click Run. A moment later you’ll see subscription details populate the Chargebee Subs tab in your Google Sheet:
Part 3: More Example API URLs
You can check the documentation for the full list of available API requests, but if you just want to jump in, you can play around with the URLs you enter in the API URL path field. Try the following (one at a time):
Part 4: Handle Pagination
- Note Chargebee's limits on the number of records returned on a response. By default, only 10 records will be returned unless you use the 'limit' and 'next_offset' parameters as described in their documentation.
- With API Connector you can either run these request URLs manually or loop through them automatically with cursor pagination handling (paid feature), like this:
- API URL: enter your request URL, including limit=100
- Pagination type:
- Next token parameter:
- Next token path:
- Run until: choose when to stop running the request
Part 5: API Documentation
Official API documentation: https://apidocs.chargebee.com/docs/api