Inspiration
I am an active trader and balancing my profit and loss statement against my brokers accounts was very frustrating. I started using Claude to do my book keeping. In similar spirit I wanted to create something for small businesses which often invoice through PayPal but get paid into a bank account. Matching the two by hand is slow, and costly mistakes hide in the gaps: a customer who paid twice, a deposit that never arrived, an invoice still marked unpaid after the money landed. I wanted to build the bookkeeping assistant that catches these, with AI doing the tedious work and a person staying in control of any change.
What it does
LedgerLight pulls invoices from the PayPal Invoicing API and compares them with an uploaded bank ledger (CSV). It ranks the exceptions it finds by severity and dollars at risk: missing deposits, overdue invoices, double payments, overpayments, partial payments, invoices whose PayPal status is out of date, and bank deposits that match no invoice. It recognizes deposits that arrive net of PayPal fees, so those don't show up as false mismatches.
A Claude agent then summarizes the exceptions, drafts customer reminder emails, and proposes fixes such as recording a payment on an invoice. It cannot change anything itself. Every proposed change waits in an approval queue until a human clicks Approve.
How we built it
LedgerLight is a Python/FastAPI app with a lightweight web interface. A deterministic, unit-tested matching engine does all the arithmetic and detection, so the AI never calculates amounts. Claude (through the Anthropic API with tool use) gets two read tools and one propose-only write tool. It reads the reconciliation report and invoice details, and it can queue a "record payment" proposal. Approved proposals are written to PayPal through the Invoicing API in the sandbox using OAuth2. An offline mock PayPal client lets the whole app and its tests run without credentials. It is deployed on Render. Note: Since Anthropic Key was not included, the agent will not work as seen in the demo video
Challenges we ran into
The hardest design question was how much authority to give the model. I settled on a narrow boundary: the engine computes, Claude explains and proposes, and a person approves. Matching was the other challenge. Bank deposits often lack invoice numbers and arrive net of fees, so I used a scoring approach based on invoice number, amount (including the fee-adjusted amount) and customer name. Unclear cases are shown as exceptions rather than guessed at.
Accomplishments that we're proud of
The engine correctly handles net-of-fee deposits, duplicate payments, partial payments, overpayments and status mismatches, covered by 9 passing tests. The approval flow also works end to end: a proposed fix updates the invoice only after approval, and amounts are capped at what is actually due. I ran the full flow against the live PayPal sandbox.
What we learned
An agent in finance is only as trustworthy as the deterministic layer under it. Keeping the numbers out of the model and limiting its authority made the behavior easy to test and explain. Designing the approval step early shaped the whole architecture.
What's next for LedgerLight
Next I'd add a refund workflow for duplicate payments, multi-currency support, live bank feeds in place of CSV upload, and sync with accounting tools such as QuickBooks or Xero. I'd also add a persistent audit log of every proposal and decision.
YouTube: https://youtu.be/xDFGF65VCXk
Render: https://ledgerlight-2heb.onrender.com
Built with: Python, FastAPI, PayPal Invoicing API (sandbox), Anthropic Claude API, Render
AI tools used: Claude (Anthropic API) at runtime for explanation, drafting and tool use; Claude as a coding assistant during development.
Built With
- ai-agents
- anthropic
- claude
- claude-api
- css
- fastapi
- html
- httpx
- javascript
- paypal
- paypal-invoicing-api
- python
- render
- smtp
- tool-use
- uvicorn