Inspiration
Every field trip starts the same way: a teacher pays for the coach on her own card, then chases twenty-six families for weeks. US teachers already spend an average of $895 a year of their own money on their classrooms (AdoptAClassroom.org, 2025). PayPal closed its Money Pools collection product in 2021 (newsroom.uk.paypal-corp.com), and the problem of one person fronting money for a group never went away. We wanted the purchase to wait for the group, and the price to fall as the group grows.
What it does
A teacher pastes the coach quote; Gemini reads it into amounts, each tied to the words it came from, and code checks every one. Each family gets a slip in English, Spanish or Vietnamese and approves a PayPal hold for the worst-case share ($88.00 at the 18-child minimum). As children join, the real share falls ($80.00 at 20, $63.38 at 26). At the close, Quorate captures each family's real share, releases the rest of every hold, and pays the coach company and the museum in one PayPal payout. If PayPal declines a capture mid-close, Quorate re-shares among the rest and tops up the families already captured from their own holds, never above what each approved. If the trip does not reach its minimum, nobody is charged.
How we built it
- The Bursar (plain TypeScript, integer cents): one price for everyone by water-filling, exact to the cent, with six properties checked at 10,000 random cases each; a renewal scheduler for the 3-day honor period and 29-day validity; guards that refuse any capture above the approved amount or on changed terms.
- The close: every PayPal call is preceded by an attempt row and carries a request id derived from pool, member, operation and attempt, so a crash never captures twice.
- PayPal: Orders v2 AUTHORIZE, Payments v2 partial capture with
final_capture:false, void, reauthorize and refund, Payouts, Invoicing for cash families, Vault v3 for trips past what a hold can reach, verified webhooks, sandbox negative testing for the decline, the PayPal Server SDK, and the PayPal Agent Toolkit with read-only tools for the help desk. - AI: Gemini (
gemini-3-flash-preview) through the Vercel AI SDK reads quotes and replies, writes slip notes in three languages, and answers parents; code keeps every number out of the models' hands. - UI: Next.js on Render (web, cron, Postgres from one Blueprint); The Register on AG Grid and AG Charts; the honor timeline on Bryntum Scheduler; a read-only MCP door for families' assistants.
Challenges we ran into
- A Friday close against a 3-day honor period: holds are renewed once, timed so the new window covers the close.
- PayPal declining a capture after other families were already charged: solved with partial captures and top-ups from the same authorizations.
- PayPal accepted an $80.00 capture on a $72.00 hold in our probe, as its 115% rule allows; a family who saw "never more than $88.00" must never pay more, so Quorate refuses before every capture.
- Sandbox account setup: country restrictions on holds and payouts, and which mock codes each call honours (all written up for PayPal in FRICTION.md).
Accomplishments that we're proud of
13 live sandbox runs, 10 of 10 closes exact to the cent and paid out, 4 closes that survived a PayPal-injected decline, 205 real holds, $15,522.00 settled, 0 cents off, and 0 families charged above what they approved. A run killed after its 9th capture restarted with no capture repeated.
What we learned
The ten probe questions we wrote down before the first call (FINDINGS.md): partial captures and void behave as documented; over-capture is accepted; INSTRUMENT_DECLINED is not a mock code for authorization capture; a repeated request id returns the original capture; payouts settle in about 25 seconds.
What's next for QUORATE
Pilots with a PTA and a youth sports club; exports for the school office; per-family Vault for long-lead trips; sponsors who can pledge to cover the last children.
Built With
- ag-charts
- ag-grid
- bryntum
- fast-check
- gemini
- motion
- next.js
- paypal
- paypal-agent-toolkit
- paypal-js-sdk
- paypal-orders-v2
- paypal-payments-v2
- paypal-payouts
- paypal-server-sdk
- paypal-vault
- paypal-webhooks
- playwright
- postgresql
- react
- render
- typescript
- vercel-ai-sdk
- vitest