More in Bookkeeping, receipts & invoices.
Automate supplier invoice PDFs into ERP exports with Gemini and Apps Script
PartialEvidence: Described by posterPosted Last checked
Asaf Lecht's Gemini Apps Script cut invoice batches to a 5-minute review, but Gemini invented dates until validation.
How to use this
- Tap Copy prompt.
- Open Gemini.
- Paste it into the message box.
- Send it, then read the answer before acting on it.
New to this? What's a prompt?
A prompt is the message you send to the AI tool. Copy the one on this page, put your own details where it asks, and read the answer before you act on it.
Prompt
Recreated prompt
The source didn't share its exact prompt, so we wrote one from what it describes. The result shown is the source's, not ours.
The person didn't share their exact words, so we wrote this from what they described. We haven't tested it, and they didn't use this exact version.
Design an Apps Script pipeline that watches a Drive inbox of supplier invoice PDFs, uses Gemini to extract structured fields, escalates to a stronger model when confidence is low or dates look wrong, writes rows to a Sheet, and exports the exact tab-delimited ERP format. Handle multi-invoice PDFs and checkpoint/resume before the 6-minute limit.
Try this in:
Sends the Recreated prompt shown above. ChatGPT and Grok open with it filled in, and ChatGPT may send it straight away. Gemini and Claude open empty, so we copy the prompt for you to paste. Every button also copies it.
Opens in a new tab. We don't see what you send.
These links are only a shortcut. We're not affiliated with OpenAI, Google, Anthropic or xAI, and your results may not match the source.
Optional stronger version
Our rewrite with extra checks. The poster didn't test it.
Before you start, ask me 1–3 short questions about the details below and wait for my answers. Once I've answered, confirm the plan in one line and run the whole task start to finish. Goal: Automate supplier invoice PDF intake into validated Sheet rows and ERP export files. Questions to ask me first: - What fields and date formats does the ERP require? - Where do PDFs land, and how many arrive per week? - Which model should run first, and when should we escalate? Inputs (fill in or confirm): - Drive inbox folder: [ID] - Sheet schema: [COLUMNS] - ERP export rules: [FORMAT] - Sample PDFs: [FILES] Rules: - Validate dates against plausible ranges; re-extract on suspicion. - Detect and split multi-invoice PDFs. - Save both model responses when escalating. - Checkpoint before Apps Script timeouts. Checkpoint: Run five sample invoices and show extraction accuracy before enabling the watcher. If you get stuck: If Hebrew RTL breaks the review UI, isolate layout fixes from extraction logic. Verify before you finish: Diff ERP export bytes against a known-good import file before go-live. Output: Architecture notes, Apps Script outline, validation rules and a sample review workflow. Done when: Accounting can review in minutes instead of retyping every PDF.
AI tool
Outcome
Asaf Lecht built a Google Apps Script system for a client's accounting team that spent 15–30 minutes per supplier invoice PDF. A file watcher feeds Gemini for structured extraction, escalating from a fast model to a larger one when confidence is low; results land in Sheets and ERP export files, with a Hebrew review dashboard. Flash handled about 85% of invoices; harder ones auto-escalated. Challenges included multi-invoice PDFs, Gemini inventing dates (fixed with validation ranges and re-extraction), Hebrew RTL layout, Apps Script's 6-minute limit (checkpoint/resume), and a strict ERP format. The client moved from about 30 minutes per batch to a 5-minute review workflow.
Evidence: Described by posterThe person describes what happened in words, without screenshots or video.
Known limitations
PartialThe source says it only partly worked, or had a significant problem a person had to deal with.
What went wrong: Automation cut batches to about a 5-minute review, but Gemini sometimes fabricated dates until validation and model fallback were added.
Source
- Posted
- by Asaf Lecht
- Last checked
- Method:
- How we verify
https://seithx.github.io/2026/05/05/automating-invoices-with-apps-script-and-gemini.html
Context: Built for a client accounting team; firsthand builder report. En dash used for the 15–30 minute range.
More in Bookkeeping, receipts & invoices
Replace a $400-a-month bookkeeper stack with Claude and Claude Code
Dee left a $400/month QuickBooks bookkeeper stack after Claude and Claude Code built a local ledger and P&L prompts.
WorkedClaude +1Evidence: Described by posterView CaseBuild a free freelancer invoicing and expense tool with Claude Code
Joel Henry used Claude Code to build Kova, a free invoicing and expense tracker for contractors, after finding no lightweight tool.
WorkedClaude CodeEvidence: Described by posterView CaseAuto-file inbox invoices to Drive and Sheets with Gemini and Apps Script
Silvia Carasel used Gemini plus Apps Script to save Gmail invoices to Drive, log Sheets rows and email a report on the 20th.
WorkedGeminiEvidence: Described by posterView CaseRun a read-only Claude Code CFO agent over a local expense spreadsheet
Martino Vigiani's Claude Code CFO reads synced expense JSON for burn, runway and renewals, and is barred from writing the books.
WorkedClaude Code +1Evidence: Described by posterView CaseReplace QuickBooks with Beancount and a 20-minute Claude Code invoicer
John Sambrook left a $1,800/year QuickBooks plan after Claude Code built a Beancount invoicer in about twenty minutes.
WorkedClaude CodeEvidence: Described by posterView CaseReplace a bookkeeper with ChatGPT guidance, then Claude Code on QuickBooks
Alex Willen used ChatGPT to set up books for about 200 transactions, then gave Claude Code a QuickBooks API key to post entries.
WorkedChatGPT +1Evidence: Described by posterView Case
Similar cases
File subcontractor invoices into 30 job folders automatically with ChatGPT
A builder used ChatGPT to make a script that reads emailed invoices and files them into 30 job folders, saving 5–6 hours a week.
WorkedChatGPTEvidence: Article or interviewView CaseTurn voice memos into invoices and expense entries with Zapier and ChatGPT
Danny Richman built a Zapier and ChatGPT flow so a garden business owner can speak a voice memo and have Zoho Books send the invoice.
WorkedChatGPT +1Evidence: Company case studyView CaseWrite outgoing wire invoices with ChatGPT agent
The poster has ChatGPT agent write all their outgoing wire invoices and says it saves 5 minutes three times a week.
WorkedChatGPT agentEvidence: Described by posterPoster says:5 minutes, 3 times a week
View CaseBuild double-entry invoicing against Czech law with Claude Code in three days
Jiří Dolejš used Claude Code for a ~3,430-line Czech-law accounting spec and shipped double-entry invoicing in three days.
WorkedClaude CodeEvidence: Described by posterView Case

