Business processes / 4 / 12
Payment reconciliation
A shop records card payments from the provider's answers and callbacks. Some of them get lost, time out or arrive twice, so the ledger and the real money drift apart. Every morning a job compares the ledger with the provider's settlement report, fixes what is safe to fix and hands the rest to a person.
- 14 min
- Intermediate
- 11 steps
- Mismatches
- 0 /day
- Unmatched amount
- 0 $
- Fixed automatically
- 0 %
- Open review cases
- 0
- request
- reply
- redelivery
- duplicate
- lost
Numbers are a model scenario, not measurements
The real request
Provider → Payments APIRequest
POST /payments/callback HTTP/1.1
Host: api.example.com
Signature1: hidden
{
"event": "charge.succeeded",
"provider_txn_id": 2"ptx_8812",
"order_id": "ord_3301",
"amount_minor": 3129000,
"currency": 4"USD"
}
Response
HTTP/1.1 200 OK
Signature· hidden — Proves the callback came from the provider. A shared secret, hidden here.provider_txn_id— The provider's id for this payment. It is the key everything is matched on later.amount_minor—129000cents = $1,290.00. Integers add up exactly; floats like0.1 + 0.2do not, and 48 000 rows of rounding errors become real money.currency— Always stored next to the amount. Minor units differ: 2 digits for USD, 0 for some currencies, 3 for others.
Build it yourselfCheat sheetCompare lessons
Course: 74 lessons
01 Foundations
02 Scaling
03 Data & storage
04 Communication
05 Reliability
06 Architecture
07 Security
08 Shipping
09 Whole systems
10 Business processes
11 Case studies