Business processes / 11 / 12
Refunds and chargebacks
A shop gives money back in two ways: it refunds on its own, in full or in part, or the cardholder's bank takes the money back through a chargeback. Both look like "minus some amount", and both break in the same places: an edited payment row, a click sent twice, two agents refunding at once, a status that only arrives later by webhook, and a dispute deadline nobody watched.
- 14 min
- Intermediate
- 12 steps
- Refunds paid twice
- 0 /mo
- Refunds above captured
- 0 /mo
- Refunds with a wrong status
- 0
- Chargebacks lost
- 0 %
- Report lines that differ
- 0
- request
- reply
- redelivery
- duplicate
- lost
- call: the reply returns on the same line
Numbers are a model scenario, not measurements
The real request
Refund service → Payments DBRequest
SELECT id, status, captured_minor FROM payments WHERE id = 'pay_7731';1
Response
pay_7731 | captured | 4500002
-- order ord_5120: 3 items, 4 500.00 paid by card **** 44173
-- the customer returns 1 item of 1 500.00 and asks for the money back4
captured_minor— How much the provider actually took from the card, in cents.captured— The payment is final: money moved, it can only be given back, not cancelled.**** 4417— Only the last four digits are stored and shown; the full card number never reaches the shop.1 500.00— A partial refund: one item out of three.
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