Skip to main content
The API uses the OAuth 2.0 client credentials flow. You exchange your API credentials (a client ID and client secret) for an access token, then send that token with every API request.
Your client secret grants access to your network’s data. Only use it from your servers: never put it in a browser, mobile app, or any other client-side code.

Create API credentials

1

Open the Developers page

Log in to Network Manager and go to Settings > Developers.
2

Create the credentials

Under Create API credentials, enter a name that tells you where they’re used (for example, Fleet integration) and select Create API credentials.
3

Save the client secret

Copy the client ID and client secret and store them somewhere safe, such as your secrets manager.
The client secret is shown only once. If you lose it, create new credentials, switch your integration to them, and delete the old ones.

Request an access token

Send a POST request to the token URL:
Using the API in QA? Request tokens from https://api-auth.qa.energy.nayax.com/oauth2/token instead.
  • Body: grant_type=client_credentials, sent form-encoded (Content-Type: application/x-www-form-urlencoded). A JSON body is rejected with 415 Unsupported Media Type.
  • Credentials: your client ID and client secret, as HTTP Basic authentication (recommended), or as client_id and client_secret fields in the body.
  • Don’t send scope. Your token always carries all the scopes your credentials were given; requesting one returns invalid_scope.
Example response:

Call the API

Send the token in the Authorization header of every request:

Reuse tokens until they expire

A token is valid for 24 hours (expires_in is in seconds). Request one, cache it, and reuse it for every API call until shortly before it expires. Don’t request a new token per API call.

Token request limits

Each set of API credentials can request at most: Past either limit, the token URL answers 400 with an error saying the hourly or daily token quota is exceeded, until that window resets. Tokens you already have keep working. An integration that reuses its token for its 24-hour lifetime needs about one token a day. If you run several servers or workers, share one token between them (for example, through a cache) rather than requesting one in each.

Errors