Inspiration
One customer, one $500 payment, two $500 invoices. Matching the amount does not tell a bookkeeper whether the customer paid an annual support retainer or an October implementation balance. The useful evidence may be a correction buried in the payment note.
Paper Ledger brings the original records, competing explanations, and the effect of a proposed match into one review workspace.
What it does
Paper Ledger imports invoice and payment CSVs and reads existing PayPal sandbox captures or a bounded transaction-search window.
For ambiguous notes, the operator reviews the data before sending it to AI. The response identifies supporting and contradicting text for each invoice with exact quotes and source references. The operator decides whether to confirm the match.
For installment payments, deterministic code finds exact combinations. In the demo, $480 + $350 + $450 covers a $1,280 invoice. A different pair leaves one cent and does not qualify as an exact match.
Fees, net proceeds, pending payments, refunds, and unresolved records remain separate. Decisions can be exported as CSV and standalone HTML reports; workspace files preserve records and human review.
How I built it
The application uses Next.js, React, TypeScript, Zod, and Papa Parse. PayPal OAuth, Payments v2 capture details, and Transaction Search run through local server routes.
OpenAI inference runs through a restricted, authenticated Codex CLI. The server validates response structure, supplied IDs, and quoted evidence. Money calculations use integer cents. A meet-in-the-middle search finds installment combinations within an explicit receipt limit.
AI cannot allocate receipts or move money. Confirmation requires a human reason, and one receipt cannot be assigned twice.
Challenges
A plausible interpretation is not proof of payment. The interface must preserve conflicting evidence and uncertainty instead of hiding them behind a confident answer.
Another challenge was distinguishing authenticated PayPal observations from imported sample data. That distinction remains visible in the workspace and exports.
Accomplishments
The working flow covers import, real AI analysis, installment review, confirmation, export, and workspace restore. A separate authenticated test passed an actual $1 PayPal sandbox capture through lookup, review, and export.
The current demo uses synthetic business records and clearly introduces the earlier sandbox recording. The PDF documents illustrate those sample records; PDF ingestion is not implemented.
What I learned
Exact arithmetic and language interpretation need different controls. AI can help explain a payment note, while deterministic code enforces money calculations and allocation rules. The reviewer needs access to both.
What's next
The next useful validation is testing the workflow with bookkeepers and representative, permissioned reconciliation cases. The current prototype serves one local operator and USD records; it does not claim production accuracy or measured time savings.
Built With
- codex
- next.js
- openai
- papaparse
- paypal
- react
- tailwind-css
- typescript
- zod