> ## Documentation Index
> Fetch the complete documentation index at: https://docs.didit.me/llms.txt
> Use this file to discover all available pages before exploring further.

# 印度 Aadhaar（UIDAI）核验 API：数据比对

> 印度 Aadhaar（UIDAI）：通过 Didit 身份基础设施进行权威的印度数据库核验。按次计费，起价 $0.42，无合同、无最低消费。

对照 UIDAI 身份记录核验输入的 Aadhaar 号码。Didit 通过 `POST /v3/database-validation/` 提供此服务，便于您将提交的数据与权威数据源进行比对，并获得标准化的匹配结果。

## 覆盖范围

* **覆盖率：** \~ 100%
* **国家/地区：** 印度
* **服务 ID：** `ind_aadhaar`
* **数据域：** 身份
* **类别：** NationalIDRegistry

## 输入

| 字段 | 必填 | 示例 |
| - | -: | - |
| `full_name` | 是 | `John Doe` |
| `date_of_birth` | 是 | `1990-01-01` |
| `personal_number` | 是 | `111111111111` |
| `pan` | 是 | `ABCDE1234F` |
| `vendor_data` | 否 | `user-1234` |

* **必填输入：** `full_name`、`date_of_birth`、`personal_number`、`pan`
* **可选输入：** `vendor_data`
* **同意：** 必需
* **工作流可用性：** 可在工作流中使用
* **覆盖率：** \~ 100%
* **价格：** 每次成功查询 \$0.42

并非此服务接受的每种证件都包含用于查询的标识符。若未从证件中提取该标识符，则该检查记录为**不适用**，不会查询任何数据库，也不收费。对某些国家/地区而言，这类情况可能占真实用户的很大比例。为覆盖这些用户，还应从问卷答案、Document AI 提取字段，或您在创建会话时发送的值中收集该标识符，并在数据库核验步骤中进行映射。

## 请求体参数

**issuing\_state** `string` *required* (default: IND)

此数据库服务的 ISO 3166-1 alpha-3 国家代码。

示例：`IND`

**services** `string` *required* (default: ind\_aadhaar)

包含此服务 ID 的数组。固定此服务可将请求限定为仅使用此特定数据库。

示例：`ind_aadhaar`

**consent** `boolean` *required* (default: true)

此服务的终端用户明确同意。

示例：`true`

**full\_name** `string` *required* (default: John Doe)

待验证的完整法定姓名。

示例：`John Doe`

**date\_of\_birth** `string` *required* (default: 1990-01-01)

出生日期，格式为 `YYYY-MM-DD`。

示例：`1990-01-01`

**personal\_number** `string` *required* (default: 111111111111)

特定国家/地区的个人身份号码。

示例：`111111111111`

**pan** `string` *required* (default: ABCDE1234F)

永久账户号码（PAN）。

示例：`ABCDE1234F`

**vendor\_data** `string` (default: user-1234)

您为此人分配的稳定用户标识，例如您的内部用户 ID。Didit 用它将独立检查关联到同一终端用户，从而减少重复检测的干扰。

示例：`user-1234`

## 输入规则与校验说明

* `pan` 必须使用大写字母。
* `pan` 必须匹配 `[A-Z]{5}\d{4}[A-Z]`。
* `personal_number` 只能包含数字；发送请求前请去除空格、连字符和标点符号。
* `personal_number` 长度必须恰好为 12 个字符。

## 调用方法

```bash cURL theme={null}
curl -X POST "https://verification.didit.me/v3/database-validation/" \
  -H "x-api-key: YOUR_API_KEY" \
  -F "issuing_state=IND" \
  -F "services=ind_aadhaar" \
  -F "vendor_data=user-1234" \
  -F "consent=true" \
  -F "full_name=John Doe" \
  -F "date_of_birth=1990-01-01" \
  -F "personal_number=111111111111" \
  -F "pan=ABCDE1234F"
```

```python Python theme={null}
from didit import Didit

# Reads DIDIT_API_KEY.
client = Didit()

result = client.database_validation.validate(
    issuing_state="IND",
    services=["ind_aadhaar"],
    consent=True,
    full_name="John Doe",
    date_of_birth="1990-01-01",
    personal_number="111111111111",
    pan="ABCDE1234F",
    vendor_data="user-1234",
)
print(result)
```

```javascript Node.js theme={null}
import Didit from "@didit-protocol/sdk-node";

// Reads DIDIT_API_KEY.
const didit = new Didit();

const result = await didit.databaseValidation.validate({
  issuing_state: "IND",
  services: ["ind_aadhaar"],
  consent: true,
  full_name: "John Doe",
  date_of_birth: "1990-01-01",
  personal_number: "111111111111",
  pan: "ABCDE1234F",
  vendor_data: "user-1234",
});
console.log(result);
```

```go Go theme={null}
ctx := context.Background()
// Reads DIDIT_API_KEY.
client := didit.NewClient()

result, err := client.DatabaseValidation.Validate(ctx, didit.DatabaseValidationValidateParams{
	IssuingState:   "IND",
	Services:       didit.Some([]string{"ind_aadhaar"}),
	Consent:        didit.Bool(true),
	FullName:       didit.String("John Doe"),
	DateOfBirth:    didit.String("1990-01-01"),
	PersonalNumber: didit.String("111111111111"),
	Pan:            didit.String("ABCDE1234F"),
	VendorData:     didit.String("user-1234"),
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%+v\n", result)
```

```java Java theme={null}
import java.time.LocalDate;
import java.util.List;
import me.didit.Didit;
import me.didit.types.DatabaseValidationValidateParams;

// Reads DIDIT_API_KEY.
Didit client = new Didit();

var result = client.databaseValidation().validate(DatabaseValidationValidateParams.builder()
        .issuingState("IND")
        .services(List.of("ind_aadhaar"))
        .consent(true)
        .fullName("John Doe")
        .dateOfBirth(LocalDate.parse("1990-01-01"))
        .personalNumber("111111111111")
        .pan("ABCDE1234F")
        .vendorData("user-1234")
        .build());
System.out.println(result);
```

```php PHP theme={null}
<?php

require 'vendor/autoload.php';

use Didit\DiditClient;

// Reads DIDIT_API_KEY.
$didit = new DiditClient();

$result = $didit->databaseValidation->validate([
    'issuing_state' => 'IND',
    'services' => ['ind_aadhaar'],
    'consent' => true,
    'full_name' => 'John Doe',
    'date_of_birth' => '1990-01-01',
    'personal_number' => '111111111111',
    'pan' => 'ABCDE1234F',
    'vendor_data' => 'user-1234',
]);
print_r($result->toArray());
```

```ruby Ruby theme={null}
require "didit"

# Reads DIDIT_API_KEY.
didit = Didit::Client.new

result = didit.database_validation.validate(
  issuing_state: "IND",
  services: ["ind_aadhaar"],
  consent: true,
  full_name: "John Doe",
  date_of_birth: "1990-01-01",
  personal_number: "111111111111",
  pan: "ABCDE1234F",
  vendor_data: "user-1234"
)
puts result.to_h
```

```csharp .NET theme={null}
using System;
using System.Text.Json;
using Didit;

// Reads DIDIT_API_KEY.
using var client = new DiditClient();

var result = await client.DatabaseValidation.ValidateAsync(new DatabaseValidationValidateParams
{
    IssuingState = "IND",
    Services = new string[] { "ind_aadhaar" },
    Consent = true,
    FullName = "John Doe",
    DateOfBirth = "1990-01-01",
    PersonalNumber = "111111111111",
    Pan = "ABCDE1234F",
    VendorData = "user-1234",
});
Console.WriteLine(JsonSerializer.Serialize(result));
```

每次成功的调用都返回 HTTP `200`。**`outcome_code`** 字段说明实际发生了什么，例如可区分真正的生物识别不匹配（`BIOMETRIC_NO_MATCH`）与无法读取的自拍照（`BIOMETRIC_IMAGE_UNUSABLE`）。所示的 `status` 为默认功能状态；您配置的[部分匹配 / 无匹配操作](https://docs.didit.me/zh/core-technology/database-validation/database-validation-warnings.md)可以覆盖该状态。

**`MATCH`**：注册库确认了身份，且所有被检查的字段均已匹配。

```json 200 OK — MATCH theme={null}
{
  "request_id": "req_01H…",
  "status": "Approved",
  "issuing_state": "IND",
  "match_type": "full_match",
  "validations": [
    {
      "outcome_code": "MATCH",
      "service_id": "ind_aadhaar",
      "service_name": "India Aadhaar (UIDAI)",
      "source_data": {
        "date_of_birth": "1990-01-01",
        "full_name": "John Doe",
        "identification_number": "SAMPLE-ID-12345"
      },
      "validation": {
        "date_of_birth": "full_match",
        "full_name": "full_match",
        "identification_number": "full_match"
      }
    }
  ]
}
```

**`PARTIAL_MATCH`**：找到了身份号码，但一个或多个个人字段（通常是姓名或出生日期）未完全匹配。

```json 200 OK — PARTIAL_MATCH theme={null}
{
  "request_id": "req_01H…",
  "status": "In Review",
  "issuing_state": "IND",
  "match_type": "partial_match",
  "validations": [
    {
      "outcome_code": "PARTIAL_MATCH",
      "service_id": "ind_aadhaar",
      "service_name": "India Aadhaar (UIDAI)",
      "source_data": {
        "date_of_birth": "1990-01-01",
        "full_name": "John Doe",
        "identification_number": "SAMPLE-ID-12345"
      },
      "validation": {
        "date_of_birth": "full_match",
        "full_name": "no_match",
        "identification_number": "full_match"
      }
    }
  ]
}
```

**`NO_MATCH`**：注册库未返回与提交数据匹配的结果。

```json 200 OK — NO_MATCH theme={null}
{
  "request_id": "req_01H…",
  "status": "Declined",
  "issuing_state": "IND",
  "match_type": "no_match",
  "validations": [
    {
      "outcome_code": "NO_MATCH",
      "service_id": "ind_aadhaar",
      "service_name": "India Aadhaar (UIDAI)",
      "source_data": {
        "date_of_birth": "NO_MATCH",
        "full_name": "NO_MATCH",
        "identification_number": "NO_MATCH"
      },
      "validation": {
        "date_of_birth": "no_match",
        "full_name": "no_match",
        "identification_number": "no_match"
      }
    }
  ]
}
```

## 返回数据

实际出现在 `source_data` 中的字段取决于注册库返回的内容。`ind_aadhaar` 的生成示例目前记录了以下标准化结构：

* `date_of_birth`
* `full_name`
* `identification_number`

## 定价与服务等级协议

印度 Aadhaar（UIDAI）查询仅在 Didit 从验证数据源收到结论性结果时计费。

* **单次调用价格：** \$0.42 USD。
* **计费方式：** 按每次成功查询计费。若注册库无法访问、缺少必填字段，或请求在到达数据源之前即被拒绝，则不收费。
* **延迟：** 典型 p95 低于 2 秒。
* **可用性：** Didit 方面每季度的可用性为 99.9%；下游数据源的可用性因国家/地区和数据集而异。

## 继续阅读

* [印度数据库核验概览](https://docs.didit.me/api-reference/database-validation/india.md)
* [数据库核验概览](https://docs.didit.me/zh/core-technology/database-validation/overview.md)
* [结果代码](https://docs.didit.me/zh/core-technology/database-validation/database-validation-outcome-codes.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.