PROJECT STUDY
Ledger & Reconciliation
Every rupiah traced, every gap explained.
Payment reconciliation for QRIS, virtual account and e-wallet channels: verified webhooks on an append-only double-entry ledger, statements and settlement reports matched with reasons, and exceptions closed by journal.
Explore the build
At a glance
- Industry
- Finance
- Capabilities
- 7
- Technologies
- 12
- Year
- 2026
The challenge
A merchant paid through QRIS, bank virtual accounts and e-wallets sees every rupiah three times: as a payment webhook, as a line in a settlement report and as a credit on the bank statement.
Providers settle in batches, net of the merchant discount rate and often a day later, webhooks arrive twice, late or out of order, and bank descriptions get truncated, so finance teams end up matching spreadsheets by hand.
The work needs more than a match rate. Every figure in a cash report has to lead back to the journal that produced it, and every correction has to leave a trail an auditor can follow.
What we built
Ledger & Reconciliation is one TypeScript product that connects payment webhooks, a double-entry ledger, statement matching and an exceptions inbox, with a web workbench where the finance team decides what the engine suggests.
An append-only, double-entry ledger
An 18-account chart in whole rupiah, journals whose postings must sum to zero, reversals as the only correction, an idempotency key on every write, and balances at any point in time, including as the ledger knew them at an earlier moment
Verified payment webhooks
Three provider profiles, a QRIS acquirer, a bank virtual account and an e-wallet, each with its own HMAC signature scheme. Forged or stale requests are refused, a redelivery is absorbed, and events are applied by a payment state machine that reaches the same end state whatever order they arrive in
Statement and settlement imports
Bank statements as CSV or MT940, checked for totals, running balances, continuity and duplicate files, and provider settlement reports in two layouts, where each batch posts a settlement journal with the contracted fee and any variance
Matching that explains itself
Reference, provider cut-off window, fuzzy amount and date, and bounded subset-sum tiers. Every proposal carries its reasons and a confidence, and only near-certain matches confirm themselves
An exceptions inbox
Unmatched lines, amount mismatches, duplicates and late settlements are assigned, given a resolution that fits their kind and the direction of the money, previewed as the adjusting journal they will post, and resolved once
Reports read from the ledger
The daily cash position at the bank, in transit and owed by providers, the fee each channel paid against its contracted rate, and the ageing of unreconciled items, with cash and fee figures that open their journals
A workbench for the finance team
Statement lines beside ledger items with the reasons for each match, plus a journal explorer, payments and webhooks, imports and reports, with filters and the selected row kept in the URL so every view can be linked
An append-only, double-entry ledger
An 18-account chart in whole rupiah, journals whose postings must sum to zero, reversals as the only correction, an idempotency key on every write, and balances at any point in time, including as the ledger knew them at an earlier moment
Verified payment webhooks
Three provider profiles, a QRIS acquirer, a bank virtual account and an e-wallet, each with its own HMAC signature scheme. Forged or stale requests are refused, a redelivery is absorbed, and events are applied by a payment state machine that reaches the same end state whatever order they arrive in
Statement and settlement imports
Bank statements as CSV or MT940, checked for totals, running balances, continuity and duplicate files, and provider settlement reports in two layouts, where each batch posts a settlement journal with the contracted fee and any variance
Matching that explains itself
Reference, provider cut-off window, fuzzy amount and date, and bounded subset-sum tiers. Every proposal carries its reasons and a confidence, and only near-certain matches confirm themselves
An exceptions inbox
Unmatched lines, amount mismatches, duplicates and late settlements are assigned, given a resolution that fits their kind and the direction of the money, previewed as the adjusting journal they will post, and resolved once
Reports read from the ledger
The daily cash position at the bank, in transit and owed by providers, the fee each channel paid against its contracted rate, and the ageing of unreconciled items, with cash and fee figures that open their journals
A workbench for the finance team
Statement lines beside ledger items with the reasons for each match, plus a journal explorer, payments and webhooks, imports and reports, with filters and the selected row kept in the URL so every view can be linked
How it works
Payments into the ledger
Each webhook is verified against its raw body before anything is parsed, then stored once per provider event in an inbox. A state machine applies it whatever order events arrive in and parks a refund that comes before its payment. The payment change, its event and an outbox message commit in one transaction, and the outbox relay posts the capture or refund journal to the ledger in order.
Statements into matches
Settlement reports post a journal per batch and are matched to captured payments by provider transaction. Bank statements then go to the matching engine, which pairs each credit with expected items in tiers: a reference in the description, the provider's cut-off window, a fuzzy amount and date, and finally a bounded subset-sum for a credit that settles several items at once.
Exceptions into journals
Whatever the engine cannot settle becomes an exception: unmatched, amount mismatch, duplicate or late. A person assigns it, picks a resolution such as a bank charge, a provider claim or a write-off, checks the adjusting journal it will post and resolves it. An unmatched or late item that matches later closes itself, with the matching journal as its resolution.
Reports from postings
Balances are sums of postings, read as of any moment and, when needed, as the ledger knew them at an earlier one. The daily cash position, the fee analysis per channel and the ageing of unreconciled items are built from the same postings and reconciliation records.
Engineering insights
Money rules are enforced where they cannot be skipped: in the database, at the webhook boundary and in property-based tests.
Stack by layer
- Frontend
- React
- TypeScript
- Vite
- React Router
- TanStack Query
- Tailwind CSS
- Lucide icons
- SVG charts
- Backend
- Node.js
- TypeScript
- Hono
- Zod
- ts-pattern
- Data
- PGlite (PostgreSQL)
- Drizzle ORM
- PL/pgSQL triggers
- CSV and MT940 parsers
- Infrastructure
- Vitest
- fast-check
- Playwright
- Testing Library
- Biome
- esbuild
Balance checked in code and again at commit
Amounts are whole rupiah in bigint columns, never floating point. A journal is validated in TypeScript before it is written, then deferred PostgreSQL constraint triggers check at commit that its postings sum to zero and that a reversal mirrors its original, while other triggers refuse any update, delete or truncate. A retried write with the same idempotency key returns the stored journal, and the same key with a different request is refused as a conflict
Each webhook reaches the ledger once
Signatures are compared in constant time inside a timestamp tolerance of 300 seconds by default, a rejected delivery is logged by the SHA-256 hash of its body rather than the body itself, and the inbox is unique per provider event. Capture journals are keyed by the provider's transaction, so a relay that crashes after publishing still posts one journal
Batches explained by windows and subset-sum
A provider payout is paired with the payments captured in that provider's cut-off window, and when the totals differ a bounded search adds or removes up to four payments captured within three hours of the cut-off. A credit that no earlier tier explains goes to a subset-sum search over at most 24 candidates, 2 to 5 items and 250,000 nodes, which finds the fewest open items it settles and flags equal combinations as ambiguous. Only proposals at 950 per mille or above confirm themselves; the rest wait as suggestions with their reasons
Fee surcharges surface as a variance
Settlement journals book each channel's fee at the contracted rate and post any difference to a fee variance account, so the fee report compares what each channel charged with its contract, and settlement matching raises the difference as an amount mismatch for a person to resolve
Properties, not only examples
Thirteen fast-check properties check, among other things, that every journal balances, that a balance at any instant equals the postings effective by then, that reversing any subset of journals restores every balance, that webhook events reach the same end state in any order and that matching never uses a statement line twice. The server tests run against a real PGlite database, so triggers, unique indexes and transactions are exercised rather than mocked
Design system
Ledger precise is calm, numerical and auditable, made for people who sign off money: one navy ink on a paper ground, amounts that line up, and colour only where it says something about state.
Colour palette
- Navy ink
#0b2545Text, figures, primary buttons, the sidebar and focus outlines - Paper
#f7f9fcPage background behind white cards and tables - Line
#dbe2eaHairline borders, row dividers and the chart grid - Matched mint
#0f9d7aMatched state, as an icon beside its label and never as text - Suggested amber
#c27c0eSuggestions waiting for a decision, as an icon beside its label and never as text - Exception red
#c0362cExceptions, errors and destructive actions, never the sign of an amount - Ramp blue
#3f74b8Cash in transit and the effective fee rate bars, one step of the single blue chart ramp
Colour
Navy carries text, primary actions and the sidebar, and mint, amber and red appear only on status: matched, suggested and exception. Mint and amber stay below text contrast on white, so they mark icons beside a navy label and never set text, and the cash and ageing charts use one blue ramp so they never compete with a status hue
Typography
Inter Variable for the interface and JetBrains Mono Variable for journal numbers, batch ids, transaction ids and virtual account numbers, both bundled through Fontsource. Every amount sits in right-aligned tabular figures with Indonesian grouping, such as Rp 1.250.000
Components
In-house React components on Tailwind CSS v4 tokens: buttons, rupiah amounts, status badges with icons, a confidence meter on a native meter element, KPI tiles, segmented filters, dense tables, a postings table that checks debits equal credits, and hand-drawn SVG charts with a table view
Traceability and access
Key figures link to the journals behind them, and status is never colour alone. Every action is a native control with a visible focus outline, motion respects the reduced-motion setting, and a test fails if the CSS and TypeScript tokens disagree or a text pairing drops below its contrast floor
Where this fits
Any business that takes payments through several channels can start from the same foundation: a ledger that cannot be unbalanced and matching that explains itself. Explore our business systems and web apps, or talk to us about your reconciliation process.
Inside the project
Screens from the production build, captured at 1440 by 900 with the seeded synthetic data set: the company, the people, the payments and every reference are fictional.
The workbench: an e-wallet payout matched to a batch of payments by subset-sum, with the reasons and confidence a person checks before confirming.View larger The exceptions inbox: an amount mismatch on a QRIS settlement, assigned to a person, with the resolutions that fit it and the adjusting journal it will post.View larger The journal explorer: a QRIS settlement batch journal with its postings, fee variance and idempotency key, which can be corrected only by a reversal.View larger Reports: where the cash sits each day, at the bank, in transit or owed by providers, and what each channel really paid against its contracted rate.View larger
KEEP EXPLORING
Another problem. A different approach.

AI Customer Service
A marketplace and food-delivery support platform connecting cited AI answers, policy-checked tools, human handoff, an agent CRM and a versioned knowledge CMS.

Logistics Intelligent
A dispatch and supply-planning system for delivery routes, fleet disruptions and retail replenishment across multiple warehouses.
Let’s connect the dots
Let's put these ideas to work.
Share a process, product, or problem you want to improve. We will work through the possibilities together.