← All recipes
FinanceManual invoice entry

Invoice capture and GL coding

Read invoices from a shared inbox, extract vendor, amount, tax and line items, suggest the GL code from your own coding history, and queue them for approval. Nothing hits the ledger without a human click.

GmailPostgresn8nClaude API

Trigger

An invoice lands in the AP inbox or is uploaded to the shared folder.

Required tools & APIs

Gmail or IMAP for the AP inbox · Postgres for coding history · Claude API for extraction · Your accounting tool for draft entries

Built for

Any industry

Time-to-value (typical)

About 3 days

Build size

Weekend build

How the agents hand off work

Each step names the agent, what it does, and where the work goes next.

  1. Reader

    Parse the invoice: vendor, invoice number, dates, line items, tax, currency.

    Hands structured fields to the Coder.

  2. Coder

    Suggest GL codes by matching the vendor and line description against your last 12 months of coding.

    Hands fields plus suggested codes with confidence to the Approver queue.

  3. Duplicate guard

    Check vendor plus invoice number plus amount against everything already recorded.

    Flags likely duplicates before they reach a human.

  4. Approver

    Queue the draft entry with the evidence attached; a human approves or edits in the accounting tool.

    Approved entries post to the ledger; exceptions go to the AP owner.

Copy the recipe

The SKILL.md runs as-is in Claude Code, OpenCode or Cursor. The workflow JSON is a portable spec that maps onto n8n, Make or Zapier style tools.

---
name: invoice-capture-gl-coding
description: Extract invoice fields, suggest GL codes from your own history, dedupe, and queue draft entries for approval. Use when an invoice reaches AP.
---

# Invoice Capture and GL Coding

## When to use
- Invoices arrive by email or upload and get typed in by hand.
- Coding decisions repeat for the same vendors every month.

## Inputs
- Invoice file or email (required).
- Coding history: past vendor-to-GL mappings (required, this is what the suggestions come from).
- Approval threshold: amount above which two approvals are needed (required).

## Process
1. Extract fields: vendor, invoice number, issue and due dates, line items, tax, currency, total.
2. Validate the arithmetic: line items plus tax should reconcile to the stated total. Flag mismatches.
3. Suggest GL codes per line by matching vendor and description against coding history. Show the history match that drove the suggestion.
4. Check duplicates on vendor plus invoice number plus amount across all recorded entries.
5. Queue as a draft entry with the invoice image, extraction and suggestions attached. Never post without approval.

## Outputs
- Draft entry in the accounting tool with fields and suggested codes.
- Exception list: arithmetic mismatches, duplicates, unknown vendors.

## Tools and integrations
- Gmail or IMAP: invoice intake.
- Postgres: coding history and duplicate checks.
- Claude API: field extraction from messy invoice layouts.
- Accounting tool API: draft entries only.

## Guardrails
- Never post to the ledger automatically. Draft entries only.
- Never suggest a GL code without showing the history match behind it.
- Unknown vendor or missing tax ID goes to exceptions, not to a guessed code.

## Examples
- "AWS invoice in the AP inbox." -> extracted, coded from history, queued for approval.
- "Same invoice number twice." -> duplicate flagged, second copy held.

Locked: the deeper blueprint

Architecture, guardrails, metrics worth watching and the failure modes that break first. Unlock it with your email and we will send the blueprint with the recipe link.

One email per unlock. Unsubscribe by replying to any message.

Want this built for real?

This recipe shows the shape of the work. Turning it into a running system with your data, your tools and review gates is what we build. If this bottleneck is one you live with, book a call and we will scope it.