Appearance
Didit Session Decision 接口与字段映射
原始资料:D:/WorkSpace/divs-orch/docs/didit/didit-Retrieve-Session-接口与字段映射.md
LLM 速览
GET /v3/session/{session_id}/decision/ 是 Didit OCR 结果和核验结论的权威查询接口。它返回会话状态、最终 decision、id_verifications[]、phone_verifications[] 以及其他模块结果。当前知识库重点使用 id_verifications[] 映射证件 OCR 字段,并把整份 JSON 保存为审计原文。
1. 接口规约
| 项 | 值 |
|---|---|
| Method | GET |
| Base URL | https://verification.didit.me |
| Path | /v3/session/{session_id}/decision/ |
| 认证 | x-api-key: <DIDIT_API_KEY> |
| 频率限制 | 600 次 / 分钟 / 凭据 |
| 触发方式 | Webhook 缺失 / 异常时补偿查询,也可在终态 webhook 后主动对账 |
2. 顶层状态映射
| Didit status | DIVS status | DIVS decision | 业务含义 |
|---|---|---|---|
Approved + decision=approved | COMPLETED | PASS | 通过 |
Approved + 非 approved | COMPLETED | REJECT | 供应商状态通过但 decision 不放行 |
Declined | COMPLETED | REJECT | 拒绝 |
In Review | COMPLETED | REVIEW | 人工复核 |
Not Started / In Progress / Awaiting User / Resubmitted | IN_PROGRESS | UNKNOWN | App 继续轮询 |
Expired / Kyc Expired / Abandoned | FAILED | UNKNOWN | 需重新发起 Session |
| null / 未知值 | FAILED | UNKNOWN | 无法判断,按失败兜底 |
bizRtnCode 只表达我方是否成功调到 Didit。供应商业务状态由 status、decision 和 sessionStatus 表达。
3. OCR 字段映射
取 id_verifications[] 中对应 workflow 节点的结果。最小映射如下:
| DIVS 字段 | Didit 来源 |
|---|---|
identityFound | 存在有效 id_verifications 节点 |
idNumberVerified | id_verifications[].status == "Approved" |
personalInfo.fullName | full_name |
personalInfo.firstName | first_name |
personalInfo.lastName | last_name |
personalInfo.dob | date_of_birth |
personalInfo.gender | gender |
personalInfo.nationality | nationality |
personalInfo.phoneNumber | phone_verifications[0].full_number |
documentInfo.country | issuing_state,缺失时取 nationality |
documentInfo.idType | document_type |
documentInfo.idNumber | document_number |
documentInfo.idStatus | OCR 节点 status |
documentInfo.expirationDate | expiration_date |
4. 错误与重试
| HTTP 状态 | 含义 | 处理建议 |
|---|---|---|
| 200 | 成功取到决策 | 映射结果并保存原文 |
| 403 | Key 权限不足或跨组织 | 不重试,排查凭据 |
| 404 | Session 不存在或不属于当前应用 | 不重试 |
| 429 | 限流 | 按 Retry-After 或限流 header 重试 |
| 5xx | 供应商服务异常 | 按配置重试,耗尽后降级 |
5. 接入注意事项
- V3 功能模块字段是数组,不能当单字段读取。
- 当前先消费 KYC / OCR 相关字段,其他模块可进入
resultJson做审计保留。 - 媒体 URL 是短期签名链接,不可长期保存 URL 本身。
- webhook 是主路径,Decision 查询是权威补偿和对账手段。