Invoice Field Extractor
A skill the InTouch AI assistant loads to turn raw invoice text into a clean, structured JSON record.
What it does
Reads the plaintext of a single invoice and extracts the fields you actually need for AP/bookkeeping automation:
- Vendor — the issuing company (name, and address/email/phone when present), correctly distinguished from the bill-to party.
- Invoice number — pulled from whatever label the vendor uses (Invoice #, No., Reference, Bill #).
- Dates — invoice/issue date and due date, normalized to ISO
YYYY-MM-DD. - Currency — detected from symbol or ISO code;
nullwhen absent (never guessed). - Line items — per-row
description,quantity,unitPrice,amount, with summary rows excluded. - Totals —
subtotal,tax, and the finaltotaldue, as plain decimals. - Warnings — a list of ambiguous or unresolved fields, so nothing is silently fabricated.
What to feed it
The full text of one invoice — from OCR output, a PDF text dump, an email body, or pasted text. Field labels, date formats, and amount formatting can vary; the skill normalizes them. Run one invoice per invocation.
What it returns
A single JSON object (and nothing else) with this shape:
{
"vendor": { "name": "...", "address": "...", "email": "...", "phone": "..." },
"invoiceNumber": "...",
"invoiceDate": "YYYY-MM-DD",
"dueDate": "YYYY-MM-DD",
"currency": "USD",
"lineItems": [
{ "description": "...", "quantity": 1, "unitPrice": 100.00, "amount": 100.00 }
],
"subtotal": 100.00,
"tax": 8.00,
"total": 108.00,
"warnings": []
}
Missing scalar fields come back as null; numbers are plain decimals with no currency symbols or thousands separators. The output is ready to pipe into a downstream InTouch task (SQL insert, sheet append, accounting webhook, etc.).