---
updatedAt: 2026-09-03T05:22:25.000Z
agentTools:
  projectIndex: https://docs.payu.in/llms.txt
---

# Aadhar OTP Generation API

The Aadhar OTP Generation API allows merchants to generate OTP for Aadhaar verification purposes. This API is used to initiate the authentication process by sending an OTP to the mobile number registered with the Aadhaar.

**Environment**

|                |                                |
| :------------- | :----------------------------- |
| **Test**       | <https://uat-accounts.payu.in> |
| **Production** | <https://accounts.payu.in>     |

## Request Parameters

### Authorization header

Authorization Bearer token must be generated using **Get Token API** with the scope as . For more information, refer to [Get Token API - Partner Integration](https://docs.payu.in/reference/get_token_api).

### Body

| Parameter                       | Description                         | Example      |
| :------------------------------ | :---------------------------------- | :----------- |
| merchant\_id<br />`mandatory`   | Unique identifier for the merchant  | 20997866     |
| aadhar\_number<br />`mandatory` | 12-digit Aadhaar number of the user | bbbbbbbbbbbb |

## Sample request

```bash
curl --location 'https://api-example.com/api/v3/merchants/kyc_document/aadhaar_xml_consent' \
--header 'Authorization: Bearer dummy' \
--form 'merchant_id="20997866"' \
--form 'aadhar_number="bbbbbbbbbbbb"'
```

## Sample response

### Success scenario

```json
{
  "status": "success",
  "code": 200,
  "message": "OTP sent successfully",
  "data": {
    "reference_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "merchant_id": "20997866",
    "timestamp": "2023-05-27T10:15:30Z"
  }
}
```

### Failure scenario

* Invalid Aadhaar number

```json
{
  "status": "error",
  "code": 400,
  "message": "Invalid Aadhaar number",
  "data": null
}
```

* Unauthorized access

```json
{
  "status": "error",
  "code": 401,
  "message": "Unauthorized access",
  "data": null
}
```

* Failed to generate OTP

```json
{
  "status": "error",
  "code": 500,
  "message": "Failed to generate OTP",
  "data": null
}
```

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "UAT - Refer merchant apis for partner",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://uat-accounts.payu.in"
    },
    {
      "url": "http://{{rp_uat}}"
    },
    {
      "url": "http://{{rp_test}}"
    },
    {
      "url": "http://{{ob_uat}}"
    }
  ],
  "components": {
    "securitySchemes": {
      "noauthAuth": {
        "type": "http",
        "scheme": "noauth"
      }
    }
  },
  "tags": [
    {
      "name": "Manage KYC documents > AadharApis"
    }
  ],
  "paths": {
    "/api/v3/merchants/kyc_document/aadhaar_xml_consent": {
      "post": {
        "tags": [
          "Manage KYC documents > AadharApis"
        ],
        "summary": "Aadhar OTP Generation API",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "merchant_id": {
                    "type": "integer",
                    "description": "Unique identifier for the merchant in the PayU system for whom the Aadhaar verification is being performed",
                    "example": "20997866"
                  },
                  "aadhar_number": {
                    "type": "string",
                    "description": "The 12-digit Aadhaar number (UID) for which OTP will be generated. This is sent to the registered mobile number linked with Aadhaar",
                    "example": "bbbbbbbbbbbb"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "noauthAuth": []
          }
        ],
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "example": "Bearer dummy"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {}
            }
          }
        },
        "x-internal": true
      }
    }
  }
}
```