Inspiration
Chasing late payments is one of the most uncomfortable parts of freelancing. You already did the work, the due date has passed, and now you have to write a polite but firm email. I wanted an AI agent that handles this for you, but one that never acts with your money or your reputation without your approval.
What it does
Nudge is an AI accounts-receivable agent for freelancers, built on the PayPal Invoicing API.
- Create invoices in plain English. Tell Nudge the client, email, amount and what it is for. The agent creates the invoice in PayPal and sends it.
- Live dashboard. An AG Grid table shows every invoice with its status, due date, days overdue and number of reminders sent, plus Outstanding, Overdue and Collected totals.
- Smart reminders. Ask Nudge to chase overdue invoices. It checks each one and writes a reminder with a tone that fits how late it is (friendly, firm or final).
- Human approval. The agent cannot send reminders. It can only queue them under "Awaiting your approval". A reminder goes out through PayPal only after you read it and click Approve.
- Mark paid. Record a payment through PayPal, and the dashboard totals update.
How I built it
- PayPal Invoicing API (sandbox): generate invoice number, create, send, list, remind, and record payment, called directly through the REST API.
- AI agent: NVIDIA Nemotron running on Nebius Token Factory through its OpenAI-compatible API, using tool calling. The agent has three tools:
list_invoices,create_and_send_invoiceandpropose_reminder. - Backend: Node.js and Express.
- Frontend: a single HTML page with AG Grid Community.
- Hosting: [Render, delete this line if you did not deploy].
The key design decision is the split between tools. The agent has a tool that creates invoices, but its only reminder tool is propose_reminder, which writes to a queue. The PayPal "remind" call exists only behind the Approve button in the UI, so the model cannot skip the human step.
Challenges
- Showing overdue invoices in a demo. New invoices have future due dates, so nothing is ever overdue when you present. I added a simulated "demo clock" (+7 days) that shifts the date the app uses. The clock is simulated, but every PayPal call is real.
- Keeping a small model reliable. Nemotron-3.5 Lightning activates only 3B parameters per token, so I validated everything on the server: invoice IDs must exist, the invoice must be unpaid, and an invoice cannot have two pending reminders. I also stripped reasoning text from its replies and told it to answer in plain text, because it kept producing markdown tables that my chat window does not render.
- Duplicate demo data. Running my seed script twice created duplicate invoices. I wrote a cleanup script that cancels them and made the dashboard hide cancelled invoices.
What I learned
- The PayPal Invoicing lifecycle: create a draft, send it, remind, and record payment.
- Guardrails for agents that touch money belong in the code, not only in the prompt.
- OpenAI-compatible APIs make it easy to switch between model providers.
What's next
- Persist reminders and history in a database (right now they live in memory and reset when the server restarts).
- Automatic reminder policies, for example "remind after 3 days if the invoice is under $500", still gated by approval.
- Multi-currency totals, client payment history, and a webhook-based update when a client pays.