Phase C · Information Systems Architecture

AIB Compliance Service API

Version: 1.0
Status: Draft
Last Updated: 2026-06-08


Overview

aib-compliance owns client KYC lifecycle, document verification, sanctions screening, PEP flagging, and EDD workflows.

Primary Tables: client, ubo, document, kyc_review, pep_record, sanctions_screen
Calls: none (source service)
Called By: aib-trading (mandate validation), aib-aml (EDD escalation)


SLA Targets

MetricTargetNotes
KYC Review EndpointP95: 200msHigh-frequency pre-trade gate
Sanctions ScreeningP95: 500msReal-time, external API latency
Document VerificationP95: 1sDepends on image ML processing
Throughput (KYC checks)10,000 req/secPeak onboarding period
Availability99.95%SPG Art. 7 compliance critical

OpenAPI 3.0 Specification

openapi: 3.0.3 info: title: AIB Compliance Service API version: 1.0.0 description: KYC, document verification, sanctions screening, PEP flagging, EDD workflows contact: name: AIB Architecture license: name: Internal servers: - url: https://api.aib.internal/compliance/v1 description: Production paths: /clients/{client_id}: get: summary: Retrieve client KYC status and details operationId: getClient parameters: - name: client_id in: path required: true schema: type: string format: uuid responses: '200': description: Client found content: application/json: schema: $ref: '#/components/schemas/ClientResponse' '404': description: Client not found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' tags: - Clients x-sla: p95_latency_ms: 150 timeout_ms: 500 /clients: post: summary: Initiate KYC onboarding for new client operationId: createClient requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ClientCreateRequest' responses: '201': description: Client created, KYC workflow initiated content: application/json: schema: $ref: '#/components/schemas/ClientResponse' '400': description: Invalid input (e.g., invalid jurisdiction) content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' tags: - Clients x-sla: p95_latency_ms: 300 timeout_ms: 1000 /clients/{client_id}/kyc/review: get: summary: Get current KYC review status operationId: getKycReview parameters: - name: client_id in: path required: true schema: type: string format: uuid responses: '200': description: KYC review details content: application/json: schema: $ref: '#/components/schemas/KycReviewResponse' '404': description: KYC review not found tags: - KYC x-sla: p95_latency_ms: 100 post: summary: Approve or reject KYC review (compliance officer) operationId: updateKycReview parameters: - name: client_id in: path required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/KycReviewUpdateRequest' responses: '200': description: KYC review updated content: application/json: schema: $ref: '#/components/schemas/KycReviewResponse' '400': description: Invalid status transition '403': description: Insufficient permissions (only compliance officer) tags: - KYC x-sla: p95_latency_ms: 200 /clients/{client_id}/documents: post: summary: Upload and verify KYC document (ID, proof of address, etc.) operationId: uploadDocument parameters: - name: client_id in: path required: true schema: type: string format: uuid requestBody: required: true content: multipart/form-data: schema: type: object properties: doc_type: type: string enum: [passport, national_id, driving_license, proof_of_address, proof_of_funds] file: type: string format: binary responses: '201': description: Document uploaded and verification initiated content: application/json: schema: $ref: '#/components/schemas/DocumentResponse' '400': description: Invalid document type or file format '413': description: File too large (max 10MB) tags: - Documents x-sla: p95_latency_ms: 500 get: summary: List all documents for a client operationId: listDocuments parameters: - name: client_id in: path required: true schema: type: string format: uuid responses: '200': description: List of documents content: application/json: schema: type: array items: $ref: '#/components/schemas/DocumentResponse' tags: - Documents x-sla: p95_latency_ms: 150 /clients/{client_id}/sanctions-screen: post: summary: Run real-time sanctions screening (OFAC, UN, EU lists) operationId: runSanctionsScreen parameters: - name: client_id in: path required: true schema: type: string format: uuid requestBody: content: application/json: schema: type: object properties: force_refresh: type: boolean default: false description: Force re-screen even if recent clean screen exists responses: '200': description: Sanctions screen result content: application/json: schema: $ref: '#/components/schemas/SanctionsScreenResponse' '400': description: Invalid client data (missing name/DOB for screening) tags: - Sanctions x-sla: p95_latency_ms: 500 timeout_ms: 2000 /clients/{client_id}/sanctions-screen/{screen_id}: get: summary: Retrieve specific sanctions screen result operationId: getSanctionsScreen parameters: - name: client_id in: path required: true schema: type: string format: uuid - name: screen_id in: path required: true schema: type: string format: uuid responses: '200': description: Sanctions screen details content: application/json: schema: $ref: '#/components/schemas/SanctionsScreenResponse' tags: - Sanctions x-sla: p95_latency_ms: 100 /clients/{client_id}/pep-record: get: summary: Get PEP status and cooling-off period operationId: getPepRecord parameters: - name: client_id in: path required: true schema: type: string format: uuid responses: '200': description: PEP record (if flagged) or empty if not PEP content: application/json: schema: $ref: '#/components/schemas/PepRecordResponse' tags: - PEP x-sla: p95_latency_ms: 100 /clients/{client_id}/ubo: post: summary: Register Ultimate Beneficial Owner (UBO) for corporate client operationId: createUbo parameters: - name: client_id in: path required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/UboCreateRequest' responses: '201': description: UBO registered content: application/json: schema: $ref: '#/components/schemas/UboResponse' '400': description: Invalid ownership % or UBO already exists tags: - UBO x-sla: p95_latency_ms: 200 get: summary: List UBOs for a corporate client operationId: listUbos parameters: - name: client_id in: path required: true schema: type: string format: uuid responses: '200': description: List of UBOs content: application/json: schema: type: array items: $ref: '#/components/schemas/UboResponse' tags: - UBO x-sla: p95_latency_ms: 100 /clients/{client_id}/edd: post: summary: Initiate Enhanced Due Diligence (EDD) review for high-risk client operationId: initiateEdd parameters: - name: client_id in: path required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: type: object properties: reason: type: string enum: [pep_hit, sanctions_hit, high_risk_jurisdiction, aml_alert_escalation] notes: type: string responses: '201': description: EDD initiated, awaiting senior officer review content: application/json: schema: $ref: '#/components/schemas/EddResponse' tags: - EDD x-sla: p95_latency_ms: 300 get: summary: Get EDD status for client operationId: getEdd parameters: - name: client_id in: path required: true schema: type: string format: uuid responses: '200': description: EDD details (or empty if no EDD in progress) content: application/json: schema: $ref: '#/components/schemas/EddResponse' tags: - EDD x-sla: p95_latency_ms: 100 /clients/{client_id}/edd/{edd_id}/approve: post: summary: Senior officer approves EDD review operationId: approveEdd parameters: - name: client_id in: path required: true schema: type: string format: uuid - name: edd_id in: path required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: type: object properties: approved: type: boolean notes: type: string responses: '200': description: EDD decision recorded '403': description: Only senior officer can approve EDD tags: - EDD x-sla: p95_latency_ms: 200 components: schemas: ClientResponse: type: object properties: client_id: type: string format: uuid client_type: type: string enum: [individual, corporate] kyc_status: type: string enum: [pending, under_review, approved, rejected, terminated] kyc_tier: type: string enum: [basic, standard, enhanced] risk_class: type: string enum: [low, medium, high, critical] next_review_date: type: string format: date created_at: type: string format: date-time last_updated_at: type: string format: date-time ClientCreateRequest: type: object required: - first_name - last_name - client_type - country_of_residence properties: first_name: type: string last_name: type: string client_type: type: string enum: [individual, corporate] country_of_residence: type: string date_of_birth: type: string format: date profession: type: string KycReviewResponse: type: object properties: kyc_review_id: type: string format: uuid client_id: type: string format: uuid review_type: type: string enum: [initial, periodic, trigger_based] status: type: string enum: [initiated, documents_pending, under_review, approved, rejected] next_review_due: type: string format: date reviewed_by: type: string description: Compliance officer who approved created_at: type: string format: date-time KycReviewUpdateRequest: type: object required: - status - reviewed_by properties: status: type: string enum: [approved, rejected] notes: type: string description: Rejection reason or approval notes DocumentResponse: type: object properties: document_id: type: string format: uuid doc_type: type: string verification_status: type: string enum: [pending, verified, failed, requires_resubmission] verified_at: type: string format: date-time retain_until: type: string format: date SanctionsScreenResponse: type: object properties: screen_id: type: string format: uuid status: type: string enum: [pass, hit, review_required] decision: type: string enum: [clear, blocked, escalated_to_compliance] hit_details: type: array items: type: object properties: list_name: type: string enum: [OFAC, UN, EU, FATF, FIU_LI] match_score: type: number description: type: string screened_at: type: string format: date-time PepRecordResponse: type: object properties: pep_status: type: string enum: [not_pep, current_pep, former_pep, cooling_off] pep_category: type: string enum: [head_of_state, government_official, military, judicial, central_bank, other] cooling_off_until: type: string format: date nullable: true UboCreateRequest: type: object required: - first_name - last_name - ownership_pct properties: first_name: type: string last_name: type: string ownership_pct: type: number minimum: 25 maximum: 100 country_of_residence: type: string UboResponse: type: object properties: ubo_id: type: string format: uuid client_id: type: string format: uuid ownership_pct: type: number pep_status: type: string created_at: type: string format: date-time EddResponse: type: object properties: edd_id: type: string format: uuid client_id: type: string format: uuid reason: type: string status: type: string enum: [initiated, under_review, approved, rejected] approved_by: type: string nullable: true approved_at: type: string format: date-time nullable: true ErrorResponse: type: object properties: error_code: type: string error_message: type: string request_id: type: string format: uuid timestamp: type: string format: date-time

Integration Points

Calls to Other Services

  • None — source service for KYC data

Called By

  • aib-trading: Validate mandate eligibility (GET /clients/{client_id}?check_kyc_status=true)
  • aib-aml: Escalate AML alert to EDD (POST /clients/{client_id}/edd)

Event Publishing

  • client.created — triggers AML baseline screening
  • kyc_review.completed → client.approved — triggers account opening eligibility
  • pep_record.created — triggers EDD initiation
  • sanctions_screen.hit — triggers compliance officer notification

Error Handling

StatusScenarioAction
400Missing required fields, invalid client_typeReject, return field-level errors
403Non-compliance officer tries to approve KYCReject, log attempted escalation
404Client not foundReturn 404, do not create auto
409Duplicate UBO (same % ownership)Return conflict, client must delete first
500Sanctions screening API timeoutRetry with exponential backoff, max 2 retries; escalate if persistent

Regulatory Compliance

RegulationRequirementImplementation
SPG Art. 7KYC documentation verificationDocument upload + verification status tracking
SPG Art. 8Periodic KYC review (2–3 years)kyc_review.next_review_due triggers batch job
SPG Art. 2 lit. nPEP cooling-off period (12 months)pep_record.cooling_off_until enforced at account-opening gate
SPG Art. 18Sanctions screening at onboardingPOST /sanctions-screen mandatory before KYC approval
EU 5AMLDUBO disclosure for ≥25% ownershipPOST /clients/{id}/ubo with ownership_pct validation

References

Referenced by