# Integrating with Chargebee

[Prerequisites](#prerequisites)

[Chargebee Setup](#chargebee-setup)\
&#x20;  [Create an API key](#create-an-api-key)\
&#x20;  [Find Subdomain](#find-subdomain)

### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

To connect Chargebee to Drivetrain, you need:

* An active Chargebee account
* Admin privileges on Chargebee

### Chargebee Setup <a href="#chargebee-setup" id="chargebee-setup"></a>

#### Create an API key <a href="#create-an-api-key" id="create-an-api-key"></a>

1. Login to your [Chargebee account](https://app.chargebee.com/login)
2. Navigate to **Settings > Configure Chargebee**

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2FAtCaMMYadV9C6O1HNyB6%2FChargebee-1.png?alt=media&#x26;token=2d5eca7b-565b-4c79-af3c-abb1e0a09137" alt=""><figcaption></figcaption></figure>

3. Scroll down to the **API Keys and Webhooks** section and Click **API Keys** tab

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fo8WhSSI81apleuEVYw0N%2FChargebee-2.png?alt=media&#x26;token=b1fec313-d69c-4c2a-979b-e243a7782f60" alt=""><figcaption></figcaption></figure>

4. Click **Add API Key** to create a new API key

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2FU1H4utKKIvGMCWYaK2uy%2FChargebee-3.png?alt=media&#x26;token=3d897b79-3b38-43a8-a698-584971a086cb" alt=""><figcaption></figcaption></figure>

5. Select **Read-only Key**.
6. Select **All** and enter name as "**Drivetrain Integration**" for the API key, then click **Create Key**.

<figure><img src="https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fxg5QWtUGqV3v5w2cBrbX%2FChargebee-4.png?alt=media&#x26;token=443b5aa3-2931-4bcf-a3fd-9dfbaa895f91" alt=""><figcaption></figcaption></figure>

7. Find the API key you just created on the next page and make a note of it in a secure document

#### Find Subdomain <a href="#find-subdomain" id="find-subdomain"></a>

Find your account's subdomain in your Chargebee URL and make a note of it. For example, if your Chargebee URL is `https://drivetrain-test.chargebee.com`, then your subdomain is `drivetrain-test`.

{% hint style="info" %}
That’s it! Share the API key and Subdomain with your customer success manager or data integrations manager so that they can get started!
{% endhint %}
