Skip to main content

Chargebee

This page contains the setup guide and reference information for the Chargebee source connector.

Prerequisites

To set up the Chargebee source connector, you will need a valid Chargebee API key and the Product Catalog version of the Chargebee site you are syncing data from.

info

All Chargebee sites created from May 5, 2021 onward will have Product Catalog 2.0 enabled by default. Sites created prior to this date will use Product Catalog 1.0.

Set up the Chargebee connector in Airbyte

  1. Log into your Airbyte Cloud account or navigate to the Airbyte Open Source dashboard.
  2. Click Sources and then click + New source.
  3. On the Set up the source page, select Chargebee from the Source type dropdown.
  4. Enter the name for the Chargebee connector.
  5. For Site, enter the site prefix for your Chargebee instance.
  6. For Start Date, enter the date in YYYY-MM-DDTHH:mm:ssZ format. The data added on and after this date will be replicated.
  7. For API Key, enter the Chargebee API key.
  8. For Product Catalog, enter the Chargebee Product Catalog version.
  9. Click Set up source.

Supported sync modes

The Chargebee source connector supports the following sync modes:

Supported streams

Most streams are supported regardless of your Chargebee site's Product Catalog version, with a few version-specific exceptions.

StreamProduct Catalog 1.0Product Catalog 2.0
Addons
Attached Items
Contacts
Coupons
Credit Notes
Customers
Events
Gifts
Hosted Pages
Invoices
Items
Item Prices
Orders
Payment Sources
Plans
Promotional Credits
Quotes
Quote Line Groups
Subscriptions
Transactions
Unbilled Charges
Virtual Bank Accounts
note

When using incremental sync mode, the Attached Items stream behaves differently than the other streams. Whereas other incremental streams read and output only new records, the Attached Items stream reads all records but only outputs new records, making it more demanding on your Chargebee API quota. Each sync incurs API calls equal to the total number of attached items in your Chargebee instance divided by 100, regardless of the actual number of Attached Items changed or synced.

Performance considerations

The Chargebee connector should not run into Chargebee API limitations under normal usage. Create an issue if you encounter any rate limit issues that are not automatically retried successfully.

Build instructions

Build your own connector image

This connector is built using our dynamic built process. The base image used to build it is defined within the metadata.yaml file under the connectorBuildOptions. The build logic is defined using Dagger here. It does not rely on a Dockerfile.

If you would like to patch our connector and build your own a simple approach would be:

  1. Create your own Dockerfile based on the latest version of the connector image.
FROM airbyte/source-chargebee:latest

COPY . ./airbyte/integration_code
RUN pip install ./airbyte/integration_code

# The entrypoint and default env vars are already set in the base image
# ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
# ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

Please use this as an example. This is not optimized.

  1. Build your image:
docker build -t airbyte/source-chargebee:dev .
# Running the spec command against your patched connector
docker run airbyte/source-chargebee:dev spec

Customizing our build process

When contributing on our connector you might need to customize the build process to add a system dependency or set an env var. You can customize our build process by adding a build_customization.py module to your connector. This module should contain a pre_connector_install and post_connector_install async function that will mutate the base image and the connector container respectively. It will be imported at runtime by our build process and the functions will be called if they exist.

Here is an example of a build_customization.py module:

from __future__ import annotations

from typing import TYPE_CHECKING

if TYPE_CHECKING:
# Feel free to check the dagger documentation for more information on the Container object and its methods.
# https://dagger-io.readthedocs.io/en/sdk-python-v0.6.4/
from dagger import Container


async def pre_connector_install(base_image_container: Container) -> Container:
return await base_image_container.with_env_variable("MY_PRE_BUILD_ENV_VAR", "my_pre_build_env_var_value")

async def post_connector_install(connector_container: Container) -> Container:
return await connector_container.with_env_variable("MY_POST_BUILD_ENV_VAR", "my_post_build_env_var_value")

Changelog

VersionDatePull RequestSubject
0.2.52023-10-1331377Use our base image and remove Dockerfile
0.2.42023-08-0128905Updated the connector to use latest CDK version
0.2.32023-03-2224370Ignore 404 errors for Contact stream
0.2.22023-02-1721688Migrate to CDK beta 0.29; fix schemas
0.2.12023-02-1723207Edited stream schemas to get rid of unnecessary enum
0.2.02023-01-2121688Migrate to YAML; add new streams
0.1.162022-10-0617661Make transaction stream to be consistent with S3 by using type transformer
0.1.152022-09-2817304Migrate to per-stream state.
0.1.142022-09-2317056Add "custom fields" to the relevant Chargebee source data streams
0.1.132022-08-1815743Fix transaction exchange_rate field type
0.1.122022-07-1314672Fix transaction sort by
0.1.112022-03-0310827Fix Credit Note stream
0.1.102022-03-0210795Add support for Credit Note stream
0.1.92022-022410312Add support for Transaction Stream
0.1.82022-02-2210366Fix broken coupon stream + add unit tests
0.1.72022-02-1410269Add support for Coupon stream
0.1.62022-02-1010143Add support for Event stream
0.1.52021-12-238434Update fields in source-connectors specifications
0.1.42021-09-276454Fix examples in spec file
0.1.32021-08-175421Add support for "Product Catalog 2.0" specific streams: Items, Item prices and Attached Items
0.1.22021-07-305067Prepare connector for publishing
0.1.12021-07-074539Add entrypoint and bump version for connector
0.1.02021-06-303410New Source: Chargebee