Skip to main content

Data Source

Follow the instructions below to create a new data flow that ingests data from a Chargebee source in Nexla.
chargebee_api.png

Chargebee

Create a New Data Flow

  1. To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Then, select the desired flow type from the list, and click the Create button.

  2. Select the Chargebee connector tile from the list of available connectors. Then, select the credential that will be used to connect to the Chargebee instance, and click Next; or, create a new Chargebee credential for use in this flow.

  3. In Nexla, Chargebee data sources can be created using pre-built endpoint templates, which expedite source setup for common Chargebee endpoints. Each template is designed specifically for the corresponding Chargebee endpoint, making source configuration easy and efficient.
    • To configure this source using a template, follow the instructions in Configure Using a Template.

    Chargebee sources can also be configured manually, allowing you to ingest data from Chargebee endpoints not included in the pre-built templates or apply further customizations to exactly suit your needs.
    • To configure this source manually, follow the instructions in Configure Manually.

Configure Using a Template

Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common Chargebee endpoints. Each template is designed specifically for the corresponding Chargebee endpoint, making data source setup easy and efficient.

Endpoint Settings

  • Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below. Click on an endpoint to see more information about it and how to configure your data source for this endpoint.

    List all

    This endpoint fetches a list of all records of a selected resource. Use this endpoint when you need to retrieve all customers, subscriptions, invoices, quotes, orders, events, or transactions from your Chargebee account.

    • Select the resource type you want to retrieve from the Resource Name dropdown menu. Available options include:

      • customers: Retrieves a list of customers added to your Chargebee site
      • subscriptions: Retrieves a list of subscriptions
      • invoices: Lists all the invoices
      • quotes: Lists all quotes
      • orders: Retrieves a list of all the available orders
      • events: Retrieves a list of events
      • transactions: Lists all the transactions

      You can also add custom resource types if needed. The default value is customers if not specified.

    • The endpoint uses GET requests to https://{site}.chargebee.com/api/v2/{resource_name}?limit=100 where {site} is your Chargebee site identifier from the credential configuration and {resource_name} is the selected resource type. The endpoint URL is automatically constructed based on your credential's site configuration and the selected resource type.
    • The endpoint uses token-based pagination, automatically fetching additional pages as needed using the offset query parameter. When a response includes a next_offset value, Nexla automatically uses it as the offset parameter in the subsequent request to fetch the next page of results.
    • The endpoint will return all records of the selected resource type. The response data is extracted from the list array in the API response ($.list[*]), with each record processed individually.

    This endpoint supports pagination through the offset token mechanism. When a response includes a next_offset value, Nexla automatically uses it as the offset parameter in the subsequent request to fetch the next page of results. The endpoint uses token-based pagination (iteration.type: paging.next.token) through the offset mechanism. The response data path is $.list[*], which extracts all items from the list array in the API response. The endpoint limits results to 100 items per request. You can add custom resource types if needed. For detailed information about listing resources, see the Chargebee API documentation.

    Retrieve resource details

    This endpoint retrieves the details of a specific resource by its ID. Use this endpoint when you need to retrieve detailed information about a specific customer, subscription, invoice, order, event, transaction, or quote.

    • Select the resource type you want to retrieve from the Resource Name dropdown menu. Available options include:

      • customers: Retrieves the details of a specific customer
      • subscriptions: Retrieves the details of a specific subscription
      • invoices: Retrieves the details of a specific invoice
      • orders: Retrieves the details of a specific order
      • events: Retrieves the details of a specific event
      • transactions: Retrieves the details of a specific transaction
      • quotes: Retrieves the details of a specific quote

      You can also add custom resource types if needed. The default value is customers if not specified.

    • Enter the unique identifier for the resource you want to retrieve in the Resource ID field. This is the ID of the specific resource (e.g., customer ID, subscription ID, invoice ID) for which you want to retrieve details.

    • The endpoint uses GET requests to https://{site}.chargebee.com/api/v2/{resource_name}/{resource_id} where {site} is your Chargebee site identifier, {resource_name} is the selected resource type, and {resource_id} is the resource ID you provide. The endpoint URL is automatically constructed based on your credential's site configuration and the provided parameters.
    • The endpoint does not use pagination and returns the complete resource details in a single request.
    • The endpoint will return detailed information for the specified resource. The response data is extracted from the root-level object in the API response ($), and Nexla will process the entire response structure.

    Resource IDs can be obtained from the "List all" data source endpoint by selecting the appropriate resource type, which returns all resources with their corresponding IDs. The endpoint uses a static URL (iteration.type: static.url) and does not require pagination. The response data path is $, which extracts the entire root-level object from the API response. You can add custom resource types if needed. For detailed information about retrieving resource details, see the Chargebee API documentation.

    List all - Incremental Sync of resources

    This endpoint fetches updated or modified records of a selected resource for incremental synchronization. Use this endpoint when you need to retrieve only the resources that have been updated within a specific time range, which is useful for incremental data synchronization.

    • Select the resource type you want to retrieve from the Resource Name dropdown menu. Available options include:

      • customers: Retrieves updated customers
      • subscriptions: Retrieves updated subscriptions
      • invoices: Retrieves updated invoices
      • quotes: Retrieves updated quotes
      • orders: Retrieves updated orders
      • events: Retrieves updated events
      • transactions: Retrieves updated transactions

      You can also add custom resource types if needed.

    • Enter the start date for the update range in the Updated Date [After] field. This should be a date in Unix timestamp format (seconds since epoch). Only resources updated after this date will be retrieved.

    • Enter the end date for the update range in the Updated Date [Before] field. This should be a date in Unix timestamp format (seconds since epoch). Only resources updated before this date will be retrieved.

    • Enter the sort order in the Sort By field. This determines how the results are sorted. Common values include updated_at[asc] or updated_at[desc].

    • The endpoint uses GET requests to https://{site}.chargebee.com/api/v2/{resource_name}?limit=100&updated_at[after]={updated_after}&updated_at[before]={updated_before}&{sort_by} where {site} is your Chargebee site identifier, {resource_name} is the selected resource type, and the date and sort parameters are provided. The endpoint URL is automatically constructed based on your credential's site configuration and the provided parameters.
    • The endpoint uses token-based pagination, automatically fetching additional pages as needed using the offset query parameter. When a response includes a next_offset value, Nexla automatically uses it as the offset parameter in the subsequent request to fetch the next page of results.
    • The endpoint will return all records of the selected resource type that were updated within the specified date range. The response data is extracted from the list array in the API response ($.list[*]), with each record processed individually.

    This endpoint is designed for incremental synchronization, allowing you to retrieve only resources that have been updated within a specific time range. The date parameters should be in Unix timestamp format (seconds since epoch). This endpoint supports pagination through the offset token mechanism. When a response includes a next_offset value, Nexla automatically uses it as the offset parameter in the subsequent request to fetch the next page of results. The endpoint uses token-based pagination (iteration.type: paging.next.token) through the offset mechanism. The response data path is $.list[*], which extracts all items from the list array in the API response. The endpoint limits results to 100 items per request. You can add custom resource types if needed. For detailed information about incremental synchronization, see the Chargebee API documentation.

Endpoint Testing

Once the selected endpoint template has been configured, Nexla can retrieve a sample of the data that will be fetched according to the current settings. This allows users to verify that the source is configured correctly before saving.

  • To test the current endpoint configuration, click the Test button to the right of the endpoint selection menu. Sample data will be fetched & displayed in the Endpoint Test Result panel on the right.

  • If the sample data is not as expected, review the selected endpoint and associated settings, and make any necessary adjustments. Then, click the Test button again, and check the sample data to ensure that the correct information is displayed.

Configure Manually

Chargebee data sources can be manually configured to ingest data from any valid Chargebee API v2 endpoint. Manual configuration provides maximum flexibility for accessing endpoints not covered by pre-built templates or when you need custom API configurations.

With manual configuration, you can also create more complex Chargebee sources, such as sources that use chained API calls to fetch data from multiple endpoints or sources that require custom authentication headers or request parameters.

API Method

  1. To manually configure this source, select the Advanced tab at the top of the configuration screen.

  2. Select the API method that will be used for calls to the Chargebee API from the Method pulldown menu. The most common methods are:

    • GET: For retrieving data from the API
    • POST: For sending data to the API or triggering actions
    • PUT: For updating existing data
    • PATCH: For partial updates to existing data
    • DELETE: For removing data

API Endpoint URL

  1. Enter the URL of the Chargebee API endpoint from which this source will fetch data in the Set API URL field. This should be the complete URL including the protocol (https://) and any required path parameters. Chargebee API endpoints typically follow the pattern https://{site}.chargebee.com/api/v2/{endpoint_path} where {site} is your Chargebee site identifier.

Ensure the API endpoint URL is correct and accessible with your current credentials. You can test the endpoint using the Test button after configuring the URL. The endpoint requires Basic Authentication with your API key as the username, which is handled automatically by your credential configuration. For detailed information about Chargebee API endpoints and available APIs, see the Chargebee API documentation.

Path to Data

  1. Enter the JSON path that identifies the location of the relevant data within the API response in the Path to Data field. JSON paths use dot notation to navigate through nested JSON structures.

    • For example, if your API response has the structure {"list": [...]}, you would enter $.list[*] to extract all items from the list array.
    • Use $[*] to extract all items from a root-level array.
    • Use $ to extract the entire root-level object.

JSON paths are case-sensitive and must match the exact structure of your API response. Chargebee API responses typically use a list array to contain the actual data for list endpoints, or a root-level object for single resource endpoints. Use the Test button to verify that your JSON path correctly extracts the desired data from the API response.

Save the Data Source

  1. Once all configuration steps have been completed, click the Save button to save your data source configuration.

  2. The data source will now be available in your data flow and will begin ingesting data according to the configured schedule and endpoint settings.