How to Automate Your Invoicing (And Never Chase a Payment Again)
Manual invoicing costs you hours every month. Here's how to set up automated billing with Miru's CLI and Stripe integration.
Here’s how most agencies handle invoicing: someone — usually the founder, office manager, or whoever drew the short straw — spends the first week of every month generating invoices manually. Pull up each client. Look at the time entries. Copy numbers into an invoice. Double-check the math. Send it. Repeat for every client.
If you have 15 clients, that’s a full day. Every month. That’s 12 days a year spent on copy-paste busywork.
Stop doing this.
The automated invoicing workflow
Miru can generate invoices from time entries with one click. But the real power is in automating the entire billing cycle — from time entry to payment received. Here’s how.
Step 1: Track time consistently
Everything downstream depends on this. If time entries are accurate and tagged to the right project, invoicing is automatic. If they’re not, no automation saves you.
Set up your projects with the correct hourly rates. Assign team members. Make sure everyone tracks daily — timer, manual entry, or CLI. The weekly timesheet view catches gaps before they become billing problems.
Step 2: Generate invoices from the CLI
Miru’s CLI isn’t just for logging time. You can generate invoices programmatically:
# Generate an invoice for a client for the previous month
miru invoice generate --client "Acme Corp" --period last-month
# Generate invoices for ALL clients for a date range
miru invoice generate --all --from 2026-03-01 --to 2026-03-31
# Preview before sending
miru invoice list --status draft
This is where it gets powerful. Wrap it in a cron job:
# Run on the 1st of every month at 9am
0 9 1 * * miru invoice generate --all --period last-month
Every month, invoices generate themselves from the time entries your team already logged. No human in the loop.
Step 3: Connect Stripe for automatic payments
Connect your Stripe account once. Every invoice Miru generates includes a payment link. Your client opens the invoice email, clicks “Pay Now,” enters their card, done.
For retainer clients, it’s even better: set up Stripe auto-pay and the payment processes automatically when the invoice is generated. The client gets a receipt. You get paid. Nobody sends a “friendly reminder” email.
Step 4: Set up payment reminders
Not every client pays on time, even with Stripe links. Configure automatic reminders:
- Day 7: Gentle reminder that the invoice is outstanding
- Day 14: Firmer reminder with the payment link
- Day 30: Final notice
These go out automatically. You never write another “just following up on invoice #247” email.
The full automation stack
Put it all together and your monthly billing workflow looks like this:
- Daily: Team tracks time (already happening)
- 1st of month: Cron job generates invoices from time entries
- Same day: Invoices are emailed to clients with Stripe payment links
- Retainer clients: Auto-pay processes immediately
- Non-retainer clients: Payment reminders fire on schedule
- Ongoing: Payments are recorded automatically as they arrive
Your involvement: zero. Unless something unusual happens — a disputed amount, a rate change, a new client — the system runs itself.
The math
Let’s say you spend 6 hours per month on manual invoicing. At an effective rate of $150/hour (your time as a founder or senior person), that’s $900/month in opportunity cost. $10,800/year.
Miru for a 20-person team: $20/month. $240/year.
The automation pays for itself 45x over. And that’s before accounting for the faster payments — most teams see average time-to-payment drop from 25-30 days to under 10 when they add Stripe links and automatic reminders.
Stop chasing invoices. Set up the system once and let it run.
Vipul A M
Co-founder at Saeloun. Building Miru. Rails contributor. Shipping from Pune, India.
Read next
How to Bill Clients Without Losing Your Mind
A practical guide to client billing for agencies: time tracking, invoicing, expense management, and getting paid on time.
The Freelancer's No-BS Guide to Getting Paid
Track your hours, send professional invoices, and get paid without chasing. A practical guide for freelancers who'd rather do the work.
Self-Hosting Miru: A Complete Guide for Teams That Own Their Data
Step-by-step guide to deploying Miru on your own infrastructure. Docker, bare metal, or cloud -- your servers, your rules.