Payout reconciler
A small system for any business paid through card terminals, online checkouts, wallets or a marketplace: every payout taken apart into its lines, a clearing account per provider that can be checked against the provider’s own balance, bank lines matched to what was expected, and sales posted gross on the date they happened. Seven posts on the same system, one diagram at a time, with a cost breakdown and an engineering reference at the end.
- 01
A payout reconciler on AWS for a few dollars a month
The whole system on one page — settlement lines, a clearing account per provider, the bank match and the month end — and why a payout is not a sale.
- 02
What is actually inside a payout
Normalising four providers’ settlement reports into one line shape, detecting each report’s layout from its header, and the rule that a payout’s lines must add up to it exactly.
- 03
A clearing account for every provider
Posting settlement lines and payouts through one clearing account per provider, comparing its balance with the provider’s own, and what the balance at year end is made of.
- 04
The adjustment lines nobody explains
Typing settlement lines by provider code first, remembered wording second and a model only third, the closed list of types, and the lines that still go to a person.
- 05
Matching the bank, and closing the month
Matching bank lines to expected payouts, handling combined deposits and negative payouts, cutting the month off on the sale date, and writing a gross journal with a reconciliation pack.
- 06
What the payout reconciler costs
About $2 a month. One Bedrock read per unmapped line is the only line that grows; the queue, the table, the mail and the storage are rounding errors. Plus the three ways the bill could surprise you.
- 07
Engineering reference: the payout reconciler architecture
Same system, drawn purely for engineers. Service names, region, Lambda inventory, IAM scopes, the schemas and the exact model id.
Frequently asked questions
- Why can’t we just book each payout as a sale?
- Because a payout is what is left after refunds, disputes, fees and any reserve have been taken out, often across several days of trading. Booking it as a sale understates revenue, hides every cost the provider deducted, and puts sales made at the end of a month into the next one.
- What is a clearing account for?
- It holds what a payment provider owes you. Sales increase it; refunds, disputes and fees reduce it; payouts move money from it to the bank. Because the provider reports its own balance, the account can be checked, and a difference means something was missed.
- Is a rolling reserve a fee?
- No. It is your money, held by the provider for a period and released later. It moves between two things you own, and treating it as a cost books an asset as an expense and its release as unexplained income.
- Does this sort out our VAT?
- It gets the sales figure right, and output VAT is worked out on what the customer paid, not on what the provider passed on. For the charges on a provider’s statement it records the VAT treatment the provider’s invoice shows, and leaves the judgement to whoever prepares the return.
- What does it cost to run?
- About two dollars a month at ninety unmapped lines. See part six.