5.5 KiB
5.5 KiB
Chargebee Routing Reference
App name: chargebee
Base URL proxied: {subdomain}.chargebee.com
The router automatically handles the subdomain from your connection.
API Path Pattern
/chargebee/api/v2/{endpoint}
Common Endpoints
Customers
List Customers
GET /chargebee/api/v2/customers?limit=10
Get Customer
GET /chargebee/api/v2/customers/{customerId}
Create Customer
POST /chargebee/api/v2/customers
Content-Type: application/x-www-form-urlencoded
first_name=John&last_name=Doe&email=john@example.com
Update Customer
POST /chargebee/api/v2/customers/{customerId}
Content-Type: application/x-www-form-urlencoded
first_name=Jane
Subscriptions
List Subscriptions
GET /chargebee/api/v2/subscriptions?limit=10
Get Subscription
GET /chargebee/api/v2/subscriptions/{subscriptionId}
Create Subscription
POST /chargebee/api/v2/subscriptions
Content-Type: application/x-www-form-urlencoded
plan_id=basic-plan&customer[email]=john@example.com&customer[first_name]=John
Cancel Subscription
POST /chargebee/api/v2/subscriptions/{subscriptionId}/cancel
Content-Type: application/x-www-form-urlencoded
end_of_term=true
Item Prices (Product Catalog 2.0)
List Item Prices
GET /chargebee/api/v2/item_prices?limit=10
Get Item Price
GET /chargebee/api/v2/item_prices/{itemPriceId}
Items (Product Catalog 2.0)
List Items
GET /chargebee/api/v2/items?limit=10
Get Item
GET /chargebee/api/v2/items/{itemId}
Plans (Product Catalog 1.0 - Legacy)
List Plans
GET /chargebee/api/v2/plans?limit=10
Get Plan
GET /chargebee/api/v2/plans/{planId}
Invoices
List Invoices
GET /chargebee/api/v2/invoices?limit=10
Get Invoice
GET /chargebee/api/v2/invoices/{invoiceId}
Download Invoice PDF
POST /chargebee/api/v2/invoices/{invoiceId}/pdf
Transactions
List Transactions
GET /chargebee/api/v2/transactions?limit=10
Hosted Pages
Checkout New Subscription
POST /chargebee/api/v2/hosted_pages/checkout_new_for_items
Content-Type: application/x-www-form-urlencoded
subscription[plan_id]=basic-plan&customer[email]=john@example.com
Manage Payment Sources
POST /chargebee/api/v2/hosted_pages/manage_payment_sources
Content-Type: application/x-www-form-urlencoded
customer[id]=cust_123
Portal Sessions
Create Portal Session
POST /chargebee/api/v2/portal_sessions
Content-Type: application/x-www-form-urlencoded
customer[id]=cust_123
Filtering
Use filter parameters:
GET /chargebee/api/v2/subscriptions?status[is]=active
GET /chargebee/api/v2/customers?email[is]=john@example.com
GET /chargebee/api/v2/invoices?date[after]=1704067200
Notes
- Authentication is automatic - the router injects Basic auth from your API key
- Subdomain is automatically determined from your connection
- Uses form-urlencoded data for POST requests
- Nested objects use bracket notation:
customer[email] - Timestamps are Unix timestamps
- List responses include
next_offsetfor pagination - Status values:
active,cancelled,non_renewing, etc. - Product Catalog versions: Use
item_pricesanditemsfor PC 2.0, orplansandaddonsfor PC 1.0
Resources
- Getting Started
- List Customers
- Retrieve a Customer
- Create a Customer
- Update a Customer
- List Subscriptions
- Retrieve a Subscription
- Create a Subscription
- Cancel a Subscription
- List Items
- Retrieve an Item
- List Item Prices
- Retrieve an Item Price
- List Plans
- Retrieve a Plan
- List Invoices
- Retrieve an Invoice
- Download Invoice as PDF
- List Transactions
- Checkout New Subscription
- Manage Payment Sources
- Create a Portal Session