# Versioning

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


The Chargebee API has two major versions: v1 and v2. Use the toggle at the top of the page to switch between these versions.

## Sub-versions of v2

Some breaking changes have been introduced in version 2 of our API, which has resulted in the creation of a newer sub-version. When viewing the documentation for v2, you can select the specific sub-version using the **Product Catalog** selector at the top of the page. The term "Product Catalog" is used because the changes introduced are primarily related to the Product Catalog APIs, such as [Items API](/docs/api/items).

To determine which sub-version applies to your site, log in to Chargebee and return to this site. You will then be prompted to switch to the appropriate documentation version for your site.

**See also**

[Upgrading to Product Catalog 2.0](/docs/api/upgrade).

## Checking the API version

There are three ways to know the API version you're using:

-   **Endpoint paths**: The version of the API can be seen in the API endpoint path: For v2 the path begins with `/api/v2` whereas for v1, it begins with `/api/v1`. For example:
    -   **[Create customer API v2](/docs/api/customers?prod_cat_ver=2#create_a_customer)**: `https://{subdomain}.chargebee.com/api/v2/customers`
    -   **[Create customer API v1](/docs/api/v1/customers#create_a_customer)**: `https://{subdomain}.chargebee.com/api/v1/customers`
-   **Webhooks**: In webhook payloads, the API version can be found in the value of the attribute [`api_version`](/docs/api/events/event-object#api_version). The schema of the payload is determined by the API version.
-   **Client library**: The API version used is configured in the source code of each of our client libraries. If you would like to learn more, select a language in the "Library" dropdown above and read this section.

**Client library**: The API version is configured in the source code of each of our client libraries. If you would like to learn more, select a language in the "Library" dropdown above and read this section.

**[Java](https://github.com/chargebee/chargebee-java/tree/v3) client library**: The API version used is configured in the [source code](https://github.com/chargebee/chargebee-java) of the library. You can find it assigned to the string named `API_VERSION` in the file `/src/main/java/com/chargebee/Environment.java`. Moreover, if you know the version of the Java library, you can find the compatible API versions listed in [the readme](https://github.com/chargebee/chargebee-java#readme).

**[Java](https://github.com/chargebee/chargebee-java) client library**: The API version used is configured in the [source code](https://github.com/chargebee/chargebee-java) of the library. You can find it assigned to the string named `API_VERSION` in the file `/src/main/java/com/chargebee/Environment.java`. Moreover, if you know the version of the Java library, you can find the compatible API versions listed in [the readme](https://github.com/chargebee/chargebee-java#readme).

**[PHP](https://github.com/chargebee/chargebee-php) client library**: The API version used is configured in the [source code](https://github.com/chargebee/chargebee-php) of the library. You can find it assigned to the `const` named `API_VERSION` in the file `/lib/ChargeBee/Environment.php`. Moreover, if you know the version of the PHP library, you can find the compatible API versions listed in [the readme](https://github.com/chargebee/chargebee-php#readme).

**[PHP](https://github.com/chargebee/chargebee-php) client library**: The API version used is configured in the [source code](https://github.com/chargebee/chargebee-php) of the library. You can find it assigned to the `const` named `API_VERSION` in the file `/lib/ChargeBee/Environment.php`. Moreover, if you know the version of the PHP library, you can find the compatible API versions listed in [the readme](https://github.com/chargebee/chargebee-php#readme).

**[Ruby](https://github.com/chargebee/chargebee-ruby) client library**: The API version used is configured in the [source code](https://github.com/chargebee/chargebee-ruby) of the library. You can find it assigned to the constant `API_VERSION` in the file `/lib/chargebee/environment.rb`. Moreover, if you know the version of the Ruby library, you can find the compatible API versions listed in [the readme](https://github.com/chargebee/chargebee-ruby#readme).

**[Python](https://github.com/chargebee/chargebee-python) client library**: The API version used is configured in the [source code](https://github.com/chargebee/chargebee-python) of the library. You can find it assigned to the constant `API_VERSION` in the file `/chargebee/environment.py`. Moreover, if you know the version of the Python library, you can find the compatible API versions listed in [the readme](https://github.com/chargebee/chargebee-python#readme).

**[Python](https://github.com/chargebee/chargebee-python) client library**: The API version used is configured in the [source code](https://github.com/chargebee/chargebee-python) of the library. You can find it assigned to the constant `API_VERSION` in the file `/chargebee/environment.py`. Moreover, if you know the version of the Python library, you can find the compatible API versions listed in [the readme](https://github.com/chargebee/chargebee-python#readme).

**[.NET](https://github.com/chargebee/chargebee-dotnet) client library**: The API version used is configured in the [source code](https://github.com/chargebee/chargebee-dotnet) of the library. You can find it assigned to the string named `API_VERSION` in the file `/ChargeBee/Api/ApiConfig.cs`. Moreover, if you know the version of the .NET library, you can find the compatible API versions listed in [the readme](https://github.com/chargebee/chargebee-dotnet#readme).

**[Node.js](https://github.com/chargebee/chargebee-node) client library**: The API version used is configured in the [source code](https://github.com/chargebee/chargebee-node) of the library. Check the property named `ChargeBee._env.apiPath` in the file `/lib/chargebee.js`. Moreover, if you know the version of the Node.js library, you can find the compatible API versions listed in [the readme](https://github.com/chargebee/chargebee-node#readme).

**[Node.js](https://github.com/chargebee/chargebee-node) client library**: The API version used is configured in the [source code](https://github.com/chargebee/chargebee-node) of the library. Check the property named `ChargeBee._env.apiPath` in the file `/lib/chargebee.js`. Moreover, if you know the version of the Node.js library, you can find the compatible API versions listed in [the readme](https://github.com/chargebee/chargebee-node#readme).

**[Go](https://github.com/chargebee/chargebee-go) client library**: The API version used is configured in the [source code](https://github.com/chargebee/chargebee-go) of the library. You can find it assigned to the `const` named `APIVersion` in the file `environment.go`. Moreover, if you know the version of the Go library, you can find the compatible API versions listed in [the readme](https://github.com/chargebee/chargebee-go#readme).

**[Go](https://github.com/chargebee/chargebee-go) client library**: The API version used is configured in the [source code](https://github.com/chargebee/chargebee-go) of the library. You can find it assigned to the `const` named `Version` in the file `version.go`. Moreover, if you know the version of the Go library, you can find the compatible API versions listed in [the readme](https://github.com/chargebee/chargebee-go#readme).

**[TypeScript](https://github.com/chargebee/chargebee-typescript) client library**: The API version used is configured in the [source code](https://github.com/chargebee/chargebee-typescript) of the library. Check the property named `environment.apiPath` in the file `/src/environment.ts`. Moreover, if you know the version of the TypeScript library, you can find the compatible API versions listed in [the readme](https://github.com/chargebee/chargebee-typescript#readme).

## Backward compatible changes

Chargebee considers the following changes as backward compatible:

-   Adding new API resources.
-   Adding new attributes to existing API resources.
-   Changing the order of attributes in existing API responses.
-   Adding new endpoints.
-   Adding new optional input parameters to existing endpoints.
-   Adding new event types.