Extracting Invoices From WhatsApp Photos With AI Vision (Apps Script + Google Sheets)
Every logistics and field-sales team runs the same expensive process: a driver photographs a receipt into a WhatsApp group, and a back-office clerk manually types the invoice number, total, and date into a spreadsheet. Hundreds of receipts a week = transcription errors and thousands of wasted hours.

Every logistics and field-sales team runs the same expensive process: a driver photographs a receipt into a WhatsApp group, and a back-office clerk manually types the invoice number, total, and date into a spreadsheet. Hundreds of receipts a week = transcription errors and thousands of wasted hours. AI vision models kill that bottleneck. Here's the pipeline that turns a blurry field photo into clean structured data in seconds. OCR reads characters. Modern vision models (Claude Vision, Gemini Vision, GPT-4 Vision) read structure โ they distinguish a tax ID from a total, and a date from an amount, even on crumpled, angled, or poorly lit receipts. No brittle per-vendor parsers. WhatsApp image โ Apps Script doPost โ forward to vision model โ model returns JSON { InvoiceNumber, TotalAmount, VendorName, Date, Category, confidence_score } โ confidence routing: > 90 โ auto-append to ledger 70โ90 โ flag for human review < 70 โ ask driver to re-photo โ write row to Google Sheet (+ link to original image) โ auto WhatsApp confirmation to driver The confidence_score is the whole trick โ it's what stops bad extractions from silently polluting your ledger. Gemini Vision โ cost-efficient default, strong multilingual OCR, great on clean receipts. Claude Vision โ highest accuracy on degraded receipts; use for high-stakes flows. GPT-4o Vision โ competitive, strong structured extraction. Pattern: Gemini for the first pass, escalate only low-confidence cases to Claude / GPT-4o. ~500 receipts/week: vision API $10โ40 + WhatsApp API $30โ60 + Apps Script free = ~$40โ100/month. Versus a clerk at ~25 hrs/week = $2,000โ4,000/month in loaded labor. Per-receipt cost: $0.005โ0.02 (compress images to ~1024px to cut it further). Accuracy: 92โ97% on legible receipts, 75โ85% on handwritten/damaged โ hence the confidence routing. Auto-appending with no confidence threshold (pollutes the ledger) Silent failures with no driver feedback loop Storing raw images forever (privacy exposure โ set a retention policy) Unofficial WhatsApp libraries (break under image load; use official APIs) Prompt drift โ pin the prompt in source control and re-test on 50 known receipts on every change The complete pipeline, categorization, and privacy controls are in the full guide on the MageSheet blog. Built by the MageSheet team.
Key Takeaways
- โขEvery logistics and field-sales team runs the same expensive process: a driver photographs a receipt into a WhatsApp group, and a back-office clerk manually types the invoice number, total, and date into a spreadsheet
- โขThis story was reported by Dev.to, covering developments in the dev space.
- โขAI advancements continue to reshape industries โ read the full article on Dev.to for complete coverage.
๐ Continue reading the full article:
Read Full Article on Dev.to โShare this article



