.chargebee.com; a test site’s name ends in -test). Test and live sites have separate keys. Things to know before you write:
- Product Catalog. Sites made since 2021 use Product Catalog 2.0: items, item prices and
customers.createSubscriptionForItems. Older sites use 1.0: plans, addons and the routes marked “Product Catalog 1.0 sites only”. A route from the other catalog answers 400configuration_incompatible, unless Chargebee has turned on catalog coexistence for the site. - Money moves. Creating or updating a subscription, invoicing, collecting payment, charging, refunding and voiding are
destructive: on a live site they charge real cards. Estimates (estimates.*,*Estimate) compute the same numbers without changing anything. - Lists take
limit(up to 100) andoffset; pass the response’snext_offsetback asoffset. Filters use Chargebee’s operators:status: { is: 'active' },created_at: { after: 1700000000 }. - Nested fields follow the API reference:
billing_address: { city },subscription_items: { item_price_id: ['plan-USD-monthly'], quantity: [1] }(one list per field, index by index). The plugin sends them in Chargebee’s bracket form.meta_datais a JSON object. - Time machine (
timeMachines.*) works on test sites only and resets or moves the whole site.
- 546 typed API operations
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
Store the Chargebee API key before the first call: More: API Key
pnpm corsair setup --plugin=chargebee --tenant=acme api_key=<your-key> (leave out --tenant without multiTenancy), or pass it as key in the plugin options. With Hub, each tenant enters their own key on the connect page. See API key auth.4
Connect a tenant
Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.
Example API calls
List customersWhat’s next
API reference
Every
chargebee.api.* operation with input and output types.Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.