> For the complete documentation index, see [llms.txt](https://eshop.gitbook.io/eshopbox-developers/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://eshop.gitbook.io/eshopbox-developers/basics/authentication/refresh-access-token.md).

# Refresh Access Token

Use this endpoint to exchange the Refresh Token you received during authorization for a new Access Token.

## Refresh Access Token

<mark style="color:green;">`POST`</mark> `https://auth.myeshopbox.com/api/v1/generateToken`

This endpoint allows you to generate a new access token.

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | string | application/json |

#### Request Body

| Name           | Type   | Description                                                                                           |
| -------------- | ------ | ----------------------------------------------------------------------------------------------------- |
| grant\_type    | string | Denotes the flow you are using to generate Access Token. For Refresh Token Flow, use `refresh_token`. |
| client\_id     | string | Your application's Client ID.                                                                         |
| client\_secret | string | Your application's Client Secret.                                                                     |
| refresh\_token | string | The Refresh Token you received during authorization to obtain a new Access Token.                     |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```
{
    "access_token": "eyJhbGci...kpXVCIsI",
    "id_token": "eUzI1Ni...I6IkpXsIm",
    "scope": "openid profile",
    "expires_in": 86400,
    "token_type": "Bearer"
}
```

{% endtab %}
{% endtabs %}

⚠️ Token Usage & Rate Limiting Notice\
To ensure reliable and uninterrupted access to our API, please note the following regarding authentication token handling:<br>

* Token Lifetime: Tokens have a validity of 30 days.
* Caching Required: You must cache the token per user and reuse it for subsequent requests until it expires.
* Token Renewal: Only call the token generation endpoint once the cached token has expired.
* Repeated, unnecessary requests to the token generation endpoint can lead to rate limiting and degraded performance. To prevent this, implement proper token caching and expiration checks in your integration.
