Invoice Parser

Extract fields from invoices, match against PO database, and push to accounting with human approval.

Extract fields from invoices, match against PO database, and push to accounting with human approval. Automate invoice processing that currently takes 20 min per invoice. AP teams processing 200+ invoices/month will see ROI in week one.

This is the whole blueprint, nothing held back: the model, the tools, the exact prompt, the source on disk, and the setup. Everything you need to run Invoice Parser yourself is on this page, and it deploys in an afternoon.

See it running

Agents like Invoice Parser run behind a review queue where every action waits for a human. Here is that pattern, live: every action stays visible and reviewable. Click into it.

crescendo.51ultron.com/kits/agent-inbox

What it does

Invoice Parser handles the work end to end:

  • Extract vendor, dates, line items, totals from any invoice format
  • Match invoices against purchase order database automatically
  • Human-in-the-loop approval gate before pushing to accounting
  • Idempotent tool calls prevent duplicate entries

The anatomy

An agent is a composition, not a prompt: a model, the tools it is allowed to call, the integrations that give those tools reach, and the rules that keep it honest. Here is Invoice Parser on one card.

Invoice Parserblueprint
Model
claude-sonnet-4-6
Tools
extract_invoicematch_popush_to_accounting
Integrations
Zod
Guardrails
never auto-approve. always wait for human confirmation before pushing.; if fields are ambiguous, ask the user to clarify

The instructions

Every run is governed by this prompt. It is short on purpose: enough to make Invoice Parser reliable, not so much that it can misread itself. Copy it as a starting point for any agent you build.

Invoice Parser
You are an accounts-payable copilot. You help process invoices by extracting key fields, matching against purchase orders, and pushing approved entries to accounting. WORKFLOW: 1. The user selects or uploads an invoice. 2. Call extract_invoice to pull vendor, date, line items, total, tax, currency. 3. Call match_po to check against the PO database. Report match/mismatch/no-PO. 4. Only call push_to_accounting when the user explicitly approves. RULES: - Never auto-approve. Always wait for human confirmation before pushing. - If fields are ambiguous, ask the user to clarify. - Each tool call is idempotent per toolCallId.

The source, on disk

Three files carry the whole agent: the definition with its tools, the environment it expects, and the setup. Walk them.

invoice-parser/invoice-parser.ts1.1 KB
1import { agent, tool } from "@agent-sdk"
2import { z } from "zod"
3
4const invoiceSchema = z.object({
5 vendor: z.string(), date: z.string(),
6 lineItems: z.array(z.object({
7 description: z.string(), qty: z.number(), unitPrice: z.number(),
8 })),
9 subtotal: z.number(), tax: z.number(), total: z.number(),
10 currency: z.string(),
11})
12
13export default agent({
14 model: "claude-sonnet-4-6",
15 permissionMode: "bypassPermissions",
16 maxTurns: 15,
17 systemPrompt: `...`, // see System Prompt above
18 tools: {
19 extract_invoice: tool({
20 description: "Extract structured fields from an invoice",
21 inputSchema: z.object({ invoiceId: z.string() }),
22 execute: async ({ invoiceId }) => { /* parse invoice */ },
23 }),
24 match_po: tool({
25 description: "Match extracted invoice against PO database",
26 inputSchema: invoiceSchema,
27 execute: async (invoice) => { /* PO lookup */ },
28 }),
29 push_to_accounting: tool({
30 description: "Push approved invoice to accounting system",
31 inputSchema: z.object({ invoiceId: z.string(), approved: z.boolean() }),
32 execute: async ({ invoiceId, approved }) => { /* push to ERP */ },
33 }),
34 },
35})

The business case

If you run an agency, Invoice Parser is also a product. It sells into accounting firms, cfo offices, ap departments, and the numbers work at very small scale.

$3,500

setup you can charge

$500/mo

monthly retainer

3

jobs off your plate

Ship it

The whole install is a handful of commands and the keys from the env file. Run the list, then point Invoice Parser at real work.

Deploy checklist

0 of 5

That is the entire blueprint: one model, 3 tools, and a prompt. Built by hand it costs you an afternoon. Inside Ultron it costs you a sentence, because you can build this exact agent in the workforce and watch it run before you commit to anything.

Build Invoice Parser in Ultron

1
Describe what you want

Start from this blueprint or your own words. Ultron reads the intent and picks the tools.

2
It builds the agent

The model, the tools, the prompt, the console. Assembled in front of you, nothing to wire.

3
Watch it run

Test it live in the chat, then put it to work. You review what it does, it does the rest.

Keep reading