---
description: Generate authentication token using client secret and private client id
---

# API to Generate Token using private client id

{% tabs %}
{% tab title="Production" %}
[https://accounts.payu.in/oauth/token](https://accounts.payu.in/oauth/token)
{% endtab %}

{% tab title="Testing" %}
&#x20;[https://uat-accounts.payu.in/oauth/token](https://uat-accounts.payu.in/oauth/token)
{% endtab %}
{% endtabs %}

## **Request Params**

| **Key**         | **Description**                                                               | **Data type**  | **Mandatory**  | **Possible values**           |
| --------------- | ----------------------------------------------------------------------------- | -------------- | -------------- | ----------------------------- |
| client\_id      | Login to the Payouts Dashboard and fetch the client ID after OTP verification | String         | yes            |                               |
| grant\_type     | Constant value “client\_credentials “                                         | String         | yes            | client\_credentials           |
| client\_secret  | Login to the Payouts Dashboard and fetch the client ID after OTP verification | String         | yes            |                               |
| scope           | Constant value                                                                | String         | yes            | create\_payout\_transactions  |

## &#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=client_credentials&client_id=cf608fdsfe84fd52f94fbc2702e4bb431641c40339991787568773411df368&client_secret=26ec3cc4bc7caaasdf90b006b655582b92ed0116554597942a884c6cb626e3f&scope=create_payout_transactions'
```

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

**Response:**

```
{
 "access_token": "994as40fd3bee9a0e830b5a5743a93d4f5c32c84f637510b128a7c69586ab8d",
 "token_type": "Bearer",
 "expires_in": 6351,
 "scope": "create_payout_transactions",
 "created_at": 1585215909
}
```



## **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.                 |
| scope          | allowed scopes in generated security token                       |
| created\_at    | Time of creation in milliseconds                                 |
