Inspiration

Freelancers lose hours and money chasing late payments. Writing invoices, remembering to follow up, and checking whether a client has paid is repetitive admin work. We wanted an agent that does it for them.

What it does

InvoicePilot (PayChase AI) lets a freelancer create PayPal invoices in plain English, for example "Invoice [email protected] $400 for logo design, due in 15 days". The agent creates and sends a real PayPal invoice through the Invoicing API (sandbox), then chases it automatically: up to three reminders with an escalating tone, sent through PayPal. When the client pays, the dashboard flips to PAID and the reminders stop. A live dashboard shows invoice status, reminders sent, and totals.

How we built it

  • Backend: Python and FastAPI, with SQLite for invoice and reminder records.
  • PayPal: Invoicing API v2 (create, send, remind, cancel, get, list) plus webhooks with signature verification for paid, cancelled, and refunded events.
  • AI agent: an LLM with tool calling (Groq, OpenAI-compatible API). It asks for missing details, always uses USD, never invents emails or amounts, and asks for confirmation on invoices over $1,000. The confirmation message is built from the real PayPal response, not from model text.
  • Reconciliation: the app also syncs with PayPal's real invoice status, so the chaser never chases an invoice PayPal says is paid, even if a webhook is delayed.
  • Frontend: a single-page chat plus dashboard, no build step.
  • Quality: 51 automated tests.

Challenges we ran into

  • PayPal's create-invoice response returns a link, not an invoice ID, so we had to extract the ID from the URL.
  • PayPal blocks USD invoices to recipients in India, so testing needed a US-based sandbox client account.
  • Webhook payloads nest the invoice ID differently across events, so the parser handles several shapes.
  • Polling PayPal for every invoice was slow, so we added throttling, a lock, and concurrent requests.
  • The reasoning model leaked its internal reasoning into replies, which we fixed by hiding reasoning and templating the invoice confirmation.
  • Dev endpoints needed protection once the app was exposed through a tunnel.

Accomplishments that we're proud of

A full working loop against the real PayPal sandbox: chat, invoice, automatic reminders, real payment, and an automatic status update. It also shows its work honestly: payments simulated in demo mode are clearly labeled and get overwritten by PayPal's real status.

What we learned

Real payment APIs have many edge cases (response shapes, regional restrictions, delayed webhooks), and an agent that touches money needs guardrails and verification against the source of truth.

What's next for PayChase AI

Real due-date-based chasing instead of demo timing, multiple currencies, email and SMS channels, multi-user accounts with login, and recurring invoices.

Built With

Share this project:

Updates

Submission history