# Aadhaar. Submit OTP

Use this endpoint to complete the Aadhaar check. Send the OTP that the applicant received and `service_request_id` from `POST /services/in/aadhaar/generate-otp`.
Our system sends the OTP to the Aadhaar registry (UIDAI) and returns the personal data of the applicant: name, date of birth, gender, address, and photo.
You can send the OTP 2 times for one `service_request_id`. If the second OTP is also incorrect, our system declines the check. To try again, request a new OTP.
`service_request_id` is valid for 1 hour. After a successful check, you cannot use the same `service_request_id` again.
Our system charges this request when the check is successful or when it declines the check because the attempts are exceeded.

Endpoint: POST /services/in/aadhaar/submit-otp
Version: 1.0
Security: API-Key

## Security:

  - `API-Key` (unknown)
    apiKey in header API-Key

## Request fields (application/json):

  - `service_request_id` (string, required)
    ID of the Aadhaar check from `POST /services/in/aadhaar/generate-otp`, 36 characters
    Example: 6f1c2a4e18b3d04e5f09a7b71c2d3e4f5a6b

  - `otp` (string, required)
    OTP that the applicant received on the mobile number, 6 digits
    Example: 123456

## Request examples:

  - `Submit OTP` (unknown)

## Response 200:

  - `200` (unknown)
    **OK**
The OTP is correct, and our system returned the personal data from the Aadhaar registry.

## Response 200 fields (application/json):

  - `validation` (object)

  - `validation.format` (boolean)
    Shows if the request parameters have a correct format
    Example: true

  - `validation.valid` (boolean)
    Shows if the OTP is correct
    Example: true

  - `data` (object)

  - `data.first_name` (string)
    All words of the full name except the last word
    Example: ASHA KUMARI

  - `data.last_name` (string)
    Last word of the full name
    Example: NAMUNA

  - `data.full_name` (string)
    Full name as it is in the Aadhaar registry
    Example: ASHA KUMARI NAMUNA

  - `data.gender` (string | null)
    Gender
    Enum: "M", "F", "null"

  - `data.dob` (string | null)
    Date of birth in the YYYY-MM-DD format
    Example: 1990-01-01

  - `data.full_address` (string | null)
    Address as one line
    Example: 12, Sample Street, Sample Nagar, New Delhi, Delhi, India

  - `data.profile_image` (string | null)
    Photo of the applicant from the Aadhaar registry. Base64-encoded JPEG image
    Example: /9j/4AAQSkZJRgABAQAAAQABAAD...

## Response 403:

  - `403` (unknown)
    **Forbidden**
Service API is not available for your account.

## Response 403 fields (application/json):

  - `type` (string)
    Example: forbidden

  - `errors` (array)
    Example: []

## Response 404:

  - `404` (unknown)
    **Not Found**
`service_request_id` is not found. The ID is incorrect, expired (more than 1 hour), or already used. Request a new OTP.

## Response 422:

  - `422` (unknown)
    **Unprocessable Content**
The request parameters have an incorrect format, or the OTP is incorrect.

## Response 422 fields (application/json):

  - `validation` (object)

  - `validation.format` (boolean)
    Example: false

  - `validation.valid` (null)
    Example: null

  - `data` (null)
    Example: null

## Response 429:

  - `429` (unknown)
    **Too Many Requests**
The OTP is incorrect, and the number of attempts is exceeded. Our system declines the check and charges the request. To try again, request a new OTP.

## Response 429 fields (application/json):

  - `validation` (object)

  - `validation.format` (boolean)
    Example: true

  - `validation.valid` (boolean)
    Example: false

  - `data` (null)
    Example: null

## Response 500:

  - `500` (unknown)
    **Internal Server Error**
This response indicates that our system encountered an unexpected condition that prevented it from fulfilling the request.

## Response 500 fields (application/json):

  - `type` (string)
    Example: internal_server

  - `errors` (array)

