# 4.7.1 Chargebee Configuration

**NOTE:** These steps are only for the SAAS Extended versions

<figure><img src="https://756612007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAZK2jZ3mL4ir3caZa0b%2Fuploads%2FK8xlRsSLBwcGSOA4tUxu%2Fimage34.png?alt=media&#x26;token=a2452a75-7353-4608-8129-7336cee40f61" alt=""><figcaption></figcaption></figure>

1. Go to [***https://www.chargebee.com/trial-signup/***](https://www.chargebee.com/trial-signup/) and create a new account in Chargebee and verify your email address.
2. After that, you can add your domain name in the <mark style="color:red;">**CHARGEBEE\_SITE**</mark> in the form field

<figure><img src="https://756612007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAZK2jZ3mL4ir3caZa0b%2Fuploads%2FsCl7HjSxLiwHuA4lZLgV%2Fimage170.png?alt=media&#x26;token=dc04942c-c3f5-45ee-9553-527193dfbd40" alt=""><figcaption></figcaption></figure>

3. Then click on settings - configure Chargebee - then click on API-Keys as shown in the below image.

<figure><img src="https://756612007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAZK2jZ3mL4ir3caZa0b%2Fuploads%2FmfotWpzvgqAm8Fmmt9Pr%2F4.6.1_3.png?alt=media&#x26;token=90560088-bdba-43dd-ae9c-4a3bf09dfaee" alt=""><figcaption></figcaption></figure>

4. Then in the form field add <mark style="color:red;">**CHARGEBEE\_API\_KEY**</mark> and <mark style="color:red;">**CHARGEBEE\_PUBLISH\_KEY**</mark> as shown in the image below.

<figure><img src="https://756612007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAZK2jZ3mL4ir3caZa0b%2Fuploads%2ForBPlgjLJeMoybL0iCc2%2F4.6.1_4.png?alt=media&#x26;token=326edc5b-5305-49a4-a8de-d428aca30751" alt=""><figcaption></figcaption></figure>

### 4.7.1.1 Set Webhooks

1. After setting the API key,  click on Webhooks and create the Webhook button in the configure Chargebee tab as shown in the image below.

<figure><img src="https://756612007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAZK2jZ3mL4ir3caZa0b%2Fuploads%2FdabP9xqM04lCl8tknvQI%2F4.6.1.1.png?alt=media&#x26;token=361d0ea1-3496-47ab-b12e-e6d5cef5003b" alt=""><figcaption></figcaption></figure>

2. In open dialog box add the Webhook name anything. Then in the Webhook URL add like '<mark style="color:red;">**{{your\_domain}}/api/v2/webhook2'**</mark>. In Event Send Select All Events and then click on create to create a Webhook.

<figure><img src="https://756612007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAZK2jZ3mL4ir3caZa0b%2Fuploads%2FwYIGRtdpQU5ObMZg8IDq%2F4.6.1.1_2.png?alt=media&#x26;token=fdf5a73d-2d38-4737-9044-a642eaa1205c" alt=""><figcaption></figcaption></figure>

### 4.7.1.2 Set Currency

1. Click on settings - configure Chargebee - currencies as shown in the below image.

<figure><img src="https://756612007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAZK2jZ3mL4ir3caZa0b%2Fuploads%2FiaXsTK3WLl9lWqro1ODD%2F4.6.1.2.png?alt=media&#x26;token=e189d63b-128c-41f4-a6b9-4b8b6dae4017" alt=""><figcaption></figcaption></figure>

2. Click on Add Currencies button

<figure><img src="https://756612007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAZK2jZ3mL4ir3caZa0b%2Fuploads%2FAppbpBzIPzDTkVG2ysme%2F4.6.1.2_2.png?alt=media&#x26;token=d597c8c7-9219-469e-9e7d-adf7c251cefa" alt=""><figcaption></figcaption></figure>

3. After that select '**USD**' in currency and then click '**I’ll let Chargebee set it for me**' option and then click on **Add Currency** button.

<figure><img src="https://756612007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAZK2jZ3mL4ir3caZa0b%2Fuploads%2FCVxOeroN8GP0y2p0mJeE%2FUSD%20CURR.png?alt=media&#x26;token=ef86d74d-1530-43c5-86c3-2ea3ba0c85c6" alt=""><figcaption></figcaption></figure>

### 4.7.1.3 Set Payment Gateway

1. For set Payment GateWay Click on setting - Payment Gateways as shown in below image. Then Set your payment gateway as per your requirement. You can refer this doc for set payment gateway [***https://www.chargebee.com/docs/2.0/gateway\_settings.html***](https://www.chargebee.com/docs/2.0/gateway_settings.html)

<figure><img src="https://756612007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAZK2jZ3mL4ir3caZa0b%2Fuploads%2FmHp6NPVSRnbg4bb9SR0c%2F4.6.1.3.png?alt=media&#x26;token=d178a103-2a0e-425c-b79d-b996130a974a" alt=""><figcaption></figcaption></figure>

### 4.7.1.4 Set Custom Field

1. For set custom field click on setting - configure Chargebee - Custom fields as shown in the image below.

<figure><img src="https://756612007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAZK2jZ3mL4ir3caZa0b%2Fuploads%2F3xbYHL7kcKiRvzACGmiC%2FSET%20CUSTOM%20FIELDS.png?alt=media&#x26;token=eb9519dd-7fe4-43ad-8269-71cae4922f95" alt=""><figcaption></figcaption></figure>

2. Then click on customer and single-line text as shown in below image

<figure><img src="https://756612007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAZK2jZ3mL4ir3caZa0b%2Fuploads%2FkyFRXWYsoqhsaCJztvau%2F4.6.1.4_2.png?alt=media&#x26;token=7abc68c8-9ae5-4743-b7b6-772903e10079" alt=""><figcaption></figcaption></figure>

3. Then add '**Alianhub email**' and click on the create & save button as shown in the image.

<figure><img src="https://756612007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAZK2jZ3mL4ir3caZa0b%2Fuploads%2FgOcdysaOJYVX1pLsbFY4%2F4.6.1.4%20_3.png?alt=media&#x26;token=138ed774-23b4-449e-8576-542e3150f04b" alt=""><figcaption></figcaption></figure>

4. Refer to the provided table for what should be the value to be added in the custom fields.

| Field Label         | API Name                |
| ------------------- | ----------------------- |
| domain link         | cf\_domain\_link        |
| customer\_Mongo\_id | cf\_customer\_Mongo\_id |
| Alianhub email      | cf\_alianhub\_email     |
| Company id          | cf\_company\_id         |
| GSTIN               | cf\_gstin               |
| Selected Plan       | cf\_selected\_plan      |

5. Now follow the same steps and create an custom field for '**domain link'**, '**Company id**', '**GSTIN**', '**customer\_Mongo\_id**' after create all custom field it looks like below image.

<figure><img src="https://756612007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAZK2jZ3mL4ir3caZa0b%2Fuploads%2F8g8HEMhbUI2QqSw8sHMq%2F4.png?alt=media&#x26;token=9ee7e80e-be70-4a5e-b7ca-96d3d0edd451" alt=""><figcaption></figcaption></figure>

6. After that click Subscription Tab and click on single-line text as shown in below image

<div align="center"><figure><img src="https://756612007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAZK2jZ3mL4ir3caZa0b%2Fuploads%2F5mfmdqlpG0HjbMN2XntL%2F4.6.1.4_6.png?alt=media&#x26;token=c7f20102-04bd-4bf7-969a-7a9abc0d9360" alt=""><figcaption></figcaption></figure></div>

7. Now add a custom field for '**Company id**' and **'Selected Plan**'. After create both custom field it looks like below image.

<figure><img src="https://756612007-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FfAZK2jZ3mL4ir3caZa0b%2Fuploads%2FLbX6sunqLfqiSvzPcnLR%2F6.png?alt=media&#x26;token=e055a45c-23b5-4313-9e55-8c42b4a55470" alt=""><figcaption></figcaption></figure>
