Every entry balances, or it doesn't post.
Multi-tenant double-entry ledger and banking API, co-built at Omika Labs
Businesses that hold customer money need books that are provably correct. Shiwake is the system of record they run on: one REST API, many tenants, each with fully isolated books.
shiwake.app ↗ Private repo
What it does
Ledger core
Accounts, balanced journal entries, holds, reversals, a running-balance transaction log and reconciliation. It knows nothing about any industry.
Banking layer
Wallet products and wallets, deposits, withdrawals, transfers, fees, limits, suspense, statements and an audit trail. All of it posts through the ledger core.
Who runs on it
- A school-fees operator. Settlements to schools net of commission, payouts and refunds.
- A payroll-linked wallet provider. An employer sponsors one withdrawal per pay cycle.
Both share one deployment. Every row carries a tenant id, enforced by database query filters, and tenant identity comes from an API key or a signed token.
How money flows
Tenants run their own payment-provider integrations and report the outcome to Shiwake, which never calls a provider. The banking layer never writes ledger tables directly; it goes through the ledger's services.
Five money movements
Every movement goes through a typed primitive that writes a banking record and its journal entry in one database transaction, so the banking record is complete by construction.
| Movement | Primitive | Platform float | Wallet | Other wallet | Fee revenue | Fee expense |
|---|---|---|---|---|---|---|
| Customer top-up | Deposit | ▲up | ▲up | ▲ optional fee | ||
| Settlement or commission | Transfer, fee borne by receiver | ▼ amount | ▲ amount minus fee | ▲ fee | ||
| Payout, platform absorbs the provider charge | Withdraw, then confirm with cost bearer Platform | ▼ settled amount | ▼ principal | ▲ charge | ||
| Spend, wallet absorbs the provider charge | Withdraw with reserve, then confirm with cost bearer Wallet | ▼ settled amount | ▼ principal plus charge | |||
| Refund of a settlement | Transfer reverse, one compensating entry | ▲ made whole | ▼ gives it back | ▼ fee returned |
Withdrawals take two steps. Withdraw places a hold and marks the transaction Processing. The tenant pays out through its provider, then confirms (Completed) or cancels (Failed, hold released). Repeating either call is safe; switching from one end state to the other returns 409.
Hard problems
Double-entry enforcement
Risk: an entry that doesn't balance creates or destroys money.
Debits must equal credits in every currency before commit, or the entry is rejected with 422 and leaves no trace. Posted entries are never edited; corrections are linked reversals. Amounts are 64-bit integers in minor units, with no floating point.
Proof on demand: trial balance, and stored balances checked against balances recomputed from entry lines.
Concurrent balance writes
Risk: two concurrent debits read the same balance.
Optimistic concurrency: each balance row carries a version number, and a conflicting write retries a bounded number of times. The running-balance log is written in the same database transaction as the posting.
The review found one account handled about one concurrent write while the rest returned 500. Fixed, and stress scripts now cover write contention.
Idempotent posting
Risk: a retried mobile-money callback credits a wallet twice.
Every write needs an Idempotency-Key (400 without one), and a repeated key replays the original result. Banking rows keep the client key, unique per tenant, plus a derived ledger key that ties them to their journal entry.
Concurrent posts with the same key returned 500 instead of replaying. Fixed and guarded by a regression test.
Overdraft guards
Risk: concurrent transfers overdraw a wallet.
Asset accounts can never go negative, and customer wallets are guarded against overdraft. The check runs inside the same write, against available balance: ledger balance minus active holds.
Concurrent transfers could overdraw the sender. Fixed and guarded by a regression test.
Testing
- 67
- unit and integration tests across posting, reversals, holds, transfers, fees, reconciliation, idempotency and concurrency
- 135
- end-to-end assertions against the real HTTP API, all passing
- 17
- defects found in an August 2026 security and correctness review, each fixed and guarded by a test
- 41 / 42
- requirements shipped; tenant webhook delivery is planned
Limit: tenant webhooks aren't built yet, and the API runs on one Fly.io machine in one region.
Next: launch readiness (webhook delivery, a second machine in a closer region), then a scheduling engine for standing orders and recurring billing.