Automate Your Invoicing with Stripe and Google Sheets in 20 Minutes

If you’re a freelancer or small shop owner, invoicing is a necessary evil. You log into Stripe, export the CSV, rename it, upload it to your accounting tool, and then manually reconcile any discrepancies. It’s a waste of an hour every week. I built a script that does it all for me, and you can too.

Here’s the situation: every Monday, I need a clean list of all payments from the previous week, with customer names, amounts, and fees. Stripe’s dashboard shows it, but exporting and formatting takes time. I wanted a single button that pulls the data into a Google Sheet, formatted and ready to go.

The solution is a Python script that uses the Stripe API and Google Sheets API. You set up a cron job (or a GitHub Action) to run it weekly. The script fetches all transactions from the last 7 days, cleans the data, and appends it to a specific spreadsheet. It even categorizes by product if you have multiple SKUs.

Before you start, you’ll need a Stripe API key (you can generate one with restricted permissions) and a Google Cloud project with Sheets API enabled. The script itself is about 150 lines, and I’ve commented it thoroughly so you can tweak the date range or add extra fields.

Once it’s running, you’ll never manually export again. I’ve been using this for six months, and it’s saved me roughly 12 hours. Plus, my accountant loves that the data is always consistent.

A few pitfalls to avoid: make sure your API key has only the permissions needed (read-only is fine), and be careful with time zones. I use UTC to keep things consistent. Also, if you’re using Google Sheets’ IMPORTDATA, you’ll hit rate limits, so this script is safer.

If you’re on the free tier of Google Cloud, you’ll still have plenty of quota for this. The script runs in a few seconds, so it’s cheap.

I’ve packaged this as a ready-to-run script in the Kintly library, with full instructions. You just need to plug in your keys. It’s the kind of task that feels trivial but adds up. Automate it once, and you’ll wonder why you didn’t do it sooner.

Of course, you can extend this to generate PDF invoices, send them via email, or even sync to QuickBooks. The flexibility is there if you want it.

Try it this week. You’ll get your Monday morning back.