Invoice intake and GL coding
Your AP inbox (through an email parser or OCR step in Zapier or Make) posts each invoice’s text to a webhook. Claude extracts vendor, dates, totals and line items as strict JSON, codes every line against your chart of accounts with a reason, and flags anything odd. You check it at the approval gate and it goes to your accounting system as a draft bill.
- Extract and code Claude API · Sonnet 5
- Check coding You
- Send to AP Shell
What each step does
Extract and code
Claude API · Sonnet 5Pulls vendor, dates, totals and line items out of the invoice and codes each line to one of your accounts.
Check coding
YouShows you the extracted invoice and coding. Reject with corrections and it is redone.
Send to AP
ShellSends the coded invoice to your accounting system through a webhook.
From copy to first run
- Copy the pipeline JSON with the button above.
- In Jimothy, open Pipelines → New pipeline, paste it under “Or import a pipeline JSON” and click Import.
- Fill in the variables below under Pipeline settings → Variables.
- Triggers → Add trigger → Webhook. Post each invoice from your AP inbox with title (vendor or subject), description (the invoice text) and key (the invoice number).
What to fill in
The prompts and commands read these as {{vars.<name>}}. The examples are placeholders: replace them with your own.
| Variable | What to put in it | Example |
|---|---|---|
chartOfAccounts | Your expense accounts, one per line: number and name. Lines are only coded to these. | 6100 Advertising 6120 Software subscriptions 6200 Contractors 6300 Office supplies 6400… |
approvalLimit | Invoices over this total are called out at the top of the approval. | 2500 |
apWebhookUrl | Where coded invoices go, e.g. a Zapier hook that creates a draft bill in QuickBooks, Xero or NetSuite. | — |
Show the pipeline JSON
{
"jimothyPipeline": 1,
"name": "Invoice intake and GL coding",
"description": "Extracts an incoming invoice, suggests GL codes for each line, and sends it to your AP tool after you check it.",
"icon": "workflow",
"color": "#16a34a",
"repo": {
"mode": "scratch"
},
"concurrency": 5,
"variables": {
"chartOfAccounts": "6100 Advertising\n6120 Software subscriptions\n6200 Contractors\n6300 Office supplies\n6400 Travel\n6500 Meals and entertainment\n6900 Other expenses",
"approvalLimit": "2500",
"apWebhookUrl": ""
},
"steps": [
{
"id": "extract",
"name": "Extract and code",
"type": "agent",
"description": "Pulls vendor, dates, totals and line items out of the invoice and codes each line to one of your accounts.",
"harnessId": "anthropic-api",
"model": "claude-sonnet-5",
"timeoutMinutes": 5,
"retries": 1,
"passPattern": "^\\s*\\{[\\s\\S]*\\}\\s*$",
"failPattern": "```",
"prompt": "Invoice {{issue.key}} ({{issue.title}}):\n\n{{issue.description | truncate:40000}}\n\nChart of accounts:\n{{vars.chartOfAccounts}}\n\nAnswer with one JSON object and nothing else (no code fences):\n{\n \"vendor\": \"...\",\n \"invoiceNumber\": \"...\",\n \"invoiceDate\": \"YYYY-MM-DD\",\n \"dueDate\": \"YYYY-MM-DD or null\",\n \"currency\": \"USD\",\n \"subtotal\": 0,\n \"tax\": 0,\n \"total\": 0,\n \"lines\": [{\"description\": \"...\", \"amount\": 0, \"account\": \"number from the chart\", \"reason\": \"why this account\"}],\n \"flags\": [\"anything a reviewer should check: totals that don't add up, a missing due date, an unusual amount, a possible duplicate\"]\n}\nCopy amounts exactly as written. Use only account numbers from the chart; if none fits, use the \"Other\" account and say so in flags."
},
{
"id": "approve",
"name": "Check coding",
"type": "approval",
"description": "Shows you the extracted invoice and coding. Reject with corrections and it is redone.",
"dependsOn": [
"extract"
],
"loopBackTo": "extract",
"maxLoops": 3,
"approvalMessage": "Send this coded invoice to AP? Totals over {{vars.approvalLimit}} need a second look. Reject with corrections to have it redone.\n\n```json\n{{steps.extract.output}}\n```"
},
{
"id": "send",
"name": "Send to AP",
"type": "shell",
"description": "Sends the coded invoice to your accounting system through a webhook.",
"dependsOn": [
"approve"
],
"timeoutMinutes": 2,
"command": "printf '{\"invoice\":%s,\"coded\":%s}' {{issue.key | json}} {{steps.extract.output | trim}} | curl -fsS -X POST -H 'Content-Type: application/json' --data @- {{vars.apWebhookUrl}}"
}
]
}More for accounting & finance, and beyond
Month-end variance commentary
Compares this month’s trial balance with last month’s, explains every material swing, and files the write-up after you sign off.
Accounting & financeExpense policy check
Checks each submitted expense against your written policy. Clean ones go straight through; only the flagged ones wait for you.
Accounting & financeOverdue invoice reminders
Reads your AR aging report every week, drafts a reminder for each overdue customer in the right tone for how late they are, and sends the ones you pick.