# Chargebee

Chargebee is a subscription billing and revenue management platform that handles recurring payments, invoicing, and operations for subscription businesses.

## Overview

Chargebee is the subscription billing and revenue management platform that lets you solve for your today, and scale for your tomorrow.

## Authentication

After adding a Chargebee connector, click to add a new authentication:
![new-chargebee-auth](https://tray.ai/documentation/images/connectors/service/chargebee/79fac8a4-88d3bc6c_new-chargebee-auth.png)
You will then be presented with the auth dialog:
![chargebee-auth-dialog](https://tray.ai/documentation/images/connectors/service/chargebee/79fac8a4-fc95db61_chargebee-auth-dialog.png)
When entering your domain be sure to **remove the 'https\://' prefix and the 'chargebee.com' suffix**.
So if your domain is <https://koreservices-test.chargebee.com> you should enter 'koreservices-test'
Your API key is obtained by going to **Configure Chargebee > API Keys and Webhooks** in the Chargebee admin UI:
![chargebee-api](https://tray.ai/documentation/images/connectors/service/chargebee/79fac8a4-aa5be744_chargebee-api.png)

## Setting up a Webhook

In Chargebee it is possible to set up a webhook in order to **automatically notify a Tray workflow when events occur** in Chargebee.
To do this, **create a new workflow** in Tray with a Webhook Trigger:
![chargebee-choose-webhook-trigger](https://tray.ai/documentation/images/connectors/service/chargebee/79fac8a4-0e4d5348_chargebee-choose-webhook-trigger.png)
In your workflow **click to enable it**.
Then go to **'Workflow settings'** in the top-left of the builder.
From here you can **copy the 'Workflow public URL'**:
![chargebee-copy-public-url](https://tray.ai/documentation/images/connectors/service/chargebee/79fac8a4-dab702c5_chargebee-copy-public-url.png)
And then **create a new Webhook in Chargebee** using the Workflow public URL:
![chargebee-create-webhook](https://tray.ai/documentation/images/connectors/service/chargebee/79fac8a4-de276a78_chargebee-create-webhook.png)
Note that you **can also choose which events to send**.
You can then **test your webhook URL**:
![chargebee-test-url](https://tray.ai/documentation/images/connectors/service/chargebee/79fac8a4-93f2282d_chargebee-test-url.png)
In your **Tray workflow debug panel** you will then see a test webhook payload coming through (don't forget your workflow needs to be enables otherwise it won't work!):
![chargebee-webhook-debug](https://tray.ai/documentation/images/connectors/service/chargebee/79fac8a4-865538b4_chargebee-webhook-debug.png)
From here you can then use **jsonpaths** such as `$.steps.trigger.body.content.customer.id` and `$.steps.trigger.body.content.customer.email` to grab individual pieces of data from the webhook and pass into other connectors.
For more information please see our [Intro to jsonpaths](https://tray.ai/documentation/platform/automation-integration/building-workflows/mapping-data/basic-data-concepts/) and [working with data and jsonpaths](https://tray.ai/documentation/platform/automation-integration/building-workflows/mapping-data/mapping-data-between-steps/)
