ChargebeeAPI

Getting started

Important

Starting November 1, 2025, Chargebee will briefly rotate TLS certificates on weekends to help you validate. The new DigiCert G2 chain becomes permanent in February 2026. If you don't update, API calls may fail with SSL errors. Learn more about the TLS G2 certificate update.

Chargebee provides HTTP based API which follows the essence of REST*. The HTTP protocol's rules are followed thereby enabling simple HTTP client tools like "curl" to be used.

The following client libraries provide a "easy to use" wrapper around the raw HTTP based API:

If you require support for additional languages, please raise a ticket on our support page.

Sample Snippets

Use the language bar at the top to view code examples in your chosen language.

Want us to generate ready-to-test snippets?

Login to Chargebee and open the API docs from there and you'll find ready-to-test sample codes based on your Chargebee test site's API key and data.

Don't have an account with Chargebee yet? Signup now!

Sample Apps

Explore our suite of sample applications, complete with tutorials to guide your integration with Chargebee.

Documentation

For in-depth explanations and definitions of all Chargebee components, consult our documentation.

Resources

Chargebee follows the REST model of exposing resources as urls. For example, subscriptions are exposed as:

Request

The HTTP method (like GET, POST) determines the operation type on the resource. Query parameters allow you to provide additional options to the GET requests. POST parameters provide the data to write operations like creation, modification of resource(s).

Response

The response is in JSON format. Currently Chargebee does not support any other response format.

Note: Sometimes, while working with Chargebee APIs, you may see undocumented attributes returned in the response. Such attributes should be ignored.

Request

The HTTP method (like GET, POST) determines the operation type on the resource. Query parameters allow you to provide additional options to the GET requests. POST parameters) provide the data to write operations like creation, modification of resource(s). By default curl uses GET method. Use -X option to specify a specific HTTP method to use. For passing parameters, use -d option.

Response

The response is in JSON format. Currently Chargebee does not support any other response format.

Sample Request

Sample Response [ JSON ]

If you are calling our APIs without any of the client libraries, you can set the User-Agent header to a custom value to differentiate API calls from different applications and help with troubleshooting.
Sample request with custom User-Agent header
💡 Select a language from the SDK dropdown above to see examples in your preferred language. After logging in, code samples will use your actual API key and site data.

Client library

Using cURL

You can use cURL to test Chargebee API from a CLI. When you pass input parameters to the API using -d or --data-urlencode options, the HTTP POST method is used:

When no input parameters are provided, cURL uses the GET method by default:

To make a POST request without providing any input parameters, use the -X POST option:

Further, to make GET requests with parameters, you must use the -G option:

Build with LLMs

Chargebee's API is designed to work seamlessly with Large Language Models (LLMs) and AI assistants. The structured API definitions and comprehensive documentation make it easy to integrate Chargebee into AI-powered applications.

OpenAPI Specification

Chargebee supports the OpenAPI Specification to make it easier for developers to work with our APIs.

The spec is fully compliant with OpenAPI v3.0.1, enabling customers to:

  • Use API development tools like Swagger and Postman
  • Automate testing and documentation workflows

This is part of our commitment to providing a smoother, more efficient developer experience.

Code samples

The sample code snippets provided for the endpoints in this documentation are ready-to-test. Once you log in and select a test site using the dropdown that appears at the top, the code samples in this documentation automatically include your API key and site data.

API testing

Chargebee provides the Time Machine feature to help you test your integration. Once you've set up your billing configuration on the test site, you can simulate events on a hypothetical time frame to ensure everything works as expected. Ensure that you rigorously test your configuration before going live.

Additional developer resources

Check out our collection of sample applications and related tutorials for integrating with Chargebee.