Skip to content

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. 接口规约

MethodGET
Base URLhttps://verification.didit.me
Path/v3/session/{session_id}/decision/
认证x-api-key: <DIDIT_API_KEY>
频率限制600 次 / 分钟 / 凭据
触发方式Webhook 缺失 / 异常时补偿查询,也可在终态 webhook 后主动对账

2. 顶层状态映射

Didit statusDIVS statusDIVS decision业务含义
Approved + decision=approvedCOMPLETEDPASS通过
Approved + 非 approvedCOMPLETEDREJECT供应商状态通过但 decision 不放行
DeclinedCOMPLETEDREJECT拒绝
In ReviewCOMPLETEDREVIEW人工复核
Not Started / In Progress / Awaiting User / ResubmittedIN_PROGRESSUNKNOWNApp 继续轮询
Expired / Kyc Expired / AbandonedFAILEDUNKNOWN需重新发起 Session
null / 未知值FAILEDUNKNOWN无法判断,按失败兜底

bizRtnCode 只表达我方是否成功调到 Didit。供应商业务状态由 statusdecisionsessionStatus 表达。

3. OCR 字段映射

id_verifications[] 中对应 workflow 节点的结果。最小映射如下:

DIVS 字段Didit 来源
identityFound存在有效 id_verifications 节点
idNumberVerifiedid_verifications[].status == "Approved"
personalInfo.fullNamefull_name
personalInfo.firstNamefirst_name
personalInfo.lastNamelast_name
personalInfo.dobdate_of_birth
personalInfo.gendergender
personalInfo.nationalitynationality
personalInfo.phoneNumberphone_verifications[0].full_number
documentInfo.countryissuing_state,缺失时取 nationality
documentInfo.idTypedocument_type
documentInfo.idNumberdocument_number
documentInfo.idStatusOCR 节点 status
documentInfo.expirationDateexpiration_date

4. 错误与重试

HTTP 状态含义处理建议
200成功取到决策映射结果并保存原文
403Key 权限不足或跨组织不重试,排查凭据
404Session 不存在或不属于当前应用不重试
429限流Retry-After 或限流 header 重试
5xx供应商服务异常按配置重试,耗尽后降级

5. 接入注意事项

  • V3 功能模块字段是数组,不能当单字段读取。
  • 当前先消费 KYC / OCR 相关字段,其他模块可进入 resultJson 做审计保留。
  • 媒体 URL 是短期签名链接,不可长期保存 URL 本身。
  • webhook 是主路径,Decision 查询是权威补偿和对账手段。