How to use Stripe’s API for download information?
By: Carlos Guevara
Tags: Stripe, Rest Api, Tutorial, Development, API

Be able to use Stripe information when you need it!

Stripe is online payment processing for internet businesses, that recollects all the information about our processing money in its platform and which has become a reference on how to create documentation for one API. If you use Stripe for your principal payment processing and want to download information from the platform for creating reports, dashboards, analytics, or simple finance control, the best way is using its API, which has very good documentation on its use, with examples for some good numbers of languages.

The Stripe API has official libraries for the more popular languages and has community libraries for other languages. But, what happens if you want to use this API in one language without a library available? or if you want to use this API without use some programming language.

Stripe API -Client Libraries

If you don’t want to use some programing language for use this API, you can make requests directly into your browser, creating one specific URL with enough information, and if you want to use some specific language for use this API but don’t have one library dedicate for this API, you need to know the general behavior for being able to create all the requests that you need. In both cases, this article has enough information for you, but need to take into account these points:

You need to authenticate to be able to take access to your account information.

The results of this API will be JSON files and you need to be able to use the information in this format. So, if you want to use this information in Excel or Google SpreadSheets, you need to change the structure of the result.

All the API have restrictions in your use. In the case of Stripe, the principal restriction is the limit on the number of objects to be returned, between 1 and 100.

Authentification

Stripe’s API uses HTTP basic authentication. The normal way of using HTTP Basic Auth is with username and password, and if you try to use the API URL directly in the browser without other information, you will have a pop-up for ingress this information.

Stripe API -Use of API directly into the browser

This should be a way to confirm what type of authentification uses some API when we don’t have access to its documentation. If you want to use one API without the need to pass the credentials across the pop-up in your web browser, for example into a script of some programming language without support or library for this API, or for making different calls without the need to pass the credentials for each request, you can pass your credentials across the URL with this form:

Stripe API -Pass username and password across URL

For more information about this type of authentification, you can have a look here.

In the case of Stripe’s API, you only need to provide your API key as the basic auth username value without the need to provide a password in the case of using the pop-up way, and if you want to use the authentification directly in the URL you only need pass the API Key next to API link after at sign.

Stripe API -Pass API key across URL

If you don’t know what is your API key, you can create, view, and manage your API keys in the Stripe Dashboard. Stripe provides one key in your documentation, to test the use of your API, so you can use this key before using your real data.