Skip to main content

How to use the API?

The API is secured by an Api-Key for Hero Cash.

If you still don't have an Api-Key, you can follow this guide.

Security

Your Api-Key is sensitive information, you should keep it secret and safe!

API endpoint

Our API is available on two different environments:

  • Production: https://api.hero.fr/api/graphql
  • Staging: https://staging.api.hero.fr/api/graphql

Use staging to make some tests (there will be no money transfer on this environment), but don't forget to use Production endpoint in your production!

Graphql

You may have noticed, we are not using REST, but we rely on GraphQL for our API.

GraphQL transits through HTTP so you don't have to know GraphQL to use our API, but there are some differences you must know:

  • GraphQL doesn't use HTTP status. You should check the data we send you to make sure there are no errors.
  • With GraphQL you can choose each piece of data you want to receive.
  • GraphQL is typed so you can have predictable API results

Rate limiting

warning

All our platform endpoints are rate limited. If you exceed the rate limit, you will receive a 429 HTTP status code.

You can make up to 1800 requests per minute and 200 requests per second

In addition, some operations can be long to process due to data fetching. If you plan to use bulk operations it is recommended to minimize bulk size and increase the number of calls to have a faster response time.

Let's make a call

GraphQL transit over HTTP, so it's basically a simple request like:

  • Curl
  • Node.JS (axios)
    curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Api-Key <Your Api-Key>" \
-d '{"query": "{ version }"}' \
https://staging.api.hero.fr/api/graphql