# Chargebee

Manage Chargebee billing: subscriptions, customers, invoices, plans, payments. Exposes **42 actions** covering the full API surface
the agent needs - read and write.

## What it can do

| Method | What it does |
| --- | --- |
| `chargebee_customers_list` | List customers - GET /customers. |
| `chargebee_customer_get` | Get one customer - GET /customers/&#123;customer_id&#125;. |
| `chargebee_customer_create` | Create a customer - POST /customers. |
| `chargebee_customer_update` | Update a customer - POST /customers/&#123;customer_id&#125;. |
| `chargebee_customer_delete` | Delete a customer - DELETE /customers/&#123;customer_id&#125;. |
| `chargebee_subscriptions_list` | List subscriptions - GET /subscriptions. |
| `chargebee_subscription_get` | Get one subscription - GET /subscriptions/&#123;subscription_id&#125;. |
| `chargebee_subscription_create` | Create a subscription - POST /subscriptions. |
| `chargebee_subscription_update` | Update a subscription - POST /subscriptions/&#123;subscription_id&#125;. |
| `chargebee_subscription_cancel` | Cancel a subscription - DELETE /subscriptions/&#123;subscription_id&#125;. |
| `chargebee_subscription_resume` | Resume a paused subscription - POST /subscriptions/&#123;subscription_id&#125;/resume. |
| `chargebee_subscription_pause` | Pause a subscription - POST /subscriptions/&#123;subscription_id&#125;/pause. |
| `chargebee_invoices_list` | List invoices - GET /invoices. |
| `chargebee_invoice_get` | Get one invoice - GET /invoices/&#123;invoice_id&#125;. |
| `chargebee_invoice_create` | Create an invoice - POST /invoices. |
| `chargebee_invoice_update` | Update an invoice - POST /invoices/&#123;invoice_id&#125;. |
| `chargebee_invoice_void` | Void an invoice - POST /invoices/&#123;invoice_id&#125;/void. |
| `chargebee_invoice_pdf` | Generate a PDF of an invoice - GET /invoices/&#123;invoice_id&#125;/pdf. |
| `chargebee_items_list` | List items (plans, add-ons, charges) - GET /items. |
| `chargebee_item_get` | Get one item (plan, add-on, or charge) - GET /items/&#123;item_id&#125;. |
| `chargebee_item_create` | Create an item - POST /items. |
| `chargebee_item_update` | Update an item - POST /items/&#123;item_id&#125;. |
| `chargebee_payments_list` | List payments - GET /payments. |
| `chargebee_payment_get` | Get one payment - GET /payments/&#123;payment_id&#125;. |
| `chargebee_payment_create` | Create a payment - POST /payments. |
| `chargebee_payment_refund` | Refund a payment - POST /payments/&#123;payment_id&#125;/refund. |
| `chargebee_credit_notes_list` | List credit notes - GET /credit_notes. |
| `chargebee_credit_note_get` | Get one credit note - GET /credit_notes/&#123;credit_note_id&#125;. |
| `chargebee_credit_note_create` | Create a credit note - POST /credit_notes. |
| `chargebee_coupons_list` | List coupons - GET /coupons. |
| `chargebee_coupon_get` | Get one coupon - GET /coupons/&#123;coupon_code&#125;. |
| `chargebee_coupon_create` | Create a coupon - POST /coupons. |
| `chargebee_coupon_apply` | Apply a coupon to a customer or subscription - POST /coupons/&#123;coupon_code&#125;/apply. |
| `chargebee_estimate_renewal` | Get a renewal estimate for a subscription - GET /subscriptions/&#123;subscription_id&#125;/estimate_renewal. |
| `chargebee_estimate_upgrade` | Get an upgrade estimate - POST /subscriptions/&#123;subscription_id&#125;/estimate_upgrade. |
| `chargebee_orders_list` | List orders (one-off charges) - GET /orders. |
| `chargebee_order_get` | Get one order - GET /orders/&#123;order_id&#125;. |
| `chargebee_order_create` | Create an order - POST /orders. |
| `chargebee_additional_charges_list` | List additional charges - GET /additional_charges. |
| `chargebee_additional_charge_create` | Create an additional charge on a subscription - POST /subscriptions/&#123;subscription_id&#125;/add_charge. |
| `chargebee_transactions_list` | List transactions - GET /transactions. |
| `chargebee_event_details` | Get details of a Chargebee event - GET /events/&#123;event_id&#125;. |

## How to get credentials

This connector uses an **API key / token**. Create one in the provider
dashboard, then paste it into FlyMyAI:

- **`CHARGEBEE_SITE`** - Your Chargebee subdomain (e.g. 'acme-test').
- **`CHARGEBEE_API_KEY`** - Chargebee - Settings - Configure - API keys. (https://www.chargebee.com/)

## Fields to fill in FlyMyAI

| FlyMyAI field | Where it comes from |
| --- | --- |
| `CHARGEBEE_SITE` | Your Chargebee subdomain (e.g. 'acme-test'). |
| `CHARGEBEE_API_KEY` | Chargebee - Settings - Configure - API keys. |

## Troubleshooting

- **`401 Unauthorized` / `403 Forbidden`** - the token is wrong, expired, or missing a required scope - regenerate it.
- **`429 Too Many Requests`** - you hit the provider rate limit; retry after a short backoff.
- **Unexpected `4xx` on writes** - double-check required fields; the agent confirms before write actions.

## Links

- [Chargebee API documentation](https://apidocs.chargebee.com/docs/api)
