ClickBank Knowledge Base /General Account Help/Tools & Features

ClickBank APIs

Melissa
posted this on December 26, 2012, 13:09

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:

Supported APIs

The following APIs are supported in version 1.3. Click on the URL for service details.

Analytics API

The Analytics API provides subscription and statistical information.

URL: https://api.clickbank.com/rest/1.3/analytics

Images API

The Images API lists images associated with an account.

URL: https://api.clickbank.com/rest/1.3/images

Orders API

The Orders API lets you view order information and update some order parameters.

URL: https://api.clickbank.com/rest/1.3/orders2

Products API

The Products API lets you perform CRUD product management operations.

URL: https://api.clickbank.com/rest/1.3/products

Quickstats API

The Quickstats API provides information about your account.

URL: https://api.clickbank.com/rest/1.3/quickstats

Shipping API

The Shipping API provides shipping information for physical good orders by receipt or time parameters.

URL: https://api.clickbank.com/rest/1.3/shipping2

Ship Notice API

The Ship Notice API lets you create shipping notices.

URL: https://api.clickbank.com/rest/1.3/shipping2/shipnotice

Tickets API

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.

URL: https://api.clickbank.com/rest/1.3/tickets

Legacy Versions

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 

Current Version

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.

API Specifications

The following specifications are covered in this section: 

Security

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 containing one or more keys.

The following keys can be used:

  • 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:
    • Read
    • Write
    • Analytics
    • Products
    • Subscription Modification – This role is in a beta period. Contact ClickBank if you want access to this role and the related features.

Some actions require specific roles. See the URL for an API to see the required roles for each action.

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:

  1. Log in to your account.
  2. Click the Settings tab.
  3. Click My Account.
    The existing Clerk API Keys and Developer API Keys are displayed.
  4. 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:

  1. Log in to your master account.
  2. 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.

Once you have a Developer API key and Clerk API keys with the correct roles, you provide them in the Authorization parameter.

For example, this authorization uses a Developer API key and Clerk API key:

Authorization DEV-F7F8023A486E9A9602FFDA2765E1925:API-9870acb8d96f8bd18c2eb70725b01fe4b98ece58

If an action does not require a role other than Developer, you can provide only a Developer API key. For example:

Authorization DEV-F7F8023A486E9A9602FFDA2765E1925

Certifications

For some programming languages, the ClickBank APIs require your system to possess a certificate for the following domain:

*.clickbank.com

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.

Infrastructure

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.

Headers and Sizing

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.

Output

The ClickBank APIs support the following output formats:

  • XML
  • JSON

You select an output format by including an Accept parameter in the HTTP header.

For example, this header requests XML output: 

Accept application/xml

Pagination

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:

Page 3

Once the final page has been accessed, the service returns a status code of 200 [OK] instead of 206 [Partial Content].

Quotas

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 five 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.

If you feel that you need a higher daily quota, you can contact Customer Service to request an increase. Please provide a brief explanation of why you need a quota increase.

Other Resources

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.

Debugging

The ClickBank APIs include a debugging service at the following URL:

https://api.clickbank.com/rest/1.3/debug

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.

Code Samples

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.

 
Topic is closed for comments