Let’s Talk
#32Nonprofit / Payments2026All 60 attacks on the money path held

Pledge-as-Spent: Disaster Relief Where a Pledge Is Charged Only When a Receipt Spends It

Built in-house

Retailbox R&D: built in-house for the PayPal AI Hackathon, 2026

A tool for disaster relief: a donor's pledge is a PayPal hold, and only the receipt lines that pass the checks are charged. Whatever no receipt used is never charged.

Next.jsTypeScriptPayPal Orders, Payments and Payouts APIsMeta Muse SparkPostgresVercel

What was the problem?

Donors often send money to a fund, get a thank-you, and see a general report months later. A shelter or mutual-aid group buys supplies at local stores after a disaster; in Pledge-as-Spent the receipt comes before the charge.

How did Retailbox solve it?

A pledge is a hold on the donor's PayPal account (Orders v2, intent AUTHORIZE) for one listed need; nothing is captured when it is made. A volunteer buys supplies and photographs the receipt. Meta Muse Spark reads the whole photo once. Code then cuts out each printed row and lays the rows on a numbered sheet, and Muse Spark reads that sheet a second time, independently. A line is funded only when both readings agree on its amount, its quantity and its need. Beer and a gift card are refused. Approved lines are split between the donors' holds, each in its own currency, and a company match, and each share is taken in a partial capture. The volunteer who paid at the till is paid back through PayPal Payouts. When the drive closes, PayPal voids the remaining holds, so the rest is never charged and nothing has to be refunded. A button called Ask PayPal yourself reads every hold, capture and payout back from PayPal's sandbox and sets each answer beside the book's own line. The model reads and labels; shares, captures and payouts come out of code. Receipts are published closed, with only the purchase lines visible.

The demo drive is made up and runs in the PayPal sandbox: a shelter after an earthquake in Japan, three donors in Berlin, Columbus and Osaka, and a local company matching every yen 1:1. Receipt reading was measured on synthetic receipts only. The one real receipt in the demo, a Florida store receipt from 2019, tests the before-the-disaster check, not reading accuracy.

Facing the same problem? These are the services that cover this kind of work: AI agent development services.

What does it look like?

Pledge-as-Spent coordinator screen: a Japanese store receipt of ¥14,646 with checks passed (new receipt, dated after the disaster, store inside the drive zone), and the result: 9 lines approved for water, diapers and batteries, and 2 refused, canned beer as alcohol and a gift card. (opens the full-size image in a new tab)
A made-up receipt in a made-up drive in the PayPal sandbox: 9 lines approved, beer and a gift card refused, each with the reason.
Diagram of one receipt in seven steps: two readings agree, the lines, the shares split between donors and a company match, PayPal holds and captures in euros, dollars and yen, the payout to the shelter's volunteer, and the rest of each hold that is never charged. (opens the full-size image in a new tab)
The money river for the demo drive, from the receipt to the payout. The remainder of each hold, €15.42, $8.55 and ¥1,763, is voided and never charged. Sandbox data.

What were the results?

  • ✓In the demo drive, a €20 pledge for water was charged €4.58 for the receipt lines it paid for; the other €15.42 was never charged (sandbox example amounts)
  • ✓20 synthetic receipts in Japanese, Turkish, Spanish and English that the prompts had never seen: line F1 100% and totals 20 of 20, at about 25 seconds and $0.03 per receipt
  • ✓60 attacks on the money path, each with its own test: all 60 hold, and five that did not at first were fixed; 1,567 unit and integration tests and 183 browser tests
  • ✓Ask PayPal yourself: 9 of 9 PayPal sandbox objects of the demo drive agree with the book; on a held-out set, 0 of 42 personal data items stayed visible on published receipts

Have a similar problem?

30-minute call. Free. We'll tell you honestly if we can help.