Inspiration
Freelancers don't bill from forms. They bill from conversations: "14 hours at the €90 rate plus the test session, net 30 is fine." Turning those messages into invoices is tedious and error-prone. Chasing late payers is awkward enough that it gets put off. We wanted an assistant that does the busywork through PayPal while the human stays in control of anything that touches money.
What it does
- Message → invoice. Paste an email or chat, attach a screenshot, or dictate a voice note. The agent works out the line items, hours vs. fixed fees, currency, payment terms and a friendly note, and checks the arithmetic.
- Human in the loop. Every write action is a proposal shown as an editable approval card: invoice, reminder, cancellation, or recording an off-PayPal payment. Nothing reaches PayPal until you approve it.
- Chasing on autopilot. "Chase everything overdue" makes the agent read the live PayPal ledger and draft one reminder per late invoice. The tone escalates with lateness.
- Receivables Q&A. "Who owes me money?" is answered from live PayPal data, per currency.
- Live ledger. An AG Grid table of all invoices, plus outstanding / overdue / collected KPIs and an activity feed. A verified PayPal webhook marks invoices paid in real time.
How we built it
- PayPal Invoicing v2 REST API (sandbox): create, send, list, get, remind, cancel, record payment. Webhooks with signature verification for
INVOICING.INVOICE.PAID. - AI: Qwen 3.8 27B on Cerebras Inference through the official Cerebras SDK, running a tool-calling agent loop. Tools:
list_invoices,get_invoice,propose_invoice,propose_reminder,propose_cancel,propose_record_payment. Read tools run immediately. Write tools only queue proposals, and approved results go back to the agent as system updates so it never claims something happened when it didn't. The server validates every draft (email, currency, quantities, terms) and returns errors to the model so it can fix the draft or ask the user. - Stack: Node.js + Express, vanilla JS, AG Grid for the ledger, Server-Sent Events for live updates, deployable on Render with the included blueprint.
Challenges we ran into
- Making the agent safe around money: the propose/approve split, server-side validation of every draft, and never guessing a recipient email.
- Multi-currency receivables: never adding EUR and USD together.
- Keeping agent turns fast enough to feel like a form, not a chatbot. Cerebras turns are about 1.5–7 seconds, including tool calls.
Accomplishments that we're proud of
A messy email becomes a correct, sent PayPal invoice in two clicks. And the paid status flows back by itself.
What we learned
Human approval cards make an AI agent feel trustworthy without slowing it down. Small, fast models handle tool calling well when the tools are narrow and validated.
What's next for PayDraft
Recurring retainers via PayPal Subscriptions, Payouts to split revenue with subcontractors, Gmail/Slack inbox integration, and late-fee policies.
Built With
- ag-grid
- cerebras
- express.js
- javascript
- node.js
- paypal
- paypal-invoicing-api
- paypal-webhooks
- qwen
- render
- server-sent-events