Introducing the Chargebee CLI

Chargebee API documentation

Problem Statement

Chargebee provides HTTP-based REST APIs and client libraries for PHP, Ruby, Python, Java, .NET, Node, and Go. Authenticate with your API key, and read JSON responses.

Solution

Chargebee provides HTTP-based REST APIs. You can use standard HTTP clients (for example, curl). Chargebee also provides API client libraries for multiple languages:

Sample apps and tutorials: Chargebee API Tutorials.

Authentication: Chargebee uses HTTP Basic Auth. Use your API key as the username and leave the password empty. Get the API key from Settings > Configure Chargebee > API & Webhooks > API Keys.

API keys differ for your test site and your live site.

Request: HTTP methods (GET, POST, etc.) define the operation. Query parameters apply to GET requests; POST body provides data for create/update operations.

Response: Responses are in JSON. Chargebee does not support other response formats.

Error handling: HTTP status codes indicate success or failure. The response body contains error details in JSON. 2xx indicates success; 4xx indicates a client-side error (for example, 400 Bad Request); 5xx indicates a server-side error. Chargebee returns the first validation error it encounters. Validate the input before you call the API when you can.

Full reference: Chargebee API Overview.

Additional Information