KYC
KYC (Know Your Customer) verifies a user’s identity through Plaid Identity Verification during installment-loan onboarding. Callers reach these endpoints through the User Service. Sessions are stored as Identity Verification rows and finalized asynchronously by Plaid webhooks.
KYC Statuses
kyc_status |
Meaning | Set by |
|---|---|---|
|
Session created; user has not finished the in-app steps. |
Session creation (Plaid’s initial status) |
|
User finished the in-app steps; awaiting Plaid’s decision. |
Completed endpoint |
|
Manual review required. |
Webhook |
|
Verification passed. |
Webhook |
|
Verification failed; a rejected loan application is created in the LOC Service. |
Webhook |
|
Session expired before completion. |
Webhook |
|
Session canceled. |
Webhook |
Source: pkg/miner/kyc.go, pkg/api/kyc.go
Watchlist Statuses
watchlist_status |
Meaning | Set by |
|---|---|---|
|
Screening in progress. |
Session creation |
|
No watchlist match. |
Webhook |
|
Match requires manual review. |
Webhook |
|
Watchlist match. |
Webhook |
Source: pkg/miner/kyc.go
Steps
idv_steps records Plaid’s status string for each of accept_tos, verify_sms, kyc_check, documentary_verification, selfie_check, watchlist_screening, risk_check. Source: pkg/dynamo/identity_verification.go.
Session Flow
-
POST /{user_id}/transactions/kyccreates a session at Plaid from the user’s name, address, phone, email, and template id (is_retrycreates a retry session instead). A row is saved unless one already exists for the returned session id.201. -
POST /{user_id}/transactions/kyc/linkreturns a Link token for the latest session’s template;404when the user has no session. -
The app runs the Plaid flow, then calls
POST /{user_id}/transactions/kyc/completed. Anactivesession becomesprocessing; any other status is returned unchanged.404when the user has no session. -
Plaid sends
IDENTITY_VERIFICATIONandSCREENINGwebhooks; the miner updates the row (Webhooks). -
GET /{user_id}/transactions/kycreturns the latest session;404when none.
POST /qa/{user_id}/transactions/kyc/create (test only) writes a row directly.
Webhooks
Handled by the miner before item lookup — Miner Routing.
| Webhook | Action |
|---|---|
|
Fetch the session from Plaid; create or update the row (status, steps, watchlist id, timestamps). |
|
Fetch the watchlist screening from Plaid; find the row by watchlist id (GSI2); set |
Source: pkg/miner/kyc.go