Frontend: KYB/KYC Verification Integration
Depends on: Backend KYB workflow (POST /kyb/session, GET /kyb/status/:organizationId)
Task Description
Connect the frontend to the backend KYB/KYC verification workflow so business users can start verification and see their status before creating high-value / enterprise agreements. The backend exposes a provider-agnostic Identity Provider abstraction; the frontend must consume it without knowing the specific provider.
Background / Current State
- The Thalos frontend already has a shared API client pattern in
lib/api/ (each module reuses an apiRequest/apiClient helper and returns the { success, data, error } shape).
- Business features live in
app/dashboard/business/page.tsx; the profile gating is already based on the business profile check.
- No KYB/KYC UI or client exists yet.
Deliverable
A KYB verification UI flow integrated with the backend endpoints, plus a status gate on enterprise agreement creation.
Requirements
- New
lib/api/kyb.ts client (reusing the shared API client) with:
startKybSession() → POST /kyb/session
getKybStatus(organizationId) → GET /kyb/status/:organizationId
- A verification screen/section that:
- Collects/displays business name, registration number, country.
- Starts a verification session and handles the provider redirect/embedded flow.
- Shows status states:
pending, in_review, verified, rejected.
- A gate: block fund deposits / enterprise agreement creation unless status is
verified, with a clear call to action to complete KYB.
Validation System
- Starting a session calls
POST /kyb/session and transitions the UI to in_review.
- Status polling/refresh reflects
verified/rejected from GET /kyb/status/:organizationId.
- Enterprise agreement creation is blocked when status is not
verified.
Technical Requirements
- Reuse the shared
apiRequest/apiClient (do not create a new fetch helper).
- Keep the UI provider-agnostic (no hardcoded provider assumptions).
- Handle loading/error and expired-session states.
- Gate lives in the business dashboard flow (
app/dashboard/business/page.tsx), consistent with the existing business-profile check.
Additional Notes
Pairs with the backend KYB issue. Individual KYC (person) can reuse the same client pattern if a /kyc/* counterpart exists later.
Testing (required)
Proof of Completion (required)
Frontend: KYB/KYC Verification Integration
Depends on: Backend KYB workflow (
POST /kyb/session,GET /kyb/status/:organizationId)Task Description
Connect the frontend to the backend KYB/KYC verification workflow so business users can start verification and see their status before creating high-value / enterprise agreements. The backend exposes a provider-agnostic Identity Provider abstraction; the frontend must consume it without knowing the specific provider.
Background / Current State
lib/api/(each module reuses anapiRequest/apiClienthelper and returns the{ success, data, error }shape).app/dashboard/business/page.tsx; the profile gating is already based on the business profile check.Deliverable
A KYB verification UI flow integrated with the backend endpoints, plus a status gate on enterprise agreement creation.
Requirements
lib/api/kyb.tsclient (reusing the shared API client) with:startKybSession()→POST /kyb/sessiongetKybStatus(organizationId)→GET /kyb/status/:organizationIdpending,in_review,verified,rejected.verified, with a clear call to action to complete KYB.Validation System
POST /kyb/sessionand transitions the UI toin_review.verified/rejectedfromGET /kyb/status/:organizationId.verified.Technical Requirements
apiRequest/apiClient(do not create a new fetch helper).app/dashboard/business/page.tsx), consistent with the existing business-profile check.Additional Notes
Pairs with the backend KYB issue. Individual KYC (person) can reuse the same client pattern if a
/kyc/*counterpart exists later.Testing (required)
in_review; status refresh reflectsverified/rejected.verified.Proof of Completion (required)
lib/api/kyb.tsreuses the shared API client, not a new fetch helper.