# Refresh Token API

## **Request Params**

| **Key**        | **Description**                                                                               | **Data type** | **Mandatory** | **Possible Values**                                                                                                                                                                                                      |
| -------------- | --------------------------------------------------------------------------------------------- | ------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| client\_id     | This is a public client id to be used by all payouts merchants, it is same for all merchants. | String        | yes           | <p><strong>Production client\_id</strong> : ccbb70745faad9c06092bb5c79bfd919b6f45fd454f34619d83920893e90ae6b<br><strong>Test client\_id</strong>  : 6f8bb4951e030d4d7349e64a144a534778673585f86039617c167166e9154f7e</p> |
| grant\_type    | Constant value “refresh\_token“                                                               | String        | yes           | refresh\_token                                                                                                                                                                                                           |
| refresh\_token | Access Token received in above api call.                                                      | String        | Yes           |                                                                                                                                                                                                                          |

## &#x20;Example

**Test Environment Request :**

```
curl -X POST \
 https://uat-accounts.payu.in/oauth/token \
 -H 'cache-control: no-cache' \
 -H 'content-type: application/x-www-form-urlencoded' \
 -d 'grant_type=refresh_token&client_id=6f8bb4951e030d4d7349e64a144a534778673585f86039617c167166e9154f7e&refresh_token=ff8e094ecfa11fb390931f779ae62c0836f97bbaedcf5551c88eff826da3239a'
```

{% hint style="info" %}
Remember to have the Content-Type set as x-www-form-urlencoded to avoid “invalid request” errors
{% endhint %}

**Response :**

```
{
 "access_token": "581b0657b38a56bb4296f774852f208f6d84a23d8f1bf61c63c15de60d43ee76",
 "token_type": "Bearer",
 "expires_in": 7199,
 "refresh_token": "ff8e094ecfa11fb390931f779ae62c0836f97bbaedcf5551c88eff826da3239a",
 "scope": "create_payout_transactions",
 "created_at": 1585216027,
 "user_uuid": "11e8-5a8f-05faaaa4-84a5-020d245326e4"
}
```

## **Response Params**

| **Key**        | **Description**                                                                                                        |
| -------------- | ---------------------------------------------------------------------------------------------------------------------- |
| access\_token  | This is a security token. This will be used further in api calls                                                       |
| token\_type    | Type of token                                                                                                          |
| expire\_in     | Access token will get expired in return seconds.                                                                       |
| refresh\_token | This will be used to refresh access\_token.                                                                            |
| scope          | Allowed scopes in generated security token                                                                             |
| created\_at    | Time of creation in milliseconds                                                                                       |
| user\_uuid     | Unique identifier for the user. Read more about uuid [here](https://stackoverflow.com/questions/292965/what-is-a-uuid) |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://payu-docs.gitbook.io/payouts-integration/refresh-tokens/refresh-token-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
