AgentRecipes
Recipes › Finance & invoicing

How to extract invoice data into a bookkeeping sheet with n8n and OpenAI

Finance & invoicingn8n

The problem

Receipts and invoices arrive as photos and PDFs. Typing date, merchant, amount and VAT into a spreadsheet and filing the file is slow and error-prone.

Tools needed

Step-by-step recipe

  1. Build a small upload page that posts the file to an n8n webhook.
  2. Identify the user (the prototype looks up a token in a Google Sheet).
  3. Send images to OpenAI vision; for PDFs, extract the text first and then analyse it.
  4. Have the model return JSON (date, merchant, gross amount, VAT rate, category) and show it to the user to review and edit.
  5. On save, store the file in a Drive folder per user and month, and append the data to a yearly sheet.

Copyable prompt

Prompt template
Extract bookkeeping data from this invoice or receipt. Return JSON only:
{"date": "YYYY-MM-DD", "merchant": "...", "gross_amount": number, "currency": "...", "vat_rate": number|null, "vat_amount": number|null, "category": one of [CATEGORIES], "invoice_number": "..."|null}
Use null for anything not clearly printed on the document. Do not calculate or guess missing values.

Original template written by AgentRecipes, not copied from the source. Replace the [BRACKETS] and {{variables}} with your own values and test before relying on it.

What the builder reported

A working prototype with a demo video. The source gives no accuracy or time-saving figures, and the public repo contains sanitised exports that need your own credentials and IDs.

These are the source author's own claims. AgentRecipes has not tested or verified them.

Watch out for

Source

Original write-up: GitHub ↗

Found via Agent Use Cases: “Extract invoice data and file it into a bookkeeping sheet”. This recipe summarises the source in our own words; read the original for the full details. Link last checked 2026-10-15.

More finance & invoicing recipes

Send overdue invoice reminders with an AI agent that adjusts its tone (n8n)Chasing late payments is awkward. Reminders should be gentle for a few days overdue and firmer after weeks, and nobody wants to write…n8nGenerate and email invoices from a template with MakeFreelancers who send several invoices a week rebuild the same document by hand each time.MakeSet up a supplier-invoice approval pipeline from Gmail with n8nSupplier invoices arrive by email and each one needs data extraction, duplicate and supplier checks, approval for larger amounts and an…n8n

New agent recipes in your inbox

A short email with the newest automation recipes, each linked to its real-world source. No spam, unsubscribe anytime.