Inspiration
We build websites and systems for small businesses, and every month someone asks us the same thing: how do I chase the clients who owe me without losing them? The owner either sends nothing, because it is awkward, or the same angry template to everyone. What works depends on the customer, and that is a judgment call an AI can help with, as long as it never gets the last word on money.
What it does
Past Due Desk reads the overdue invoices in the owner's books. For each account a Claude model reads the amount, the days late and the relationship history, and returns a structured plan: a friendly nudge, a firm reminder, a split payment with a minimum first payment, a settlement discount, or "this one needs you". It also writes the email and the note printed on the invoice. The owner's policy is enforced in code: maximum discount, discount only after N days late, minimum first payment ratio, due-date window. When the model goes past a limit, the policy corrects it and the dashboard shows the correction. A disputed invoice is escalated to the owner and no invoice is sent. The owner approves each plan in an AG Grid dashboard. Approved plans become real PayPal invoices (Invoicing v2): the discount as an item discount, the split plan as partial_payment with a minimum_amount_due, the AI's email as the invoice note, then send. The customer gets PayPal's hosted invoice and pays with PayPal or a card. Refresh from PayPal syncs SENT, PARTIALLY_PAID and PAID back into the grid.
How we built it
Node 22 with no dependencies. PayPal: OAuth2 client credentials, Invoicing v2 create, send, get and remind, and the hosted payer view, all in the sandbox. AI: a Claude model behind a small backend switch (Anthropic Messages API, Claude Code headless, or replay). Replay reads recorded answers keyed by a hash of the exact prompt, so judges can run the full demo without an AI key and a changed record never replays a stale answer. AG Grid Community for the owner's dashboard.
Challenges we ran into
Keeping money decisions out of the model. The model proposes, deterministic code decides what is allowed, and the AI never calls PayPal directly. Making sending idempotent: the ledger is written after every invoice, so a crash never sends the same invoice twice and an account with a live invoice is never re-planned.
Accomplishments that we're proud of
Real invoices in the PayPal sandbox from one click: $180 reminder, $1,450 split with a $375 minimum first payment, $620 settled at $558 with a 10% item discount, and a disputed account handed to the owner instead of being chased.
What we learned
Partial payments and item discounts in Invoicing v2 map directly onto the collection strategies small businesses already use by hand, so the agent can stay small and the policy can stay readable.
What's next
Import receivables from QuickBooks and WHMCS, use PayPal webhooks instead of polling, and let the agent follow up on its own plans (remind, then escalate) within the same policy.
Built With
- ag-grid
- anthropic
- claude
- javascript
- node.js
- paypal
Log in or sign up for Devpost to join the conversation.