// guides

Log invoices and receipts from email into a spreadsheet automatically

Turn invoice and receipt emails into spreadsheet rows (date, vendor, amount, currency, invoice number), including amounts inside PDF invoices. Free script and n8n workflow, CSV or Google Sheets.

Updated 2026-10-16 · about 10 minutes

Rather not set it up yourself? Describe your task in one sentence and we'll build and test it for you, free →

Steps

  1. Download the free agent

    Get the invoice & receipt logger and run python3 invoice_logger.py --eml-dir sample_emails --dry-run to see three sample invoices parsed.

  2. Connect your mailbox

    Set IMAP_HOST, IMAP_USER and an app password. DAYS=90 back-fills the last quarter on the first run.

  3. Tune what counts as an invoice

    By default, subjects or file names with invoice, receipt, facture, rechnung or order confirmation count. Add FROM_CONTAINS=stripe,aws,billing@ to only log specific senders.

  4. Optional: send rows to Google Sheets

    Paste the included google_sheet_webhook.gs into your Sheet (Extensions → Apps Script), deploy it as a web app, and put the URL in SHEET_WEBHOOK_URL. No Google Cloud project needed.

  5. Run it daily

    Cron 0 7 * * *, or import the n8n workflow, which adds a Google Sheets row for each new invoice email.

How the amount is found

It looks for the last “total”-style line (grand total, amount due, total paid, montant total…) in the email and in text-based PDFs, and understands $1,049.99, 18,00 € and £24. If there's no total line, it takes the largest amount. It's pattern matching, not AI, so it's free and private, but check the numbers before tax time.

Pair it with the attachment saver

The attachment saver files the PDFs themselves into month/sender folders, and this agent keeps the ledger.

Skip the setup: free download

The Invoice & receipt logger agent does all of this. It's tested, MIT-licensed, and comes as an n8n workflow plus a Python script.

Get the free Invoice & receipt logger agent → Or have us build yours →

FAQ

Does it read scanned PDF invoices?

No. Scans are images, and there's no OCR. The row is still logged with the date and vendor and an empty amount.

Is my data sent anywhere?

Only to your own CSV, and to your own Google Sheet if you set one up. There's no AI API and no third party.

Excel instead of Google Sheets?

The CSV file opens directly in Excel and Numbers.

Related guides

New guides

Want one built for your task?

Describe it in one sentence. We build it, test it and email it to you, usually within 24h. Free while we're in beta.

We'll only email you about your agent and TaskToAgent.