GUIDE

Build an Invoice Generator with Claude Code

Solo founders waste hours every month on invoices. Build a branded PDF invoice generator with Claude Code that reads a config file, tracks payments, and runs in 10 seconds.

You didn't quit your job to spend Saturday mornings making invoices. But here you are, copying client names into a Google Doc template, double-checking the math, exporting to PDF, and emailing it off. Repeat for every client. Every month. It's the kind of work that makes you question whether "being your own boss" was worth it.

I've trained over 100 people on Claude Code, and solo founders like you are the ones who get the most immediate value. Not from flashy AI features, but from grinding through the boring stuff that eats your weekends. An invoice generator is a perfect first project: small scope, clear inputs, and it saves you real hours every single month.

What We're Building

A command-line tool that reads your client data from a simple config file, generates branded PDF invoices, and tracks what's been paid and what's outstanding. You run one command and get a folder full of invoices ready to send.

No SaaS subscription. No monthly fee. No login. Just a script on your machine that does exactly what you need.

The Client Config File

Everything starts with a JSON file that holds your client data. This is the single source of truth for who you invoice and what they owe. Here's the format:

{
  "business": {
    "name": "Hansen Consulting LLC",
    "address": "123 Main St, Lehi, UT 84043",
    "email": "billing@hansenconsulting.com",
    "logo": "./assets/logo.png"
  },
  "clients": [
    {
      "id": "acme",
      "name": "Acme Corp",
      "contact": "Sarah Chen",
      "email": "sarah@acmecorp.com",
      "address": "456 Oak Ave, San Francisco, CA 94102",
      "rate": 150,
      "currency": "USD",
      "paymentTerms": "Net 30",
      "items": [
        { "description": "Product strategy consulting", "hours": 40 },
        { "description": "User research sessions", "hours": 12 }
      ]
    },
    {
      "id": "brightpath",
      "name": "BrightPath Education",
      "contact": "Marcus Webb",
      "email": "marcus@brightpath.io",
      "address": "789 Elm St, Austin, TX 78701",
      "rate": 175,
      "currency": "USD",
      "paymentTerms": "Net 15",
      "items": [
        { "description": "Dashboard redesign", "hours": 24 },
        { "description": "Design system setup", "hours": 16 }
      ]
    }
  ]
}

You update this file each month with current hours and line items. Everything else (your business info, client addresses, rates) stays the same. Two minutes of edits per month instead of 30 minutes of copy-pasting per client.

Prefer CSV? You can use that instead. Tell Claude Code your format and it'll adapt. The JSON approach is nice because it handles nested data (multiple line items per client) cleanly.

The Prompt That Builds Your Generator

Open Claude Code in your project folder and give it the full picture:

Build an invoice generator in TypeScript that:

1. Reads client data from clients.json (format already exists in the file)
2. For each client, generates a professional PDF invoice with:
   - My business name, address, logo from the config
   - Client name, contact, address
   - Invoice number (auto-incrementing, stored in a counter file)
   - Invoice date (today) and due date (based on payment terms)
   - Line items with description, hours, rate, and line total
   - Subtotal, tax (configurable, default 0%), and total
   - Payment instructions at the bottom
3. Saves each PDF to an output/invoices/ folder, named like:
   INV-2026-0042-acme.pdf
4. Generates a summary CSV with all invoices, amounts, and due dates
5. Uses @react-pdf/renderer or pdfkit for PDF generation

Make the invoice look clean and professional. Dark header bar
with my business name in white, clear table for line items,
prominent total at the bottom.

Claude Code will scaffold the project, install dependencies, build the PDF template, and wire up the data pipeline. The first working version usually lands in 3 to 5 minutes. If you're new to this, the setup guide walks you through getting Claude Code installed.

Customizing the Look

The first output will be functional but probably not exactly your style. This is where Claude Code shines: iterate on the design with plain language.

Changes to the invoice design:
- Make the header bar navy blue (#1a2744) instead of black
- Add my logo in the top-left corner of the header, 60px tall
- Use the font "Inter" for body text and "Inter Bold" for headers
- The line items table needs alternating row backgrounds (white and light gray)
- Make the total amount larger and bold, right-aligned
- Add a footer with "Thank you for your business" and my email

Each iteration takes about a minute. Keep going until the invoice matches your brand. Once it looks right, the template is locked in. Every future invoice uses the same design automatically.

What the Generated Invoice Looks Like

The PDF output has a clear visual hierarchy:

  • Header: your business name, logo, and contact info on a colored background
  • Client block: who the invoice is addressed to, with their full address
  • Invoice details: invoice number, date issued, due date, payment terms
  • Line items table: description, hours, rate, and line total for each item
  • Totals section: subtotal, tax (if applicable), and bold total amount due
  • Payment instructions: bank details, PayPal, Venmo, or whatever you accept
  • Footer: thank-you note and your contact email

It looks like something from FreshBooks or Wave, except you own it, you control it, and it costs nothing to run.

Tracking Payment Status

Generating invoices is half the job. Tracking who's paid is the other half. Ask Claude Code to bolt on a payment tracker:

Add a payment tracking system:

1. Create a payments.json file that stores:
   - Invoice number
   - Client name
   - Amount
   - Date issued
   - Due date
   - Status: "pending", "paid", or "overdue"
   - Date paid (if paid)

2. Add a command that lists all outstanding invoices:
   npx ts-node track.ts status

3. Add a command to mark an invoice as paid:
   npx ts-node track.ts paid INV-2026-0042

4. Add a command that shows overdue invoices (past due date, not paid):
   npx ts-node track.ts overdue

5. Auto-update the status to "overdue" for any invoice past its
   due date that hasn't been marked paid.

Now you have a complete invoicing workflow. Generate invoices, track status, follow up on overdue payments. All from the command line. All stored in plain files you can read, back up, and version control.

The Monthly Workflow

Here's what your invoicing process looks like once this is built:

  1. First of the month: open clients.json and update hours/line items for each client (2 to 5 minutes)
  2. Run the generator: npx ts-node generate.ts produces all invoices (10 seconds)
  3. Review: open the PDFs, confirm everything looks right (2 minutes)
  4. Send: email each invoice to the client (or ask Claude to add auto-emailing via Resend)
  5. Track: run npx ts-node track.ts status weekly to check who's paid

Total time: 10 minutes per month. Compare that to the 1 to 2 hours you're probably spending now, fumbling with templates and spreadsheets.

Going Further: Auto-Emailing

If you want to skip the manual email step, Claude Code can wire up Resend (free for 100 emails/day) to send invoices automatically:

Add email delivery using Resend:
1. After generating all invoices, send each one to the client's
   email address with the PDF attached
2. Use a professional email template with a brief message:
   "Hi [contact name], please find attached invoice [number]
   for [amount]. Payment is due by [due date]."
3. Store the Resend API key in a .env file
4. Log each sent email to a delivery-log.json file
5. Add a --dry-run flag that shows what would be sent without
   actually sending

The --dry-run flag is critical. Always test before sending real invoices. One wrong email to a client is a headache you don't need.

Why Not Just Use FreshBooks or Wave?

You absolutely can. If you want a full accounting suite with expense tracking, time tracking, and tax reports, a dedicated tool makes sense. But if all you need is to generate invoices and track payments, you're paying $15 to $50 per month for something you can build in an afternoon.

The bigger point: this project teaches you the pattern. Config file as input, processing logic in the middle, formatted output at the end. That same pattern builds client reports, proposal generators, contract templates, and a dozen other tools a solo founder needs. The first automation guide walks through this exact pattern in detail.

Handling Edge Cases

Real invoicing has wrinkles. Here's how to handle the common ones:

  • Different currencies: the config already supports a currency field per client. Tell Claude to format amounts with the correct currency symbol and locale.
  • Flat-fee projects: add an "amount" field alongside "hours" and "rate". If amount is set, use it directly. If hours and rate are set, multiply them.
  • Recurring retainers: for clients on the same invoice every month, flag them as "recurring": true in the config so you don't have to re-enter their line items.
  • Late fees: ask Claude to add a late-fee calculation that applies automatically when an invoice goes overdue.

Each of these is a one-prompt addition. Describe what you need, Claude bolts it on.

What Founders Get Wrong

The biggest mistake: over-engineering the first version. You don't need multi-currency support, tax calculations, and auto-emailing on day one. Build the simplest version that generates a PDF. Use it for one month. Then add features based on what you actually need, not what you think you might need.

The second mistake: not version-controlling the config file. Put clients.json and payments.json in a git repo. You now have a complete history of every invoice you've ever sent and every payment you've received. That's worth its weight in gold come tax season. Read the best practices guide for more on organizing Claude Code projects.

Build It This Weekend

If you're a solo founder who invoices clients monthly, this project pays for itself immediately. One afternoon of setup eliminates a recurring chore that you'll deal with every month for as long as you run your business.

New to Claude Code? Start with the step-by-step tutorial to get running in 10 minutes.

Want to go deeper? ClaudeFluent is our premium training program where I teach founders and operators how to build real tools with Claude Code. Invoice generators, dashboards, automations, and full web apps. Join us for the next cohort.

Related Guides

WANT MORE LIKE THIS?

Learn to build with Claude Code

6 hours of hands-on training. Build real projects. Ship without waiting on engineering.

View Class Details