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
- Gmail Watch Emails module filtered by label:invoices.
- Convert attachment to base64; send to OpenAI Vision.
- Prompt returns a strict JSON: vendor, date, currency, subtotal, tax, total, line_items[].
- Math check: sum(line_items) + tax === total (with 1% tolerance).
- 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 guide
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.'