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

# Connecting Chargebee to Neo

> Create a Chargebee API key, save it in Neo with your site name, and decide what each agent can do

You connect Chargebee once at the MSP level, then turn it on per agent. You need two values: your Chargebee **site name** and an **API key** of that site.

## 1. Find your site name

Your site name is the part before `.chargebee.com` in the address you sign in to: `acme` for `https://acme.chargebee.com`. A test site is a separate site whose name ends in `-test` (`acme-test`), with its own keys.

## 2. Create an API key

**1. Open API keys**

Sign in to Chargebee as an admin and go to **Settings** → **Configure Chargebee** → **API Keys and Webhooks**, then the **API Keys** tab.

**2. Add the key**

Click **Add API Key** and choose the type:

* **Full-Access Key** lets agents read and, where you allow it, change billing records.
* **Read-Only Key** is enough to answer billing questions and report on invoices. With it, every write fails at Chargebee whatever the agent's settings say.

Name it so your team recognizes it, for example "Neo Agent". Chargebee writes this name on every event a write makes, so your event log shows which changes came from Neo.

**3. Copy the key**

Copy the key. A Publishable key cannot read customers, so Neo refuses it.

## 3. Save the key in Neo

**1. Open Integrations**

In the Neo Dashboard, open [**Integrations** → **Chargebee**](https://dashboard.neoagent.io/integrations?open=chargebee), under Accounting.

**2. Enter the values**

Enter the **Site name** (you can also paste your Chargebee address) and the **API key**, then click **Save**.

Neo reads your customer list with these values before it saves. A wrong key, a site name Chargebee does not know, or a Publishable key is refused on the spot, with the reason.

**3. Confirm the company matches**

After the save, Neo matches your Chargebee customers to your PSA companies. This usually takes under a minute. Open the card's [**Organization Mapping**](https://dashboard.neoagent.io/integrations?open=chargebee\&subtab=org-mapping\&mapping=to_confirm) tab on the **To confirm** filter, tick the matches that are right and click **Confirm**. Agents do not use a suggested match until you confirm it. The Chargebee card on the Integrations page shows how many matches wait. [Company Mapping](https://docs.neoagent.io/product/company-mapping.md#on-the-integrations-organization-mapping-tab) describes the rest of the tab.

## 4. Turn Chargebee on per agent

Each agent decides whether it uses Chargebee and which areas it can touch. Open the agent, go to its **Tools & Settings** tab, click **Accounting**, and expand the **Chargebee** block.

### Pick a preset

> [card] Read Only
>
> Every area read only except Billing Emails and Payment Methods, which stay off. The agent reads customers, subscriptions, invoices, payments and the catalog, previews changes, and never changes anything.

> [card] Helpdesk
>
> Customers & Contacts, Invoices, Credit Notes & Quotes, Billing Emails, and Checkout & Payment Links read and write, each change with technician approval. Every other area read only, and Payment Methods off.

> [card] IT Admin
>
> Every area read and write. Customers, subscriptions, invoices and payment links change on their own; payments and refunds, payment methods, billing emails, the catalog and site settings wait on a technician.

> [card] Full Automation
>
> Every supported write runs with no approval, payments, refunds and payment methods included. Deleting a customer, clearing its personal data, merging two customers, and creating or changing a webhook endpoint still wait on a technician.

### Or set each area by hand

| Area | Notes |
| - | - |
| **Customers & Contacts** | Customers with their contacts, billing address, billing date, account hierarchy, balances and notes. |
| **Subscriptions & Usage** | Subscriptions and their items, scheduled changes, contract terms, discounts, ramps, usage, alerts, credit ledgers and gifts. A quantity change or cancellation bills the client, so consider approval here if your clients' contracts need sign-off. |
| **Invoices, Credit Notes & Quotes** | Invoices, credit notes, quotes, estimates, orders, unbilled charges and payment schedules, with their PDF links. Read Only is enough to report on invoices and to preview a change. |
| **Billing Emails** | Sending a client an invoice, credit note, e-invoice or payment request, and any change to an email address or to who gets billing emails. A changed billing email sends the client's invoices there from then on, so consider approval here. Disabled or Read and Write only. |
| **Payments & Credits** | Transactions, collecting and recording payments, refunds, applying credits, promotional credits, disputes and payment promises. These move money, so consider approval here. |
| **Payment Methods** | Cards, bank accounts and other payment sources. Also needed beside the record's own area for any write that sets one. |
| **Product Catalog & Coupons** | Items, prices, plans and add-ons, features, currencies and coupons. A change applies to every customer, so consider approval here. |
| **Checkout & Payment Links** | Chargebee's hosted pages: a link for a client to pay what they owe, update their card, or check out a plan. |
| **Site Settings & Events** | Site configuration, business entities, business rules, custom fields, webhook endpoints, the event log and the test site's time machine. |

Each area takes **Disabled**, **Read Only** or **Read and Write**.

## Safety controls

* **You set the approvals.** Each area has its own approval setting, so an agent can change a quantity on its own, or ask a technician first.
* **Always asks.** Deleting a customer, clearing a customer's personal data, merging two customers, and creating or changing a webhook endpoint (which sends every event of your site to its address) always wait on a technician, whatever the area's setting.
* **No card numbers.** Neo never sends a full card number or security code; a client enters a card on Chargebee's hosted page.
* **Collecting or refunding needs Payments & Credits.** Turning on automatic collection for a customer or subscription, or a subscription resume or cancellation that asks Chargebee to collect unpaid invoices or refund credits, needs Payments & Credits as well, and asks when either area does.
* **Billing emails are their own area.** A write that sets an email address needs Billing Emails as well as its own area, and asks a technician when either area does.
* **Payment methods are their own area.** A write that sets a card, a bank account or a payment token needs Payment Methods as well as its own area, and asks a technician when either area does.
* **Only documented operations.** Neo sends only the operations in Chargebee's published API definitions, and refuses any other.
* **Never sent.** Exports (a download link to your whole site's data), customer portal sign-in links, and the test site's **Start afresh**, which deletes its data.

## If Chargebee refuses Neo's requests

| What comes back | Cause | Fix |
| - | - | - |
| `401` | The key was deleted or disabled | Create a new key and save it in Neo. |
| `403` | The key may not do this: a Read-Only key cannot write | Save a Full-Access key if agents should write. |
| `404` on a catalog path | Your site runs the other product catalog version | Nothing to change: the agent reads `configurations` and uses the right paths. |
| `429` | Too many requests: Chargebee's Starter plan allows 150 a minute per site, shared with your other integrations | Wait, then try again. |

## Disconnecting Chargebee

**1. Open the integration**

In the Neo Dashboard, open **Integrations** and select the Chargebee card.

**2. Disconnect**

Click **Disconnect** and confirm. Neo removes the key from Key Vault. To revoke it at Chargebee as well, delete it under **API Keys and Webhooks**.

Neo keeps your Organization Mapping, including any mapping you set by hand, so a later reconnect continues from the same state. Agents that use Chargebee stop working until you connect it again.

## Security

* The API key is stored in Azure Key Vault, never in plaintext.
* All traffic to Chargebee goes over HTTPS, to your site's own `chargebee.com` hosts only.
* Write access is opt-in per agent.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.