Authentication

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 have have 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).

API

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. For the basic http authentication of this call, you would use the API Key as the username and “X” as the password, like the following:

curl -u {api_key}:X -H Accept:application/json -X GET https://{subdomain}.chargify.com/subscriptions.{format}

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)