API Keys are used to authenticate your application and control its access to the Chargebee API .
It is strongly advised to keep API keys secret, especially those that give full access to the API.
To create and configure the API keys, select Settings > Configure Chargebee > API Keys and Webhooks and then click on the API Keys tab. Any existing API keys are listed.
Note: API Keys for Test and Live sites are distinct from each other.
Create an API Key
To create a new API key, click on the Add an API Key button, choose the type of key to create, give it a name and click Create Key.
Whenever an API call triggers an event in Chargebee, the name of the API key is seen in the value of the
user attribute .
Types of API Keys
There are 3 main kinds of API keys that you can create:
A full access key is used to gain unrestricted and complete access to your Chargebee site. All the methods listed in the API Docs can be called using this type of key.
This key can only be used to create new subscriptions. You can extend the permissions of this key to more API operations as will be shown next.
The possible API calls for a regular Publishable Key are:
You can add the following access levels to a publishable key:
Allow Estimate API Calls
This gives a publishable key access to Estimates API .
Allow read-only access to Product Catalog
This gives a publishable key read-only access to the Item Families , Items , and Item Prices API.
Note: To prevent misuse, coupons , coupon sets and coupon codes API are not accessible with this key.
All of the Publishable keys are also browser keys: they can be used to make API calls from web browsers. The other types of keys cannot be used as browser keys.
This type of key has a few sub-types, offering varying levels of read-only access to the Chargebee API.
- Read-only: All
This type of key allows you to perform any read-only API call in Chargebee.
- Read-only: Restricted
Depending on the checkboxes selected, this type of key allows read-only access to one or both of the following sets of API groups:
- Allow read-only access to transactional data:
Read-only access to the following set of API groups is allowed:
Subscriptions , Customers , Payment Sources , Virtual Bank Accounts , Cards , Invoices , Credit Notes , Unbilled Charges , Orders , Gifts , Transactions , Quotes , Addresses and Events
- Allow read-only access to your Product Catalog
Read-only access to the Item Families , Items , and Item Prices API is allowed.
Note: To prevent misuse, coupons , coupon sets and coupon codes are not accessible with this key.
A key can be disabled or deleted using the more options button on the card for the key.
- Disabling a key prevents any applications using it from making API calls to Chargebee. Disabling allows you to re-enable the key later.
- Deleting a key purges it forever. The same key is never created again.
Note: At least one full access key must be present for a site; you cannot delete all of them.
Like passwords, it is recommended that you periodically replace keys with new ones. This improves security. While at it, it is always best to first create the new API keys, update all the existing keys on your application with the new keys, and only then delete the old keys from Chargebee.
Discontinued Key Types
Some key type combinations have been discontinued since
and can no longer be created. However, this change is non-breaking. So if such keys were already created by you and are being used, they will continue to work with all their permissions.
Listed below are some examples of key type combinations that have been discontinued:
- Extended Publishable Key without Use from Browser
- Extended Publishable Key + Publishable Key without Use from Browser
- Extended Publishable Key + Read Product Configuration without Use from Browser
- Extended Publishable Key + Read Transactional Data without Use from Browser
- Read Product Configuration with Use from Browser
- Read-only Access + Extended Publishable Key
- Read-only Access + Publishable Key
- Read Transactional Data + Extended Publishable Key + Read Product Configuration without Use from Browser