All writing

From Invoicee to InvoiceAgent: What Sending My Own Invoices Taught Me

By Bronson Dunbar ·

In January 2023 I wrote Invoicee Beta is Live!, a short post about an app I'd built to stop doing monthly invoice admin. I was billing in one currency and getting paid in another, and every month I looked up the exchange rate, did the maths, made a PDF and emailed it.

Invoicee automated that. In 2026 I rebuilt it from scratch as InvoiceAgent. This post is about what changed in between, and what three years of sending my own invoices taught me about the problem.

InvoiceAgent replaced Invoicee. It isn't an upgrade of the old code: it's a complete rewrite, with a lot more features.

What Invoicee did

The 2023 beta had five features:

  • An invoice template with a date and time for sending
  • Two currencies, converted at the real rate when the invoice was sent
  • A downloadable PDF
  • The PDF emailed to the client and to me
  • A history of every sent invoice, with the exchange rate used

It was built with Next.js, NextUI, NextAuth, MongoDB and Playwright, which rendered the PDFs.

The roadmap in that post is telling: invoice search, once-off invoices, analytics, storage uploads, branding and weekly schedules. Almost all of it was about making invoices. Very little of it was about getting paid.

Why a rewrite

I wanted to rebuild it on the current Next.js App Router, and in TypeScript from the start, rather than keep extending the 2023 codebase. A clean start also meant I could rethink the product, not just port it.

The biggest change shows in InvoiceAgent's data model. Invoicee treated "sent" as the finish line. In InvoiceAgent, sending is the middle of the story. An invoice moves through PENDING → PROCESSING → SENT → PAID, it can collect partial payments, and it carries its own follow-up schedule.

What carried over: the exchange rate is locked at send time

The one idea that survived intact is the reason the product exists. If you price a retainer in dollars and bill in euros, the amount has to be right on the day the invoice goes out, and it must never change afterwards.

InvoiceAgent fetches the rate from Frankfurter, a free API for European Central Bank reference rates, at the moment of sending. It then stores the rate and the converted totals on the invoice:

model Invoice {
  sourceCurrency         String
  targetCurrency         String
  exchangeRate           Float?
  convertedSubtotalCents Int?
  convertedTaxCents      Int?
  convertedTotalCents    Int?
  // ...
}

Once exchangeRate is set, every later step (reminders, re-sent PDFs, payment matching) uses the stored value instead of fetching a new one. The client always sees the same amount, and the rate used is printed on the invoice.

All money is stored as integer cents, and tax as basis points (taxRateBps). There's even a small parser that turns "0.29" into 29 cents without going through floating point, because 0.29 * 100 in JavaScript is 28.999999999999996.

What's new

  • Scheduling that respects real calendars. You pick a day of the month and an hour in your own time zone. If that day falls on a weekend, you can choose to send on the previous or next weekday instead.
  • Follow-ups. If an invoice is still unpaid three days after the due date, the client gets a reminder, then a final one four days later. I wrote about the details in Designing overdue-invoice reminders people don't hate.
  • Partial payments. Record what's been paid and reminders ask only for what's still owed.
  • Payment matching with Wise. Invoices can carry a Wise payment reference, so InvoiceAgent can check for incoming payments before it chases anyone.
  • Line items from time tracking. Hours can come from Toggl or WakaTime at your hourly rate, instead of being typed in each month.
  • Google Drive sync, so sent (and optionally paid) invoices are filed automatically.
  • Branding, with templates, an accent colour, fonts and your logo.

The stack, then and now

Invoicee (2023) InvoiceAgent (2026)
Language JavaScript TypeScript
Framework Next.js Next.js
Database MongoDB PostgreSQL with Prisma
Auth NextAuth Clerk
PDFs Playwright React-PDF and pdf-lib
Email Nodemailer Resend
Payments None Dodo Payments

The move to Postgres was driven by the payment features. Payments, reminders and invoices are relational, and constraints like "one invoice number per user" and "each bank transaction recorded once" belong in the database, not in application code.

The other two changes were about doing less work myself:

  • Clerk instead of NextAuth. Clerk's integration and feature set are simply much better, and sign-in, sessions and account management are all handled for me.
  • React-PDF instead of Playwright. Invoicee rendered PDFs by driving a headless browser. That works, but it adds a lot of overhead that an invoice doesn't need. React-PDF was much simpler to set up and integrate, and it builds the PDF directly from components.

What three years taught me

One lesson about clients, and two I'd go back and tell myself in January 2023:

  • Even good clients need a nudge now and then. Late payment usually isn't bad intent: invoices get buried. That's why InvoiceAgent's follow-ups exist, and why they're polite rather than pushy.
  • Choose the database and auth layer carefully. They're the hardest parts to change later, and changing them was a big part of why this became a rewrite rather than an update.
  • Invest in TypeScript from day one. It costs a little time up front, but it catches errors and bugs early, when they're easiest to fix.

If you bill the same clients every month, try InvoiceAgent. It's the tool I've wanted since 2023.