The ClickBank Application Program Interfaces, or APIs, are tools that let you create applications to get information on your account. Your application provides your credentials and the information request, and ClickBank returns the information in the specified format.
Using information from the ClickBank APIs, you can create an application that displays or uses this data in useful ways. For example, you could create a dashboard that shows ClickBank data in addition to data from accounts with other online services, a subscription management tool, or an analytics package that shows sales trends for an account or product.
NOTE – You have to be familiar with REST APIs to create your own application using the ClickBank APIs. If you don’t feel comfortable creating your own application using the ClickBank APIs, you should find a developer who can help you.
The following subjects are covered in this article:
The following APIs are supported in version 1.3. Click on the URL or the article for details.
The Analytics API provides subscription and statistical information.
The Images API lists images associated with an account.
The Products API lets you perform CRUD product management operations.
The Quickstats API provides information about your account.
The Shipping API provides shipping information for physical good orders by receipt or time parameters.
Ship Notice API
The Ship Notice API lets you create shipping notifications.
The Tickets API lets you create a technical support or refund ticket, and view or update the status of an existing ticket. For refund tickets related to physical products, you can also confirm that you’ve received a returned product.
These are older versions of the 1.3 APIs. They lack some of the new features of the versions listed above. You can continue to use them if you are already doing so, but you should plan on migrating to the newer versions, as these versions will eventually be deprecated.
- Legacy Orders API – https://api.clickbank.com/rest/1.3/orders
- Legacy Shipping API – https://api.clickbank.com/rest/1.3/shipping
- Legacy Ship Notice API – https://api.clickbank.com/rest/1.3/shipping/shipnotice
The current version of the ClickBank APIs is 1.3.
There are legacy versions of some version 1.3 ClickBank APIs, which are still functional but which lack some new features.
The following specifications are covered in this section:
ClickBank’s API methods are secure and will return a 403 [Forbidden] status code if accessed without the right credentials. To provide these credentials and access the ClickBank APIs, you must use an authorization header. This header must contain a Developer API Key and a Clerk API Key with the role required for the current task. You can create keys with these roles through the user interface.
The following subjects are covered in this section:
To access the APIs, you provide your Developer API key and Clerk API key in the Authorization parameter. The authorization parameter uses the following format:
|Authorization||<Developer API Key>:<Clerk API Key>|
See the Code Samples section for examples of the authorization parameter.
Some actions require specific roles. See the URL for an API to see the required roles for each action. The following keys can be used to grant specific roles:
- Developer Key – This key grants access to the API for your account. This key is required for all ClickBank APIs.
- Clerk Key – This is a key for a specific user. It grants one or more of the following roles:
- Subscription Modification – This role is admin-controlled. Contact ClickBank if you want access to this role and the related features.
CAUTION – Do not share your ClickBank API keys publicly. Redact all personal information and API keys when troubleshooting or sharing code online via websites like Pastebin or Stack Exchange.
You can view, create, and edit Developer and Clerk API keys to use with the ClickBank APIs.
If you are using a single account:
- Log in to your ClickBank account.
- Click the Settings tab.
- Click My Account.
The existing Clerk API Keys and Developer API Keys are displayed.
- To create or edit keys, click the Edit option for either Developer API Keys or Clerk API Keys.
- To create a new key, click the Create button and specify a name for the new key. If you are creating a Clerk API key, select one or more roles to assign to the key.
- To edit an existing Clerk API key, click the Edit icon and select or deselect one or more roles.
If you are using a master account, you can view, create, and edit Clerk API keys for your users:
- Log in to your Master account.
- Click Users.
The current users are displayed. You can create a new user, view a user’s Clerk API key, and manage a user’s roles.
- To create a new user, click Create New User. You can create an API-only user, or create a user who can also log into the user interface. Provide the information required for the user type, then specify the user’s roles.
The user’s Clerk API key is displayed on the role selection page.
- To view a user’s Clerk API key or manage a user’s roles, click Manage Permissions. Select or deselect one or more roles, then click Save.
The user’s Clerk API key is displayed on the role selection page.
For some programming languages, the ClickBank APIs require your system to possess a certificate for the following domain:
Verify that you have a certificate for this domain. The procedure for acquiring this certificate varies based on your browser, but your browser indicates a secure connection to the API pages above if the certificate is present.
The ClickBank APIs are based on JSR-311 – the Java API for RESTful Web Services. The services are HTTP-based and implementation-agnostic, meaning that any web client (.NET, PHP, Java, Python, Ruby, etc.) can use them.
The ClickBank API header consists of security, output, and page parameters. The ClickBank APIs only accept query parameters; requests using form-based (post) parameters are ignored.
The HTTP specification limits a URL to 2,000 characters or fewer. Ensure that your ClickBank API URLs don’t exceed 2,000 characters.
The ClickBank APIs support the following output formats:
You select an output format by including an Accept parameter in the HTTP header.
For example, this header requests XML output:
The ClickBank APIs return the first 100 rows of data for any service call. If a request would contain more than 100 rows of data, the API returns the first 100 rows with a status code of 206 [Partial Content]. To retrieve the additional pages, include a Page parameter in the HTTP header indicating which pages to retrieve.
For example, this header requests page 3:
Once the final page has been accessed, the service returns a status code of 200 [OK] instead of 206 [Partial Content].
To protect the ClickBank API system, quotas are placed on ClickBank API usage.
The default quotas are:
- A maximum of 25,000 requests per day per account.
- A maximum of ten requests per second per IP Address.
If a quota is exceeded, the ClickBank API will return a status code of 403 [Forbidden] and a message indicating that the quota has been met.
These resources may be useful when working with the ClickBank APIs.
ClickBank API Contract
The ClickBank API Contract covers the legal requirements for use of the ClickBank APIs.
The ClickBank APIs include a debugging service at the following URL:
When you send a request to the debugging service, it returns the request context information including the security context information. This can be useful when correcting issues with the ClickBank APIs.
The following code samples show how you might use the ClickBank APIs using different web clients. Each sample provides the necessary credential and header information and requests a list of orders.
- C# – https://api.clickbank.com/api/api_13_examples/api_example.csharp
- Java – https://api.clickbank.com/api/api_13_examples/api_example.java
- PHP – https://api.clickbank.com/api/api_13_examples/api_example.php
- Python – https://api.clickbank.com/api/api_13_examples/api_example.py
- Ruby – https://api.clickbank.com/api/api_13_examples/api_example.rb