> ## Documentation Index
> Fetch the complete documentation index at: https://docs.m3ter.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Chargebee Functions

## Create Chargebee Charge Item

**Function name:** `CreateChargebeeChargeItemFunction`
**Category:** Write
**Destination:** Chargebee

Creates a charge item in Chargebee

### Parameters

| Name                            | Label                 | Required | Description                                                                           |
| ------------------------------- | --------------------- | :------: | ------------------------------------------------------------------------------------- |
| `integrationCredentialsId`      | Credentials           |    Yes   | Chargebee credentials to use.                                                         |
| `chargebeeInvoiceId`            | Chargebee invoice ID  |    Yes   | Name of the variable by which the Chargebee invoice ID should be retrieved from state |
| `lineItemId`                    | Line item id          |    Yes   | Name of the variable by which the line item ID should be retrieved from state         |
| `itemPrice`                     | Item price            |    Yes   | Name of the variable by which the item price should be retrieved from state           |
| `itemTiersRef`                  | Item tiers            |    No    | Name of the variable by which the item tiers should be retrieved from state           |
| `addExternalMapping`            | Add external mappings |    No    | Flag to decide if external mappings should be added. Defaults to true.                |
| `chargebeeInvoiceStateVariable` | Chargebee invoice     |    Yes   | Chargebee invoice passed to state                                                     |

### Exits

| Exit    | Description |
| ------- | ----------- |
| `NEXT`  | -           |
| `ERROR` | -           |

## Create Chargebee Invoice

**Function name:** `CreateChargebeeInvoiceFunction`
**Category:** Write
**Destination:** Chargebee

Creates an invoice in Chargebee

### Parameters

| Name                            | Label                 | Required | Description                                                                          |
| ------------------------------- | --------------------- | :------: | ------------------------------------------------------------------------------------ |
| `integrationCredentialsId`      | Credentials           |    Yes   | Chargebee credentials to use.                                                        |
| `m3terBillIdRef`                | m3ter bill id         |    Yes   | Name of the variable by which the m3ter bill id should be retrieved from state       |
| `accountId`                     | Account Id            |    Yes   | Name of the variable by which the account id should be retrieved from state          |
| `currencyCode`                  | Currency Code         |    Yes   | Name of the variable by which the currency code should be retrieved from state       |
| `itemPrices`                    | Initial item prices   |    Yes   | Name of the variable by which the initial item prices should be retrieved from state |
| `chargebeeInvoiceStateVariable` | Chargebee invoice     |    Yes   | Name of the variable by which the Chargebee invoice should be stored in state        |
| `addExternalMapping`            | Add external mappings |    No    | Flag to decide if external mappings should be added. Defaults to true.               |

### Exits

| Exit    | Description |
| ------- | ----------- |
| `NEXT`  | -           |
| `ERROR` | -           |

## Create Chargebee Promotional Credit

**Function name:** `CreateChargebeePromoCreditFunction`
**Category:** Write
**Destination:** Chargebee

Creates a promotional credit in Chargebee

### Parameters

| Name                       | Label                        | Required | Description                                                                        |
| -------------------------- | ---------------------------- | :------: | ---------------------------------------------------------------------------------- |
| `integrationCredentialsId` | Credentials                  |    Yes   | Chargebee credentials to use.                                                      |
| `accountId`                | Account Id                   |    Yes   | Name of the variable by which the account id should be retrieved from state        |
| `lineItemId`               | Line Item Id                 |    Yes   | Name of the variable by which the line item id should be retrieved from state      |
| `amount`                   | Amount                       |    Yes   | Name of the variable by which the amount should be retrieved from state            |
| `amountInDecimal`          | Amount in Decimal            |    No    | Name of the variable by which the amount in decimal should be retrieved from state |
| `currencyCode`             | Currency Code                |    Yes   | Currency code for the promotional credit                                           |
| `promoCreditDescription`   | Description                  |    Yes   | Description of the promotional credit                                              |
| `addExternalMapping`       | Add external mappings        |    No    | Flag to decide if external mappings should be added. Defaults to true.             |
| `promoCreditStateVariable` | Promotional credit reference |    Yes   | Name of the variable by which the promotional credit should be stored in state     |

### Exits

| Exit    | Description |
| ------- | ----------- |
| `NEXT`  | -           |
| `ERROR` | -           |

## Update Chargebee Promotional Credit

**Function name:** `UpdateChargebeePromoCreditFunction`
**Category:** Write
**Destination:** Chargebee

Update a Promotional Credit in Chargebee

### Parameters

| Name                             | Label                 | Required | Description                                                                            |
| -------------------------------- | --------------------- | :------: | -------------------------------------------------------------------------------------- |
| `integrationCredentialsId`       | Credentials           |    Yes   | Chargebee credentials to use.                                                          |
| `promotionalCreditId`            | Promotional credit ID |    Yes   | Name of the variable by which the promotional credit ID should be retrieved from state |
| `amount`                         | Amount                |    Yes   | Name of the variable by which the amount should be retrieved from state                |
| `amountInDecimal`                | Amount in Decimal     |    No    | Name of the variable by which the amount in decimal should be retrieved from state     |
| `promotionalCreditStateVariable` | Promotional credit    |    No    | Name of the variable by which the updated promotional credit should be stored in state |

### Exits

| Exit    | Description |
| ------- | ----------- |
| `NEXT`  | -           |
| `ERROR` | -           |
