# Make.com: Invoice Extraction with GPT-4o Vision

> Watch a Gmail label, OCR the attached invoice with GPT-4o vision, push line items to Xero or QuickBooks, and Slack the exception cases.

**Platform:** Make.com  
**Category:** make  
**Difficulty:** Advanced  
**Tags:** make, vision, invoice, accounting  
**Updated:** 2026-06-20  
**Source:** https://promptfoo.tech/workflows/make-invoice-processing-with-vision

## Overview
Bookkeeping teams spend hours retyping invoices. This Make scenario watches a Gmail label ('Invoices'), sends the PDF or image to GPT-4o with a structured extraction prompt, validates totals against line items, and pushes clean data to your accounting system. Anything ambiguous goes to Slack — a human decides, but never types.

## How it works
1. Gmail Watch Emails module filtered by label:invoices.
2. Convert attachment to base64; send to OpenAI Vision.
3. Prompt returns a strict JSON: vendor, date, currency, subtotal, tax, total, line_items[].
4. Math check: sum(line_items) + tax === total (with 1% tolerance).
5. On match → Xero API create bill. On mismatch → Slack with the extraction + attachment link.

## Benefits
- Cuts AP data entry by 90%+.
- Math validation catches OCR errors before they hit the ledger.
- Exception queue in Slack keeps the human in the loop for the 5% edge cases.

## Use cases
- Small businesses processing 50-500 invoices/month.
- Agencies with multiple client entities to reconcile.
- Bookkeepers offering AP as a service.

## Step-by-step
### Step 1: Set up the Gmail label
Manual for week one so you can grade extraction quality. Automate labeling later with a filter.

### Step 2: Design the extraction schema
Keep it flat. Currency in ISO 4217. Line items as {description, qty, unit_price, amount}.

### Step 3: Prompt the model
System: 'You are a bookkeeping OCR assistant. Return only valid JSON matching the schema. Never invent values.'

### Step 4: Validate
Router: sum of line items + tax must equal total within 1%. Currency must be ISO. Date must parse.

### Step 5: Xero / QuickBooks push
Match vendor by name → contact_id; create draft bill. Never auto-approve.

### Step 6: Exception flow
Slack message with vendor guess, extracted JSON, and 'Approve' / 'Reject' buttons. Reject archives to review folder.

## Example
```
Attachment: acme_invoice_042.pdf. Extraction: vendor:Acme Corp, total:1240.00 USD, 4 line items. Math check passes. Xero draft bill created. Slack: 'Xero draft ready — needs approval.'
```

## FAQs
**How accurate is GPT-4o vision on invoices?**

95%+ on typed invoices, 85%+ on scanned receipts. Math validation catches the misses that would matter.

**PII / compliance?**

For US/EU businesses, review OpenAI's DPA. For regulated industries, Azure OpenAI + a compliant Gmail policy is the cleaner path.

**Multi-currency?**

Ask for ISO 4217 code in the schema. Convert to your base currency in accounting, not in Make.

---
Licensed under CC-BY-4.0. Attribution: PromptFoo.tech