# Chargebee

### Snapshot

| Features                        | Details                                            |
| ------------------------------- | -------------------------------------------------- |
| Release Status                  | Released                                           |
| Source API Version              | v2                                                 |
| Table Selection                 | Yes                                                |
| Column Selection                | Yes                                                |
| Edit Integration                | Yes                                                |
| Replication Type Selection      | No                                                 |
| Authentication Parameters       | <p>Chargebee API Key<br>Site Name on ChargeBee</p> |
| Replication Type                | Key Based Replication                              |
| Replication Key                 | Date                                               |
| Suggested Replication Frequency | 24 hrs                                             |

| Tables/APIs Supported |              |
| --------------------- | ------------ |
| Customers             | Subscription |

### Pre-requisites

1. Generate Chargebee API Key for Daton
2. Read more on How to create Chargebee API Keys [here](https://docs.sarasanalytics.com/source-api-keys/chargebee-api-keys)

### Integrate ChargeBee with Daton

1. Signin to Daton&#x20;
2. Select ChargeBee from Integrations page
3. Provide Integration Name, Replication Frequency, and History. Integration name would be used in creating tables for the integration and cannot be changed later&#x20;
4. Provide API Key and Site Name to authorize Daton to periodically extract data from ChargeBee
5. Post successful authentication, you will be prompted to choose from the list of available tables
6. Then select all required fields for each table
7. Submit the integration

### Workflow

1. Integrations would be in Pending state initially and will be moved to Active state as soon as the first job loads data successfully on to the configured warehouse
2. Users would be able to edit/pause/re-activate/delete integration anytime
3. Users can view job status and process logs from the integration details page by clicking on the integration name from the active list

### ChargeBee Data

**Customers**

Purpose: Retrieve details of a customer subscriptions, card and billing address.

Source API Documentation  <https://apidocs.chargebee.com/docs/api/customers>

Replication: Key-Based Replication

Replication Key: createdAt

**Fields**

| Name                 | Target Datatype |
| -------------------- | --------------- |
| id                   | STRING          |
| email                | STRING          |
| auto\_collection     | STRING          |
| net\_term\_days      | INTEGER         |
| allow\_direct\_debit | BOOLEAN         |
| created\_at          | INTEGER         |
| taxability           | STRING          |
| updated\_at          | INTEGER         |
| pii\_cleared         | STRING          |
| resource\_version    | NUMERIC         |
| vatNumberStatus      | STRING          |
| deleted              | BOOLEAN         |
| object               | STRING          |
| card\_status         | STRING          |
| contacts             | RECORD          |

**Subscription**

Purpose: Retrieve details of subcription and billing close date or payment due date

Source API Documentation  <https://apidocs.chargebee.com/docs/api/subscriptions>

Replication: Key-Based Replication

Replication Key: createdAt

**Fields**

| Name                    | Target Datatype |
| ----------------------- | --------------- |
| id                      | STRING          |
| customer\_id            | STRING          |
| plan\_id                | STRING          |
| plan\_quantity          | NUMERIC         |
| plan\_unit\_price       | NUMERIC         |
| plan\_amount            | NUMERIC         |
| billing\_period         | INTEGER         |
| billing\_period\_unit   | STRING          |
| plan\_free\_quantity    | INTEGER         |
| status                  | STRING          |
| trial\_start            | NUMERIC         |
| trial\_end              | NUMERIC         |
| next\_billing\_at       | NUMERIC         |
| created\_at             | NUMERIC         |
| started\_at             | NUMERIC         |
| updated\_at             | NUMERIC         |
| has\_scheduled\_changes | BOOLEAN         |
| resource\_version       | NUMERIC         |
| deleted                 | BOOLEAN         |
| currency\_code          | STRING          |
| object                  | STRING          |
| due\_invoices\_count    | NUMERIC         |
