> ## 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.

# 尼日利亚驾照（FRSC）验证 API

> Didit 提供尼日利亚驾照（FRSC）权威数据库查询，基于其身份基础设施。按次计费，起价 $0.20，无合同、无最低消费。

根据 Federal Road Safety Corps 驾照登记库核验尼日利亚驾照。只有驾照号码、姓名和出生日期彼此一致时，登记库才会返回结果。Didit 通过 `POST /v3/database-validation/` 提供此服务，帮助您将提交的数据与权威数据源进行核验，并获得标准化的匹配结果。

## 覆盖范围

* **覆盖率：** \~ 100%
* **国家：** 尼日利亚
* **服务 ID：** `nga_drivers_license`
* **数据域：** 身份
* **类别：** DriverLicence

## 输入字段

| 字段 | 必填 | 示例 |
| - | -: | - |
| `driver_license_number` | 是 | `ABC12345AA12` |
| `first_name` | 是 | `John` |
| `last_name` | 是 | `Doe` |
| `date_of_birth` | 是 | `1990-01-01` |
| `vendor_data` | 否 | `user-1234` |

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

## 请求体参数

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

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

示例：`NGA`

**services** `string` *required* (default: nga\_drivers\_license)

包含此服务 ID 的数组。固定服务 ID 可将请求限定在该特定数据库内。

示例：`nga_drivers_license`

**driver\_license\_number** `string` *required* (default: ABC12345AA12)

驾照号码。

示例：`ABC12345AA12`

**first\_name** `string` *required* (default: John)

需要验证的名字。

示例：`John`

**last\_name** `string` *required* (default: Doe)

需要验证的姓氏。

示例：`Doe`

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

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

示例：`1990-01-01`

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

您为该用户设定的稳定用户标识，例如内部用户 ID。Didit 使用它将单独的检查关联到同一终端用户，并减少重复检测的干扰。

示例：`user-1234`

## 输入规则与核验说明

* `driver_license_number` 必须使用大写字母。
* `driver_license_number` 必须匹配 `[A-Z0-9]{8,20}`。

## 调用方式

```bash cURL theme={null}
curl -X POST "https://verification.didit.me/v3/database-validation/" \
  -H "x-api-key: YOUR_API_KEY" \
  -F "issuing_state=NGA" \
  -F "services=nga_drivers_license" \
  -F "vendor_data=user-1234" \
  -F "driver_license_number=ABC12345AA12" \
  -F "first_name=John" \
  -F "last_name=Doe" \
  -F "date_of_birth=1990-01-01"
```

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

# Reads DIDIT_API_KEY.
client = Didit()

result = client.database_validation.validate(
    issuing_state="NGA",
    services=["nga_drivers_license"],
    first_name="John",
    last_name="Doe",
    date_of_birth="1990-01-01",
    driver_license_number="ABC12345AA12",
    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: "NGA",
  services: ["nga_drivers_license"],
  first_name: "John",
  last_name: "Doe",
  date_of_birth: "1990-01-01",
  driver_license_number: "ABC12345AA12",
  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:        "NGA",
	Services:            didit.Some([]string{"nga_drivers_license"}),
	FirstName:           didit.String("John"),
	LastName:            didit.String("Doe"),
	DateOfBirth:         didit.String("1990-01-01"),
	DriverLicenseNumber: didit.String("ABC12345AA12"),
	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("NGA")
        .services(List.of("nga_drivers_license"))
        .firstName("John")
        .lastName("Doe")
        .dateOfBirth(LocalDate.parse("1990-01-01"))
        .driverLicenseNumber("ABC12345AA12")
        .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' => 'NGA',
    'services' => ['nga_drivers_license'],
    'first_name' => 'John',
    'last_name' => 'Doe',
    'date_of_birth' => '1990-01-01',
    'driver_license_number' => 'ABC12345AA12',
    '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: "NGA",
  services: ["nga_drivers_license"],
  first_name: "John",
  last_name: "Doe",
  date_of_birth: "1990-01-01",
  driver_license_number: "ABC12345AA12",
  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 = "NGA",
    Services = new string[] { "nga_drivers_license" },
    FirstName = "John",
    LastName = "Doe",
    DateOfBirth = "1990-01-01",
    DriverLicenseNumber = "ABC12345AA12",
    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": "NGA",
  "match_type": "full_match",
  "validations": [
    {
      "outcome_code": "MATCH",
      "service_id": "nga_drivers_license",
      "service_name": "Nigeria Driver's Licence (FRSC)",
      "source_data": {
        "date_of_birth": "1990-01-01",
        "first_name": "John",
        "identification_number": "SAMPLE-ID-12345",
        "last_name": "Doe"
      },
      "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": "NGA",
  "match_type": "partial_match",
  "validations": [
    {
      "outcome_code": "PARTIAL_MATCH",
      "service_id": "nga_drivers_license",
      "service_name": "Nigeria Driver's Licence (FRSC)",
      "source_data": {
        "date_of_birth": "1990-01-01",
        "first_name": "John",
        "identification_number": "SAMPLE-ID-12345",
        "last_name": "Doe"
      },
      "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": "NGA",
  "match_type": "no_match",
  "validations": [
    {
      "outcome_code": "NO_MATCH",
      "service_id": "nga_drivers_license",
      "service_name": "Nigeria Driver's Licence (FRSC)",
      "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"
      }
    }
  ]
}
```

**`DOCUMENT_NOT_FOUND`**：提交的证件号码在登记库中没有对应记录。

```json 200 OK — DOCUMENT_NOT_FOUND theme={null}
{
  "request_id": "req_01H…",
  "status": "Declined",
  "issuing_state": "NGA",
  "match_type": "no_match",
  "validations": [
    {
      "outcome_code": "DOCUMENT_NOT_FOUND",
      "service_id": "nga_drivers_license",
      "service_name": "Nigeria Driver's Licence (FRSC)",
      "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` 中实际返回的字段取决于登记库的返回内容。`nga_drivers_license` 的自动生成示例目前记录了以下标准化结构：

* `date_of_birth`
* `first_name`
* `identification_number`
* `last_name`

## 定价与 SLA

仅当 Didit 从核验源收到确定性结果时，才对尼日利亚驾照（FRSC）查询计费。

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

## 延伸阅读

* [尼日利亚数据库核验概览](https://docs.didit.me/api-reference/database-validation/nigeria.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.