Authenticate using HTTP Basic auth with your Chargebee API key as the username and an empty password; find or create API keys in Chargebee Settings > Configure Chargebee > API Keys.
Base URL is https://{site}.chargebee.com/api/v2 — replace {site} with your Chargebee site name (distinct for test and production sites).
Create a subscription via POST to /api/v2/subscriptions with form-encoded body containing 'plan_id' (or 'subscription[plan_id]' depending on API version), 'customer[email]', 'customer[first_name]', and billing address fields.
For PCI-compliant checkout without handling card data, create a hosted page by POSTing to /api/v2/hosted_pages/checkout_new_for_items (v2 Items model) or /api/v2/hosted_pages/checkout_new (v1 Plans model) with subscription parameters; redirect the customer to the returned 'url'.
After the customer completes checkout, Chargebee redirects to your 'redirect_url' with a hosted page ID; retrieve the result by GETting /api/v2/hosted_pages/{hosted_page_id} to get subscription and customer details.
Configure webhooks in Chargebee Settings > API & Apps > Webhooks to receive events like 'subscription_created', 'invoice_generated', and 'payment_failed' for your subscription lifecycle management.
Known gotchas
Chargebee has two product catalog models: the legacy v1 'Plans and Addons' model and the current v2 'Items' model; the API endpoints differ significantly between them, and new sites default to v2 — mixing endpoints from both models in the same site causes errors.
Hosted page URLs expire after a set period (typically a few hours); if a customer takes too long to complete checkout or if you cache the URL for reuse, the page will be expired and the customer will see an error — generate a fresh hosted page URL per checkout session.
Chargebee test and production environments are completely separate sites with separate subdomains and separate API keys; data does not sync between them and test site keys will not work against production URLs.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp