Introduction Authentication

Learn how to use API authentication to communicate directly with Chargify from any programming language that you wish.

There are two methods of authentication, depending on what you are accessing:

Both methods of authentication assume you have previously generated API keys securely stored them for later use. For more information, see “Obtaining Credentials”.

For most integrations, the API will be the easiest to implement. Chargify Direct is a method of very securely creating subscriptions where the information is posted directly to Chargify and none of the payment information is passed through your code. Your requirements will dictate the need to use one or the other (or both).


The first method of interaction is through the API. API Authentication is implemented as HTTP Basic Authentication over TLS (HTTPS).

Your API login credentials are not the same as the credentials you use to log in to the web interface. You must obtain your API credentials separately, and you must connect to the API via TLS 1.2 (or better) as of January 2016.

One of the most common calls you will make via the API is to retrieve a list of subscriptions to retrieve additional information, such as the status of a specific subscription. A simple way to authenticate is to use the API Key as the username and “X” as the password, like the following:

curl https://{subdomain}{format} \
-u '{API_key}:X' \
-H 'content-type: application/json' \

If passing the Basic Authentication header, the API key and password require base64 encoding:

curl --request GET \
  --url 'https:///{subdomain}{format}' \
  --header 'authorization: Basic PDxhcGlfa2V5Pj46...' \
  --header 'content-type: application/json'

For more information about API authentication, please see our API documentation/example.

Chargify Direct

Please see our dedicated section on how to authenticate with Chargify Direct.

Next Steps

After you’ve mastered authentication, you should check out the following articles:

  • Managing sites
  • Creating products and how they control what you bill customers
  • Creating subscriptions, (ie. signing up customers)