> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hightouch.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Chargebee

> Enrich Chargebee data with customer data from your warehouse to drive revenue analysis

## Overview

To get the most out of a tools like Chargebee, you'll need to update customers and custom fields.

Chargebee has a tedious process of having to update each customer individually. Hightouch solves this problem by letting you define your customers and it's custom fields on top of your data warehouse or production database. This ensures that your Chargebee will always remain in sync with your entire data stack.

### Why subscription billing should be based on top of the warehouse

* You can sync analytics as custom fields to your Chargebee customers. This allows you to prioritize a subset of certain customers more easily.
* You no longer have to check and compare your data between Chargebee and your business tools.

## Supported sync methods

Hightouch supports syncing data to a Chargebee customer.

### Sync customers to Chargebee

#### Matching source to destination records

When matching records, it's preferred to match it through Chargebee's customer ID. However, if your source has no access to the ID, it may match with other fields, such as email, last name, etc.

> [!WARNING]
>
> If there are multiple rows with same matching value, such as two customers
> having the same email, it will only select the first customer returned from
> Chargebee.

#### Modes

* **Upsert**: This mode will update existing customers or insert the customer if they do not already exist.
* **Update**: This mode will just update existing customers.

#### Custom fields

You are able to update Chargebee's custom fields through our destination custom field mapping. When referencing the Chargebee custom field within Hightouch, **use the API name** of the custom field

![](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-chargebee-customfield.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=a3a60cc659fe9349c862f5aa3ebd0ad8)

#### Rate limits

Something to keep in mind, as you process all your rows of data is that Chargebee limits the amount of times we can update the rows within their product per minute. This is completely dependent on which tier plan you have with Chargebee and if you're using live/test site.

[More Information On Chargebee's Rate Limit](https://support.chargebee.com/support/solutions/articles/250853-js-api-rate-limit-chargebee)

## Setup

### Connect to Chargebee

#### Creating API token

1. Log in to Chargebee
2. Click on **Settings**
3. Click on **Configure Chargebee** tab
4. Click on the **API keys** section
5. Click on **Add API key**
6. Select the **Full-Access Key** type, then **All** permissions, then give a name
7. Click **Create Key** and copy the newly created token

   ![](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-chargebee-create-apikey.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=0456aca1744b900f53306be1f1121cbd)

#### Adding destination in HT

1. Log in to Hightouch or create a free Hightouch account
2. Click on **Destinations** in the left sidebar
3. Click on **Add destination** in the top right corner
4. Select **Chargebee** in the destination catalog and click **Continue** to proceed
5. Type in your site name into the **Site** field (Hint: It's the subdomain when you're on the Chargebee app)
6. Paste your API token into the **API Access Token** field and click **Continue** to proceed
7. Give your destination a name and unique slug (for example, "Chargebee Production” and `chargebee-production`)
8. Click **Finish** to create your Chargebee destination.

### Connect to your data source

Hightouch sits on top of your data warehouse and can read from Snowflake, Redshift, BigQuery, Databricks, Postgres, MySQL, and many other data sources. You can even fetch data from Google Sheets and Airtable. Hightouch can help activate your data wherever it resides.

We've written dedicated guides for each supported data source. Take your pick:

* Connect to [Airtable](https://docs.hightouch.com/sources/airtable)
* Connect to [Amazon Athena](https://docs.hightouch.com/sources/amazon-athena.md)
* Connect to [Amazon Redshift](https://docs.hightouch.com/sources/amazon-redshift.md)
* Connect to [ClickHouse](https://docs.hightouch.com/sources/clickhouse.md)
* Connect to [Databricks](https://docs.hightouch.com/sources/databricks.md)
* Connect to [Elasticsearch](https://docs.hightouch.com/sources/elasticsearch)
* Connect to [Firebolt](https://docs.hightouch.com/sources/firebolt)
* Connect to [Google BigQuery](https://docs.hightouch.com/sources/google-bigquery.md)
* Connect to [Google Sheets](https://docs.hightouch.com/sources/google-sheets.md)
* Connect to [Looker](https://docs.hightouch.com/sources/looker)
* Connect to [Metabase](https://docs.hightouch.com/sources/metabase)
* Connect to [MySQL](https://docs.hightouch.com/sources/mysql.md)
* Connect to [PostgreSQL](https://docs.hightouch.com/sources/postgresql.md)
* Connect to [Rockset](https://docs.hightouch.com/sources/rockset)
* Connect to [SFTP](https://docs.hightouch.com/sources/sftp.md)
* Connect to [Snowflake](https://docs.hightouch.com/sources/snowflake.md)
* Connect to [SQL Server](https://docs.hightouch.com/sources/sqlserver.md)
* Connect to [Trino](https://docs.hightouch.com/sources/trino.md)

> [!NOTE]
>
> If you're missing the credentials necessary to connect to your data source,
> try inviting your teammates to Hightouch. You can have unlimited collaborators
> in your workspace.

#### Connect to a sample database instead

Waiting for credentials to your data warehouse? No problem. You can connect to one of our [sample datasets](https://docs.hightouch.com/sources/sample-data.md) to get started right away. For the rest of this tutorial, we'll use the **B2B SaaS** sample source, which contains a `users` table with names, emails, locations, and other user attributes. This sample source is available when you log in for the first time—no setup required.

### Create a model

### Create a sync

## Tips and troubleshooting

To see the exact API requests and responses from each sync run, use the [live debugger](https://docs.hightouch.com/syncs/debugger.md). To get notified by Slack, PagerDuty, SMS, or email when a sync fails, set up [sync alerts](https://docs.hightouch.com/syncs/alerting.md). If you run into an issue this page doesn't cover, [contact support](#pylon-chat).

## Common errors

### Don't see your data in Chargebee?

Make sure you've configured your sync to use the correct Chargebee environment. You might've accidentally pointed to a different environment, such as using test site instead of live site. If that doesn't solve your issue, [please reach out](#pylon-chat). We're happy to help.
