Identity Verification設定ガイド
このドキュメントの目的
Identity Verification(身元確認/eKYC)の設定方法を理解します。
所要時間
⏱️ 約20分
Identity Verificationとは
Identity VerificationはeKYC(electronic Know Your Customer)や本人確認プロセスを管理する機能です。
ユースケース:
- 顔認証による本人確認
- 身分証明書の検証
- 口座情報による本人確認
- VIPステータス確認
設定ファイル構造
identity-verification/face-verification.json
{
"id": "ed5c1717-98eb-4415-898d-6d4584810b5e",
"type": "face-verification",
"attributes": {
"label": "顔認証",
"provider": "external-provider"
},
"processes": {
"start": {
"execution": {
"type": "http_request",
"http_request": {
"url": "${VERIFICATION_API_URL}/verify/start",
"method": "POST",
"auth_type": "oauth2",
"oauth_authorization": {
"type": "client_credentials",
"token_endpoint": "${AUTH_URL}/token",
"client_id": "${CLIENT_ID}",
"client_secret": "${CLIENT_SECRET}"
}
}
},
"store": {
"application_details_mapping_rules": [
{
"from": "$.response_body.session_id",
"to": "verification_session.id"
}
]
},
"response": {
"body_mapping_rules": [
{
"from": "$.response_body.session_id",
"to": "session_id"
}
]
}
},
"check-status": {
"execution": {
"type": "http_request",
"http_request": {
"url": "${VERIFICATION_API_URL}/verify/status",
"method": "POST"
}
},
"transition": {
"approved": {
"any_of": [
[
{
"path": "$.response_body.status",
"type": "string",
"operation": "eq",
"value": "verified"
}
]
]
},
"rejected": {
"any_of": [
[
{
"path": "$.response_body.status",
"type": "string",
"operation": "eq",
"value": "failed"
}
]
]
}
}
}
}
}
主要なフィールド
基本情報
| フィールド | 必須 | 説明 |
|---|---|---|
id | ✅ | 設定ID(UUID) |
type | ✅ | 確認タイプ(任意の文字列) |
attributes | ❌ | 属性情報 |
processes | ✅ | プロセス定義 |
Processesセクション
各プロセス(start, check-status, cancel等)を定義:
{
"processes": {
"start": {...},
"check-status": {...},
"cancel": {...}
}
}
動的API生成:
POST /{tenant-id}/v1/me/identity-verification/applications/{type}/start
POST /{tenant-id}/v1/me/identity-verification/applications/{type}/check-status
POST /{tenant-id}/v1/me/identity-verification/applications/{type}/cancel
Processオブジェクト
各プロセスは7つのフェーズで構成:
| フェーズ | 説明 | 必須 |
|---|---|---|
request | リクエストスキーマ定義 | ❌ |
history | pre_hook フェーズ(verifications / additional_parameters)に渡す過去申込み read model の取得条件(詳細) | ❌ |
pre_hook | 実行前処理(verifications / additional_parameters)。application 経路(apply/process)・callback 経路の両方で実行される | ❌ |
execution | メイン処理(外部API呼び出し等)。省略時は no_action(サーバ側で実行する処理なし)。結果が外部から push されるコールバックプロセス等は省略可 | ❌ |
post_hook | 実行後処理 | ❌ |
transition | ステータス遷移条件 | ❌ |
store | 結果保存 | ❌ |
response | レスポンスマッピング | ❌ |
プロセス依存関係とシーケンス制御
複数のプロセスを順序立てて実行する必要がある場合、dependenciesフィールドで実行順序を制御できます。
dependencies フィールド
各プロセスにdependenciesを設定することで、前提となるプロセスの完了を必須化し、リトライポリシーを制御できます。
設定項目:
| フィールド | 型 | 説明 | 必須 |
|---|---|---|---|
required_processes | string[] | このプロセスを実行する前に完了が必要なプロセス名のリスト | ❌ |
allow_retry | boolean | プロセスの再実行を許可するか (true: 許可, false: 不可) | ✅ |
設定例
{
"processes": {
"apply": {
"dependencies": {
"required_processes": [],
"allow_retry": false
},
"pre_hook": {
"verifications": [
{
"type": "process_sequence"
}
]
},
"execution": {
"type": "no_action"
}
},
"crm-registration": {
"dependencies": {
"required_processes": ["apply"],
"allow_retry": false
},
"pre_hook": {
"verifications": [
{
"type": "process_sequence"
}
]
},
"execution": {
"type": "http_request",
"http_request": {
"url": "${CRM_API_URL}/register",
"method": "POST"
}
}
},
"request-ekyc": {
"dependencies": {
"required_processes": ["crm-registration"],
"allow_retry": true
},
"pre_hook": {
"verifications": [
{
"type": "process_sequence"
}
]
},
"execution": {
"type": "http_request",
"http_request": {
"url": "${EKYC_API_URL}/request",
"method": "POST"
}
}
}
}
}
動作の仕組み
- 依存関係チェック:
required_processesに指定されたプロセスがすべて正常完了している場合のみ実行可能 - リトライ制御:
allow_retry: falseのプロセスは一度だけ実行可能。再実行しようとするとエラー - process_sequence検証:
pre_hook.verificationsにprocess_sequenceタイプを追加することで依存関係を強制
実行順序の例
証券口座開設の3段階プロセス:
# 1. apply(基本情報入力)- 依存なし、リトライ不可
POST /{tenant-id}/v1/me/identity-verification/applications/account-opening/apply
→ 成功 (application_id: "abc-123" を取得)
# 2. crm-registration(CRM登録)- apply完了が必須、リトライ不可
POST /{tenant-id}/v1/me/identity-verification/applications/account-opening/abc-123/crm-registration
→ 成功
# 3. request-ekyc(eKYC実施)- crm-registration完了が必須、リトライ可
POST /{tenant-id}/v1/me/identity-verification/applications/account-opening/abc-123/request-ekyc
→ 成功
# 4. request-ekycの再実行(allow_retry: true のため成功)
POST /{tenant-id}/v1/me/identity-verification/applications/account-opening/abc-123/request-ekyc
→ 成功
エラーケース
依存関係違反:
# applyを実行せずにcrm-registrationを実行
POST /{tenant-id}/v1/me/identity-verification/applications/account-opening/crm-registration
エラーレスポンス:
{
"error": "pre_hook_validation_failed",
"error_messages": [
"Process 'crm-registration' requires completion of: apply"
]
}
リトライ禁止違反:
# apply実行後、再度applyを実行
POST /{tenant-id}/v1/me/identity-verification/applications/account-opening/abc-123/apply