Inspiration
Separated parents share "extraordinary" child expenses: braces, camps, school trips. Their agreement says who pays what share, which costs need consent first, how fast to ask and how fast to pay. But the agreement is a PDF nobody rereads, so every receipt becomes a fresh argument about what it means, and "I already sent it" is impossible to check.
The argument is rarely about the money. It is about who gets to say what the agreement means. Generic expense splitters make this worse: they split by a number someone typed, with no link to the document both parents signed.
What it does
AI proposes. Code decides. PayPal verifies. Both parents stay in control.
One expense, followed all the way through:
- Agreement. A parent uploads the agreement. An AI proposes one rule per kind of expense. Each rule must quote its clause word for word, with page and section.
- Validation. Plain code checks every quote against the document and every number against its quote. Unclear or contradictory clauses become questions for both parents, never guesses.
- Approval. Each parent approves the exact same version, in their own session. Questions are answered privately; matching answers become a working arrangement in Between that does not change the legal agreement.
- Expense. A parent adds a receipt. The AI reads the total; the parent confirms the amount.
- Decision. A rules engine with no AI in it decides who owes, how much and by when, cites the clauses, and shows its working. Demo example: orthodontist $420.00, 60% of $420.00 = $252.00, Father owes Mother within 14 days under §6.1 and §7.2.
- Payment. The parent who owes confirms explicitly and pays the other parent's own PayPal account through a PayPal sandbox checkout.
- Verification. Between reads the capture back from PayPal and marks it "Verified with PayPal" only if amount, payee and reference match.
- Record. Every step is appended to a hash-chained record with its actor. Either parent can re-check every payment against PayPal and export the record.
Also in the product:
- Judge Mode: follow the proof. A read-only, five-step walkthrough on the demo family's home page, built from that family's own data.
- Money & Time. An AG Studio report of the year (owed, verified with PayPal, still open, cap usage, spending by category) beside a Bryntum calendar of parenting time and payment windows. Clicking a payment window focuses the whole report on that expense.
- Ledger guide. A read-only AG Studio agent with custom tools. Asked "If Mother pays $450 for soccer camp on 14 December, what happens?", it dry-runs the real rules engine and answers "needs consent first", quoting §6.2. It can't pay, approve, consent or change rules, and it never computes an amount itself.
- Custody swaps. Drag across days on the Bryntum calendar to ask for a swap; the other parent agrees; it lands in the record.
- Corrections. If an amount is lowered after payment, the difference goes back through a checkout in the other direction, verified the same way.
Payments settled outside Between are labelled "settled outside Between, not verified by PayPal" and are never counted as verified.
How we built it
- Frontend: Next.js 16 and React 19 on Vercel. It renders the backend's own view data and forwards every form through one server action with the session cookie and CSRF token. It holds no business logic.
- Backend: FastAPI and PostgreSQL on Render. It is the only source of truth for rules, validation, decisions, payments and the record.
- AI: Google Gemini with structured output for agreement and receipt reading, and behind the Ledger guide through our own adapter. The browser never calls the model directly.
- PayPal (sandbox): Orders v2 with
intent=CAPTUREandpayee.email_addressset to the receiving parent;GET /v2/payments/captures/{id}for the independent read-back; signature-verified webhooks that only trigger that same read-back; deterministicPayPal-Request-Ids and one live payment per expense to prevent duplicate charges. - AG Studio 3.1.0: the Money & Time report and the Ledger guide (Agent Framework: custom agent, custom tools).
- Bryntum Calendar Community 8.0.0: parenting time, swaps, expenses and payment windows.
Challenges we ran into
- Trusting an AI's reading of a legal document. We don't. Every rule must carry a verbatim quote that code finds on the stated page, under the stated section, with its numbers inside the quote. An agreement with a planted instruction produced zero accepted injected rules.
- What PayPal lets an app do between two personal accounts. A feasibility spike against the real sandbox showed the app can't void holds or refund captures on a parent's account (403), and payouts are business money. So the design is capture only, and corrections are a payment back the other way.
- "Paid" without trusting the browser. The return page is refused if the session isn't the payer's. Completion comes from PayPal's own read-back, so an approval in another browser still completes correctly.
- Private answers. One parent's answer to an open question is never sent to the other, not even hidden in the page, until both have answered.
- A second frontend without a second backend. The Next.js app renders the backend's view data and forwards its forms, so nothing is calculated twice.
Accomplishments that we're proud of
- Real PayPal sandbox payments verified end to end through the hosted backend: captures
17S84040MG287540Nand15D46614X7056845N, each $252.00, read back from PayPal as COMPLETED with the right payee and reference. Through the Next.js frontend in local development: capture7JJ82421FH569103Y(paid $252.00, PayPal fee $9.28, received $242.72). - An AI extraction gate that passes 8 of 8 runs across three synthetic agreements plus one with a planted instruction.
- 220 backend tests; Playwright journey tests with two parents in separate sessions; no serious or critical accessibility violations reported by axe.
- A product that says plainly what it is not: this is a commercial PayPal checkout, not a Friends & Family transfer, and whether it suits real parent-to-parent reimbursements under PayPal's terms is an open question to answer before any real launch.
What we learned
- The useful place for AI here is reading and explaining, with code checking its work. Deciding money is a job for deterministic rules.
- "Verified" has to be its own status with its own evidence. A webhook or a browser redirect alone is not proof.
- Failing closed (asking both parents instead of guessing) is what makes the rest trustworthy.
What's next for Between
Not built yet:
- A real-money launch, which first needs an answer on PayPal's terms and both parents' consent to AI processing of their documents.
- Read-only access for a mediator or lawyer.
- Recurring obligations such as monthly support.
- Scanned-PDF agreements and more agreement formats.
- Reminders before a payment window closes.
Sandbox demonstration with synthetic data. No real money moves. Not legal advice.
Built With
- ag-grid
- ag-studio
- bryntum
- fastapi
- gemini
- next.js
- paypal
- playwright
- postgresql
- python
- react
- render
- tailwindcss
- typescript
- vercel