Appendix D · The worked-example workbook
The Platform Refund Ledger · 4 min read
Every calculation in this book, restated as blank templates. Copy each table into a spreadsheet; the example row shows the arithmetic filled in, and the formulas are written to be typed as-is (amounts in minor units, formatted as currency at display). Formulas assume the column layout given.
D1 · Expected reversal (per charge)
Formula: Expected = ROUND( MIN(total_refunded, charge_amount) ÷ charge_amount × transfer_amount , 0 ) · Missing = MAX(0, Expected − amount_reversed)
| Charge | Charge amount | Transfer amount | Total refunded | Expected | Amount reversed | Missing | Within tolerance? |
|---|---|---|---|---|---|---|---|
| ch_102 (example) | 8000 | 7200 | 2000 | =ROUND(MIN(D,B)/BC,0) → 1800* | 1350 | =MAX(0,E−F) → 450 | no — finding |
Tolerance: findings smaller than two minor units per charge are rounding drift (chapter 6), not leaks.
D2 · Expected fee return (per application fee)
Formula: Expected fee refund = ROUND( total_refunded ÷ charge_amount × application_fee_amount , 0 ) · Missing = MAX(0, Expected − fee.amount_refunded)
| Fee | Fee amount | Charge amount | Total refunded | Expected refund | Actual refunded | Missing |
|---|---|---|---|---|---|---|
| fee_103 (example) | 600 | 6000 | 3000 | → 300 | 0 | → 300 |
D3 · Refund episode ledger (who paid?)
List every leg of the episode and sum the platform column. If the sum surprises you, chapter 2's matrix says which default you are living in.
| Leg | Account debited | Account credited | Platform effect |
|---|---|---|---|
| Buyer refund | |||
| Transfer reversal | |||
| Fee returned | |||
| Episode sum |
Example (chapter 4's middle column): −100.00 + 90.00 + 0 = −10.00 for the episode, against the $25.00 fee withheld at sale — leaving +$15.00 lifetime, exactly 10% of the $150.00 the buyer kept. The reversal is 90.00, not 100.00, because it is proportional to the transfer and the transfer was the charge less the fee.
D4 · Dispute recovery (per closed-lost dispute)
Formula: Recovery due = transfer.amount − amount_reversed — never the disputed amount, never including the dispute fee. On chapter 5's example the disputed amount is 86000 while the transfer was only 73100 (86000 − 12900, the charge less the withheld fee); asking for 86000 fails.
| Dispute | Status | Transfer amount | Amount reversed | Recovery due | Reversed after close | Net outstanding |
|---|---|---|---|---|---|---|
| dp_104 (example) | lost | 73100 | 0 | → 73100 | 0 | → 73100 |
D5 · Net position roll-up (per quarter)
Formula: Net position on a sale episode = fee withheld − amount refunded + amount reversed − fees returned ± dispute legs. Restated for the four common endings, worked on the book's $120.00 destination charge with a $12.00 fee — so a $108.00 transfer:
| Ending | Computation | On the running example |
|---|---|---|
| Full default refund, destination | fee withheld − amount refunded | 12 − 120 = −108.00 |
Full refund, reverse_transfer only | fee withheld − refund + reversal | 12 − 120 + 108 = 0.00 |
| Full refund, both flags | as above, less the fee returned | 0 − 12 = −12.00 |
| Lost dispute, no clawback | fee withheld − disputed amount − dispute fee | 129 − 860 − 15 = −746.00 (ch. 5) |
Fill one line per ending with your own quarter's counts and per-case amounts:
| Ending | Count | Average platform effect | Quarter total |
|---|---|---|---|
D6 · Month-close identity
Formula: Σ charges − Σ refunds − Σ stripe_fees ± Σ adjustments = Σ payouts out + (closing balance held − opening balance held)
| Month | Charges | Refunds | Stripe fees | Adjustments | Payouts | Δ balance held | Identity residual |
|---|---|---|---|---|---|---|---|
| must be zero | |||||||
A nonzero residual means either an object class missing from the pull or money nobody can name (chapter 9). Both stop the close.