Payment Orchestration & Reconciliation API (Go)
Go-based fintech backend for payment orchestration—virtual accounts, QRIS, disbursements, provider webhooks, ledger-style transaction records, and automated reconciliation between gateway settlements and internal books.
Overview
Built the core payment platform for a digital finance product that processes collections and payouts at scale. The system sits between merchant-facing applications and multiple payment rails (virtual account, QRIS, bank transfer callbacks, and disbursement APIs). Written in Go for strong concurrency, clear error handling, and safe money movement. It exposes REST APIs for creating payment instructions, ingests asynchronous provider webhooks, maintains an append-only transaction ledger, runs daily reconciliation against provider settlement files, and surfaces exception queues for finance operations. Designed for idempotency, auditability, and regulatory-friendly traceability of every rupiah in and out.
The Challenge
Payment flows were fragmented across manual bank checks, spreadsheets, and ad-hoc scripts. Provider callbacks arrived out of order or duplicated, causing double-credits and painful month-end closes. Finance could not trust real-time balances, dispute resolution took days, and there was no single API for merchants to create VA/QRIS or trigger disbursements. Peak collection windows (payroll days, campaign launches) exposed race conditions in the legacy stack. Onboarding a new payment channel meant risky, tightly coupled changes instead of a pluggable integration layer.
The Solution
Designed a Go microservice platform with bounded contexts for collections, disbursements, ledger, and reconciliation. Standardized payment intents with idempotency keys and state machines (pending → paid → settled / failed). Implemented provider adapters behind a common interface for VA generation, QRIS issuance, and payout initiation. Webhook handlers verify signatures, persist raw payloads, and apply events exactly once using database constraints and Redis deduplication. Introduced a double-entry style ledger for balances and fees, plus a reconciliation engine that matches provider reports to internal transactions and flags mismatches. Added admin APIs and dashboards hooks for finance to approve holds, retry payouts, and export audit trails.
Results & Impact
- Processes Rp 5B+ in monthly payment volume across collections and disbursements
- 99.95% webhook processing success with idempotent, exactly-once semantics
- Reduced month-end reconciliation time from 3 days to under 4 hours
- Sub-200ms p95 latency for payment intent creation APIs under load
- Zero duplicate-credit incidents after ledger and idempotency hardening
- Onboarded 4+ payment channels through adapter modules without core rewrites
- Automated 90%+ of settlement matching; exceptions routed to finance queue
- Dispute resolution improved with full audit trail per transaction reference
- Platform uptime 99.9% during peak collection windows
- Finance team gained real-time visibility into float, fees, and unsettled items
Key Features
- Payment intent API with idempotency keys and status polling
- Virtual Account (VA) creation and expiration per merchant/order
- QRIS dynamic QR generation and payment status callbacks
- Disbursement / payout API with beneficiary validation
- Multi-provider adapter architecture (collections & payouts)
- Webhook endpoints with HMAC verification and deduplication
- Append-only transaction ledger with fee and tax line items
- Merchant balance, hold, and settlement account modeling
- Daily reconciliation jobs against provider settlement reports
- Exception queue for unmatched, late, or duplicate settlements
- Refund and reversal workflows with audit trail
- Rate limiting, request signing, and API key management for merchants
- Admin APIs for manual adjustment, retry payout, and export
- Reporting: gross volume, success rate, float, unsettled balance
- Sandbox environment mirroring production provider behavior
Want to build a system like these?
From ERP and logistics to web and mobile apps—I can help you design and build it. Get in touch to discuss your project.
Discuss your project