> ## Documentation Index
> Fetch the complete documentation index at: https://docs.energy.nayax.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrating from legacy API credentials

> Create new API credentials and switch your integration to them before legacy credentials stop working.

> [!WARNING]
>
> Legacy API credentials stop working on **January 15, 2027**. Switch your integration to new credentials before then.

## What's changing

* **New API credentials.** Nayax Energy is improving API security. To keep integrating with the API, you need to create new API credentials.
* **The API itself isn't changing.** Only how you get an access token changes. Your API requests, URLs and permissions stay the same.
* **Token request limits.** Each set of new credentials can request at most **60 tokens per hour and 500 per day**. A token lasts 24 hours, so an integration that reuses its token stays well within these limits. See [Reuse tokens until they expire](https://docs.energy.nayax.com/api/authentication.md#reuse-tokens-until-they-expire).

API credentials created before the switch are now **legacy credentials**, listed under **Legacy API credentials** on the [Developers](https://energy.nayax.com/settings/developers) page. They can't be converted to new credentials.

## What you need to do

**1. Create new API credentials**

On the [Developers](https://energy.nayax.com/settings/developers) page in Network Manager, create new API credentials and save the client secret: it's shown only once.

**2. Update your token request**

Change the token URL and the request format, as in the [example below](#example).

**3. Test your integration**

Run your integration with the new credentials and confirm its API calls succeed.

**4. Delete the legacy credentials**

Once nothing uses them, delete the legacy credentials on the Developers page. From **January 15, 2027**, they stop working: tokens from them are refused with `401`.

## What changes in the token request

| | Legacy credentials | New credentials |
| - | - | - |
| Client ID and secret | Your existing ones | New ones from the Developers page |
| Token URL | `https://lynkwell-prod.us.auth0.com/oauth/token` | `https://api-auth.energy.nayax.com/oauth2/token` |
| Request body | JSON or form-encoded | **Form-encoded only** (`application/x-www-form-urlencoded`) |
| Client ID and secret sent as | Body fields | HTTP Basic authentication (recommended) or body fields |
| `audience` | Required (`https://api.lynkwell.com`) | Not needed (ignored if sent) |
| `scope` | Optional | **Don't send** (rejected with `invalid_scope`) |

## What stays the same

* **API requests:** the same API URLs, with the token in an `Authorization: Bearer` header.
* **Permissions:** new credentials get the same scopes legacy ones have.
* **The token response:** `access_token`, `token_type` (`Bearer`), and `expires_in`.
* **Token lifetime:** 24 hours. Keep caching tokens until they expire; see [Reuse tokens until they expire](https://docs.energy.nayax.com/api/authentication.md#reuse-tokens-until-they-expire).

> [!NOTE]
>
> If your code reads the contents of the access token (most integrations don't), its `iss` and `sub` values change, and it has no `aud` claim.

## Example

**Before**, with legacy credentials:

```bash theme={null}
curl --request POST \
  --url https://lynkwell-prod.us.auth0.com/oauth/token \
  --header 'Content-Type: application/json' \
  --data '{
    "client_id": "LEGACY_CLIENT_ID",
    "client_secret": "LEGACY_CLIENT_SECRET",
    "audience": "https://api.lynkwell.com",
    "grant_type": "client_credentials"
  }'
```

**After**, with new credentials:

```bash theme={null}
curl --request POST \
  --url https://api-auth.energy.nayax.com/oauth2/token \
  --user "NEW_CLIENT_ID:NEW_CLIENT_SECRET" \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data grant_type=client_credentials
```

See [Authentication](https://docs.energy.nayax.com/api/authentication.md) for Node.js and Python versions.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.