Payments are an append-only ledger, refunds are capped by the database, and a mismatch raises an alert instead of correcting itself.
Two places that were meant to agree, and did not. A refund total that drifted. A cached figure nobody compared to its source. Nothing crashed, so nothing was noticed.
A correction adds a row rather than changing one. The history of an order's money stays complete, so reconciliation is a read rather than an investigation.
PaymentTransaction
newestStored column
From events
Every order carries its payment, fulfilment and refund history on one record.
| # | Date | Status | Customer | Revenue |
|---|---|---|---|---|
| 1 | 12 Mar | Paid | Maya Okonkwo | $182.40 |
| 2 | 12 Mar | Refunded | Leo Martins | $96.00 |
| 3 | 11 Mar | Paid | Priya Shah | $248.10 |
| 4 | 11 Mar | Disputed | Dana Feld | $74.00 |
Refunds past the order total. Money going negative. A ledger currency that does not match the order. A refund request reaching two terminal states.
Each order keeps its total converted to your base currency as it was on the day of purchase, so reporting does not move when exchange rates do.
Cached figures are checked against the rows behind them. Nothing self-corrects quietly — if a projection disagrees with its source, somebody finds out.
Litestore never sits between you and the money. There is no platform balance to withdraw from.
Where a figure has to be cached for speed, it is compared against its source and any gap becomes a row you can act on.
A total column has to be updated by a job. When that misses, the screen is wrong and nobody knows.
Returns, reviews and payouts compute status from their own events, so there is nothing to keep up to date.
kinds of task the store spots for you
block types to build any page from
and the storefront reorders itself
tests keeping the money right
tables, all yours to query
database — nothing to sync
Across 151 files
Run in CI on every change
One Prisma schema
Money, stock and customers
The guarantees are written down in the repository, and the database is what enforces them.
Payment rows are never edited, so an order keeps its full payment history.
Status is worked out from the events behind it, so nothing has to be kept up to date.
Revenue and conversion are computed from the rows that fulfilled the orders.
Payments settle into your own Stripe account and the ledger is yours to query.