# Aadhaar Pincode Geofencing OCR

## Submit Document

### `aadhaar_pincode_geofencing`

`POST` `https://secctrl.tutelar.io/api/v1/kyc/vision/aadhaar_pincode_geofencing`

#### Post parameters description is given below

| Post Parameter | Type           | Is Mandatory | Description                                     |
| -------------- | -------------- | -----------: | ----------------------------------------------- |
| file           | png, jpg, jpeg |          Yes | Aadhar Image to retrive the details             |
| latitude       | String         |          Yes | User latitude to identify the geofence Mathces  |
| longitude      | String         |          Yes | User longitude to identify the geofence Mathces |

#### Sample Post Parameters

To call this API, you must send a **POST** request with `multipart/form-data` containing:

1. **file** → Aadhaar image (`.jpg`, `.jpeg`, or `.png` )
2. **latitude** → Current latitude to compare geofence
3. **longitude** → Current longitude to compare geofence

```bash
--form 'file=@"/path/to/Aadhaar.JPG"' \
--form 'latitude="9.7"' \
--form 'longitude="77.4"'
```

#### 200: Success Response - Geofence Match

```json
{
  "success": true,
  "code": 200,
  "message": "The request has been successfully completed.",
  "reference_id": "f787a54a-e7c4-46af-9f20-f7a4f496ab4b",
  "status": "completed",
  "result": {
    "message": "Uploads matches with geofence",
    "extracted_pincode": "625512",
    "pincode_geo_location": {
      "latitude": 9.6,
      "longitude": 77.3
    },
    "user_location": {
      "latitude": 9.7,
      "longitude": 77.4
    },
    "distance": "1.4 km",
    "threshold_distance": "1.5 km",
    "matches": true
  },
  "requested_at": "2025-08-26T05:34:47.660Z",
  "completed_at": "2025-08-26T05:34:49.135Z"
}
```

#### 200: Success Response - Geofence doesn't match

```json
{
  "success": true,
  "code": 200,
  "message": "The request has been successfully completed.",
  "reference_id": "2d8d1069-cde7-4954-a8e9-3e7684152436",
  "status": "completed",
  "result": {
    "message": "Uploads doesn't match with geofence",
    "extracted_pincode": "625515",
    "pincode_geo_location": {
      "latitude": 9.842162,
      "longitude": 77.38276
    },
    "user_location": {
      "latitude": 9.7,
      "longitude": 77.4
    },
    "distance": "15.94 km",
    "threshold_distance": "1.5 km",
    "matches": false
  },
  "requested_at": "2025-08-26T06:07:13.425Z",
  "completed_at": "2025-08-26T06:07:14.857Z"
}
```

#### 200: InProgress Response

```json
{
  "success": true,
  "code": 200,
  "message": "The request is being processed. Please wait for completion.",
  "reference_id": "c3d101d4-c9ec-48df-a25f-60354ec78c78",
  "status": "in_progress",
  "requested_at": "2024-04-22T04:47:39.590Z"
}
```

#### 400: Validation Error Response

```json
{
  "success": false,
  "code": 400,
  "message": "Only jpg/png types image are allowed",
  "error": {
    "message": "Invalid image type",
    "field": "file",
    "code": "BAD_REQUEST"
  }
}

{
  "success": false,
  "code": 400,
  "message": "File is required",
  "error": {
    "message": "Missing Aadhar Image!",
    "field": "file",
    "code": "BAD_REQUEST"
  }
}

{
  "success": false,
  "code": 400,
  "message": "latitude should not be empty",
  "error": {
    "message": "latitude should not be empty",
    "field": "latitude",
    "code": "BAD_REQUEST"
  }
}

{
  "success": false,
  "code": 400,
  "message": "longitude should not be empty",
  "error": {
    "message": "longitude should not be empty",
    "field": "longitude",
    "code": "BAD_REQUEST"
  }
}
```

#### 200: Failure Response

```json
{
  "success": true,
  "code": 200,
  "message": "The request could not be completed due to an error.",
  "reference_id": "2e3f87e4-7be9-425c-9161-59a2cb51abbd",
  "status": "failed",
  "error": {
    "message": "No valid 6-digit PIN found",
    "code": "ERROR"
  },
  "requested_at": "2025-08-26T06:04:04.004Z",
  "completed_at": "2025-08-26T06:04:04.632Z"
}
```

## Check Document Status

### Get document details

`GET` `https://secctrl.tutelar.io/api/v1/kyc/vision/aadhaar_pincode_geofencing`

#### Query parameters description is given below

| Query Parameter | Type   | Is Mandatory | Description           |
| --------------- | ------ | -----------: | --------------------- |
| reference\_id   | String |          Yes | Document reference id |

#### 200: Success Response

```json
{
  "success": true,
  "code": 200,
  "message": "The request has been successfully completed.",
  "reference_id": "f787a54a-e7c4-46af-9f20-f7a4f496ab4b",
  "status": "completed",
  "result": {
    "message": "Uploads matches with geofence",
    "extracted_pincode": "625512",
    "pincode_geo_location": {
      "latitude": 9.6,
      "longitude": 77.3
    },
    "user_location": {
      "latitude": 9.7,
      "longitude": 77.4
    },
    "distance": "1.4 km",
    "threshold_distance": "1.5 km",
    "matches": true
  },
  "requested_at": "2025-08-26T05:34:47.660Z",
  "completed_at": "2025-08-26T05:34:49.135Z"
}
```

#### 200: InProgress Response

```json
{
  "success": true,
  "code": 200,
  "message": "The request is being processed. Please wait for completion.",
  "reference_id": "c3d101d4-c9ec-48df-a25f-60354ec78c78",
  "status": "in_progress",
  "requested_at": "2024-04-22T04:47:39.590Z"
}
```

#### 200: Failure Response

```json
{
  "success": true,
  "code": 200,
  "message": "The request could not be completed due to an error.",
  "reference_id": "2e3f87e4-7be9-425c-9161-59a2cb51abbd",
  "status": "failed",
  "error": {
    "message": "No valid 6-digit PIN found",
    "code": "ERROR"
  },
  "requested_at": "2025-08-26T06:04:04.004Z",
  "completed_at": "2025-08-26T06:04:04.632Z"
}
```


---

# 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://docs.v2.tutelar.io/aadhaar-pincode-geofencing-ocr.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.
