BlogHow to Automatically Extract Invoices from Gmail

How to Automatically Extract Invoices from Gmail

2026-07-21 · 3 min read

Most invoices arrive by email. Which means the most useful automation you can build is the one that watches your inbox: every invoice that lands gets read, extracted, and filed automatically, without you downloading a single attachment. This is the trigger step of no-code invoice automation, and it's the one that saves the most time because it removes the "download the PDF" step you do dozens of times a week.

The workflow

Four steps, identical whether you build it in n8n, Make, or Zapier:

  1. Trigger: a new email arrives in Gmail with an attachment (optionally filtered to a label like Invoices or a sender list).
  2. Grab the attachment: the PDF or image on the email.
  3. Extract: send the attachment to the parsing API, get back structured JSON.
  4. File it: append a row to a sheet, or create a bill in your accounting tool.

Setting it up

Filter first. Don't process every email — most aren't invoices. Create a Gmail label and a filter (e.g. attachments from known vendors, or emails matching "invoice"/"receipt"), and trigger only on that label. This keeps the automation cheap and clean.

The extraction step is one HTTP request. Point it at:

text · 5 lines
POST https://docuparseapi.com/api/v1/extract
Authorization: Bearer dex_live_...
Content-Type: multipart/form-data

file=<the email attachment>

The response comes back as normalized fields:

json · 8 lines
{
  "merchant": "North Harbor Electronics",
  "invoice_id": "NHE-2026-0042",
  "date": "2026-05-11",
  "total": "223.86",
  "currency": "EUR",
  "line_items": [ ... ]
}

The one thing to get right: passing the attachment as a file. In an email-triggered workflow the extraction step needs the attachment sent as binary multipart/form-data in the file field — not as a link, and not as text. Each platform handles email attachments a little differently, so if your first run returns an error instead of JSON, that's almost always the cause. The platform setup guides — n8n, Make, Zapier — show the exact configuration for sending the attachment through.

File the result. Map the JSON fields to your destination — a row in Google Sheets, a bill in QuickBooks or Xero, or a database entry in Notion.

Build it in your tool of choice

The step-by-step for each platform:

  • n8n — Gmail trigger, the file-handling setup, HTTP node, and destination mapping pre-built.
  • Make — visual Gmail-to-destination workflow.
  • Zapier — the simplest email trigger to start with.

Not sure which platform? See n8n vs Make vs Zapier for invoices. Processing a backlog rather than a live inbox? See automating invoice processing at scale.

The result

Once it's live, an invoice hits your inbox and thirty seconds later the data is filed — while you're doing something else. Over a month that's hours of downloading-and-typing you never do again.

You can build the whole thing on the free tier — 20 documents a month, no credit card, enough to automate a real inbox. Or see the extraction on a real document first.

Ready to start parsing documents?

More from the blog