Invoice Processing and Expense Categorisation
1. The Problem
For any business processing more than ten invoices per month, manual data entry is a significant hidden cost. Each invoice requires opening, reading, extracting key fields, entering into accounting software, filing in the correct folder, and reconciling against purchase orders. At fifteen minutes per invoice, twenty invoices per month consumes five hours of skilled staff time doing work that produces zero business value.
2. Integration & Webhook Setup
Follow the exact steps below to configure and deploy this automation inside your OpenClaw workspace.
- 1Create a new agent named `invoice-processor`.
- 2Connect your accounting software: Xero and QuickBooks both have full OpenClaw integrations. You will need to authorise an API connection with read/write access to bills and transactions.
- 3Configure your `CHART_OF_ACCOUNTS` in the Context Payload — paste your expense categories (the names must match exactly what appears in your accounting software to ensure correct posting).
- 4Set your email trigger: configure a monitored inbox folder where invoices are routed — the agent watches this folder and processes every PDF it contains.
- 5Run the agent against 5 historical invoices in test mode first to validate categorisation accuracy before enabling live posting to your accounting software.
3. The Context Payload (context.json)
Save this file as: .openclaw/agents/invoice-processing-and-expense-categorisation/context.json
{
"automation_id": "6",
"title": "Invoice Processing and Expense Categorisation",
"level": 1,
"tier": "Solopreneur Engine",
"setup_time": "Under 60 min",
"estimated_api_cost": "~$3–$6/mo",
"client_price_range": "$250–$500",
"agents": [
{
"role": "orchestrator",
"model": "claude-3-5-sonnet",
"temperature": 0.2,
"max_tokens": 4096
}
],
"memory": "session",
"output_format": "structured_json",
"human_review_gate": true,
"documentation_standard": "required"
}4. Execution Commands
Run these commands from your openclaw-workshop/ directory to validate, test, and schedule this automation. Commands are taken directly from The OpenClaw Income Engine, Appendix E.
# ── STEP 1: Test extraction with 5 historical invoice PDFs ──
$ openclaw run invoice-processor --test --input ./test_invoices/ --dry-run
$
# ── STEP 2: Review extraction accuracy ──
# Check: are amounts correct? Are vendor names clean?
# Are account categories sensible? Adjust chart_of_accounts if not.
$
# ── STEP 3: Run single invoice live (with posting to Xero) ──
$ openclaw run invoice-processor --input ./invoice_001.pdf --live
$
# ── STEP 4: Verify the posted bill in Xero ──
# Xero → Accounts → Bills → check vendor name and account code.
$
# ── STEP 5: Enable the email watcher (production mode) ──
$ openclaw watch invoice-processor --start
$
# ── View all invoices processed this month ──
$ openclaw run invoice-processor --history --period this_month
$
# ── Switch accounting provider to QuickBooks ──
$ openclaw run invoice-processor --context.accounting_provider="quickbooks"