Skip to main content

External Integrations

The Kulpay platform integrates with several external services to provide identity verification, payment processing, file storage, communication, and authentication capabilities.

Integration Architecture

Core Banking: BLNK

BLNK is the core banking engine powering the Kulpay digital wallet. It is not simply a payment adapter — it is the central ledger that manages all wallet balances, identities, and transactions with double-entry accounting guarantees.

CapabilityDescription
Identity ManagementEach customer is linked to a BLNK identity via Account.identity_id
Balance ManagementWallet balances are maintained in BLNK via Account.balance_id
Double-Entry LedgerAll transactions are recorded with debit/credit entries
Transfer ProcessingWallet-to-wallet transfers, deposits, and withdrawals
Balance QueriesReal-time balance lookups
Transaction HistoryFull ledger history for each identity

Technical Decision: BLNK was chosen as the core banking engine rather than building an in-house ledger. This provides battle-tested double-entry accounting, eliminates the risk of balance inconsistencies, and allows Kulpay API to focus on business logic while BLNK handles financial integrity. The Account model in Kulpay API stores only identity_id and balance_id references — all balance state lives in BLNK.

Integration Flow

Identity Verification

LiveAIEngine (Biometrics)

LiveAIEngine provides biometric verification services for the KYC process.

CapabilityDescription
Liveness DetectionVerifies that the selfie is from a live person, not a photo or video
Face MatchingCompares the selfie against the ID document photo
Document OCRExtracts text data from identity documents (name, DOB, ID number, address)

Integration Flow:

NUIB API

The NUIB (National Unified Identification Bureau) API provides government-level identity verification for Mozambican customers.

CapabilityDescription
Identity LookupVerifies customer identity against national records
Data Cross-referenceConfirms name, DOB, and ID number match government data
Compliance CheckRequired for regulatory compliance in Mozambique

Communication

SMS Provider

Used for OTP delivery during customer onboarding and transaction authorization.

Use CaseDescription
Phone VerificationSends 6-digit OTP during account creation
Transaction AuthorizationSends authorization codes for financial operations
KYC NotificationsNotifies customers of KYC status changes
Account NotificationsAccount recharge and transaction confirmations

Storage: Minio

Kulpay API uses a self-hosted Minio instance for all file storage needs. Minio provides an S3-compatible object storage API.

CapabilityDescription
Document StorageID document images (front/back)
Selfie StorageCustomer selfie/liveness images
Profile PicturesCustomer profile photos
Business LogosPartner and bill business logos
File RetrievalBase64-encoded download via file links

Files are organized into buckets and referenced via UploadedFile objects containing file_id, file_bucket, and file_link.

Technical Decision: Minio was chosen over cloud storage providers (S3, GCS) to maintain full data sovereignty. Since Kulpay API processes sensitive identity documents and financial data, self-hosting the file server ensures that all data remains within the partner's infrastructure without external dependencies.

QR Code Service

A standalone microservice developed in-house for QR code generation, scan handling, and customer identification. When a QR code is scanned, the generated link points to this service first — it handles the scan event, performs tracking, and then routes the request to the Kulpay API for resolution.

CapabilityDescription
QR GenerationCreates unique QR codes for customers upon KYC verification
Scan HandlingQR code links resolve to this service, which controls the scan flow before reaching Kulpay API
Scan TrackingRecords when and how many times a QR code is scanned
Customer LookupResolves a QR code to a customer identity for transfers
Agent IntegrationAgents scan customer QR codes for Cash-In and Cash-Out operations
Merchant PaymentsInformal merchants receive QR Code stickers that customers scan to pay

Each customer's qrcode_id field links to their QR code in this service. QR codes serve as a convenient alternative to account numbers for in-person transactions.

Technical Decision: The QR code service was developed as a standalone microservice rather than using a third-party solution to enable deep integration with the customer lifecycle (auto-generation on KYC approval), to control the scan-to-resolution flow, and to add scan tracking analytics that off-the-shelf QR solutions don't provide.

Payment Adapters

Kulpay API uses an adapter pattern to support multiple payment providers through a unified interface. The Instruction Engine routes each instruction to the appropriate adapter based on the payment method type.

Adapter Architecture

Kulpay Adapter (BLNK)

Routes wallet operations to the BLNK core banking engine.

OperationDescription
Balance QueryCheck wallet balance
DepositAdd funds to wallet
TransferSend funds to another wallet
WithdrawalRemove funds from wallet
HistoryRetrieve transaction history

Card Simo Adapter

Handles card-based payment processing through the SIMORede platform.

OperationDescription
ValidationValidate card details
AuthorizationGet transaction authorization
Pay InProcess card payment
Pay OutProcess card payout

Bank Adapter

Traditional banking operations adapter (extensible for multiple bank integrations).

OperationDescription
TransferBank transfer via NIB
BalanceAccount balance query

Technical Decision: The adapter pattern was chosen to decouple transaction processing from specific payment providers. Adding a new payment provider requires implementing a single adapter interface without modifying the instruction engine or any service logic. This makes the system extensible for new banking partners.

Authentication: Keycloak

The Collection API uses Keycloak as its OIDC-compliant identity provider for merchant authentication and authorization via the Hakela dashboard.

CapabilityDescription
User AuthenticationMerchant login via OpenID Connect
Token IssuanceJWT access and refresh tokens
User ManagementMerchant user registration, password recovery
Role-Based AccessFine-grained permissions for merchant portal operations

Integration Points

  • Token Validation — JWTs are validated against Keycloak's JWKS endpoint
  • User Info — User identity extracted from token claims
  • Session Management — End session endpoint for logout flows
  • Token Introspection — Active token verification for server-side flows
  • Token Revocation — Invalidate tokens on logout or security events

Identity providers are managed through the Identity Provider Service.

Webhook Integrations

The Collection API supports event-driven integrations via webhooks for the invoice lifecycle:

EventDirectionDescription
bill-createdBiller → APINew invoice ingested
bill-deliveredAPI → BillerInvoice delivered to payer
bill-openedKulpay App → APICustomer viewed invoice
bill-paidBiller/Bank → APIExternal payment notification
customer-paidKulpay App → APIIn-app payment confirmation
kulpayAPI → Kulpay AppPush notification to customer

See Webhooks & Events for endpoint details and payloads.