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

# 美国金融服务数据库核验 API

> 美国金融服务：通过 Didit 调用美国权威数据库进行查询核验，按次付费，单次调用低至 $0.20，无合同，无最低消费。

汇集政府和公共记录、背景记录及其他服务的聚合服务。Didit 通过 `POST /v3/database-validation/` 提供该服务，便于您将提交的数据与权威来源进行核验，并获得标准化的匹配结果。

## 覆盖范围

* **覆盖范围：** \~ 85%
* **国家/地区：** 美国
* **服务 ID：** `usa_states_financial_services`
* **数据领域：** 金融
* **类别：** FinancialServices

## 输入参数

| 字段 | 必填 | 示例 |
| - | -: | - |
| `first_name` | 是 | `John` |
| `last_name` | 是 | `Doe` |
| `date_of_birth` | 是 | `1990-01-01` |
| `address.street_1` | 否 | `123 Sample Street` |
| `address.street_2` | 否 | `Unit 4` |
| `address.city` | 否 | `Sample City` |
| `address.region` | 否 | `Sample State` |
| `address.postal_code` | 否 | `10001` |
| `phone` | 否 | `+15550101000` |
| `ssn` | 否 | `123456789` |
| `email` | 否 | `john.doe@example.com` |
| `vendor_data` | 否 | `user-1234` |

* **必填输入：** `first_name`、`last_name`、`date_of_birth`
* **可选输入：** `address.street_1`、`address.street_2`、`address.city`、`address.region`、`address.postal_code`、`phone`、`ssn`、`email`、`vendor_data`
* **同意：** 无需
* **工作流可用性：** 可在工作流中使用
* **覆盖范围：** \~ 85%
* **价格：** 每次成功的查询 \$0.20

## 请求体参数

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

该数据库服务所使用的 ISO 3166-1 alpha-3 国家/地区代码。

示例：`USA`

**services** `string` *required* (default: usa\_states\_financial\_services)

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

示例：`usa_states_financial_services`

**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`

**address** `object`

结构化住宅地址对象。请使用 `street_1`、`street_2`、`city`、`region`、`postal_code` 和 `country`。仍接受完整的旧版地址字符串，但不推荐使用。

示例：`{"street_1":"123 Sample Street","street_2":"Unit 4","city":"Sample City","region":"Sample State","postal_code":"10001","country":"US"}`

**phone** `string`

国际格式的电话号码。

示例：`+15550101000`

**ssn** `string`

该数据库服务所需的 `ssn` 值。

示例：`123456789`

**email** `string`

电子邮件地址。

示例：`john.doe@example.com`

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

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

示例：`user-1234`

## 输入规则与校验说明

* 此服务中 `address` 为可选项。您可以发送一个完整的 `address` 字符串，Didit 会在可能时将其拆分为结构化地址元素；您也可以明确发送结构化字段。
* 美国社会安全号码（SSN）或个人纳税人识别号（ITIN）：完整 9 位数字（可省略连字符），或仅后 4 位数字
* `ssn` 必须匹配 `(?:\d{9}|\d{3}-\d{2}-\d{4}|\d{4})`。
* 对于 `ssn`，请提供完整的 9 位 SSN/ITIN（可省略连字符），或仅提供其后 4 位。
* 此服务要求提供 `first_name`、`last_name` 和 `date_of_birth`，这已满足数据源要求的最低条件，即姓名加一个其他身份字段。可选字段（`ssn`、`address`、`phone`、`email`）可进一步增强匹配效果。
* 对于地址类服务，请尽可能发送结构化地址字段，而不是单个 `address` 字符串。
* `address.street_1` 为街道地址，包括门牌号和街道类型。
* `address.street_2` 为公寓、单元、楼栋、楼层或其他地址行。仅在有该信息时发送。
* `address.city` 为城市、郊区、区、地区或社区。
* `address.region` 为州、省、地区或城镇。
* `address.postal_code` 为邮政编码。
* 基于地址的数据库服务至少需要街道地址和邮政编码；在数据源查询前被拒绝的请求不收费。

## 调用方法

```bash cURL theme={null}
curl -X POST "https://verification.didit.me/v3/database-validation/" \
  -H "x-api-key: YOUR_API_KEY" \
  -F "issuing_state=USA" \
  -F "services=usa_states_financial_services" \
  -F "vendor_data=user-1234" \
  -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="USA",
    services=["usa_states_financial_services"],
    first_name="John",
    last_name="Doe",
    date_of_birth="1990-01-01",
    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: "USA",
  services: ["usa_states_financial_services"],
  first_name: "John",
  last_name: "Doe",
  date_of_birth: "1990-01-01",
  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: "USA",
	Services:     didit.Some([]string{"usa_states_financial_services"}),
	FirstName:    didit.String("John"),
	LastName:     didit.String("Doe"),
	DateOfBirth:  didit.String("1990-01-01"),
	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("USA")
        .services(List.of("usa_states_financial_services"))
        .firstName("John")
        .lastName("Doe")
        .dateOfBirth(LocalDate.parse("1990-01-01"))
        .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' => 'USA',
    'services' => ['usa_states_financial_services'],
    'first_name' => 'John',
    'last_name' => 'Doe',
    'date_of_birth' => '1990-01-01',
    '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: "USA",
  services: ["usa_states_financial_services"],
  first_name: "John",
  last_name: "Doe",
  date_of_birth: "1990-01-01",
  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 = "USA",
    Services = new string[] { "usa_states_financial_services" },
    FirstName = "John",
    LastName = "Doe",
    DateOfBirth = "1990-01-01",
    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": "USA",
  "match_type": "full_match",
  "validations": [
    {
      "outcome_code": "MATCH",
      "service_id": "usa_states_financial_services",
      "service_name": "United States of America - United States Financial Services",
      "source_data": {
        "address": "123 Sample Street",
        "address_match_score": "1.000",
        "city": "Sample City",
        "date_of_birth": "1990-01-01",
        "first_name": "John",
        "full_name": "John Doe",
        "last_name": "Doe",
        "name_match_score": "1.000",
        "postal_code": "10001",
        "state": "Sample State",
        "street": "sample_value",
        "verifications": {
          "date_of_birth": true,
          "full_name": true
        }
      },
      "validation": {
        "date_of_birth": "full_match",
        "full_name": "full_match"
      }
    }
  ]
}
```

**`PARTIAL_MATCH`**：本服务比对的一个或多个字段未完全匹配。在此示例中，`full_name` 不匹配，而 `date_of_birth` 匹配。

```json 200 OK — PARTIAL_MATCH theme={null}
{
  "request_id": "req_01H…",
  "status": "In Review",
  "issuing_state": "USA",
  "match_type": "partial_match",
  "validations": [
    {
      "outcome_code": "PARTIAL_MATCH",
      "service_id": "usa_states_financial_services",
      "service_name": "United States of America - United States Financial Services",
      "source_data": {
        "address": "123 Sample Street",
        "address_match_score": "1.000",
        "city": "Sample City",
        "date_of_birth": "1990-01-01",
        "first_name": "John",
        "full_name": "John Doe",
        "last_name": "Doe",
        "name_match_score": "1.000",
        "postal_code": "10001",
        "state": "Sample State",
        "street": "sample_value",
        "verifications": {
          "date_of_birth": true,
          "full_name": false
        }
      },
      "validation": {
        "date_of_birth": "full_match",
        "full_name": "no_match"
      }
    }
  ]
}
```

**`NO_MATCH`**：登记机构未返回与所提交数据匹配的结果。

```json 200 OK — NO_MATCH theme={null}
{
  "request_id": "req_01H…",
  "status": "Declined",
  "issuing_state": "USA",
  "match_type": "no_match",
  "validations": [
    {
      "outcome_code": "NO_MATCH",
      "service_id": "usa_states_financial_services",
      "service_name": "United States of America - United States Financial Services",
      "source_data": {
        "date_of_birth": "NO_MATCH",
        "full_name": "NO_MATCH"
      },
      "validation": {
        "date_of_birth": "no_match",
        "full_name": "no_match"
      }
    }
  ]
}
```

## 返回数据

`source_data` 中实际呈现的字段取决于登记机构返回的内容。为 `usa_states_financial_services` 生成的示例目前记录了以下标准化结构：

* `address`
* `address_match_score`
* `city`
* `date_of_birth`
* `first_name`
* `full_name`
* `last_name`
* `name_match_score`
* `postal_code`
* `state`
* `street`

## 定价与 SLA

美国 - 美国金融服务查询仅在 Didit 从验证来源收到确定结果时计费。

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

## 继续阅读

* [美国数据库核验概览](https://docs.didit.me/api-reference/database-validation/united-states.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.