Skip to content

Invoice Processor

Extract structured data from invoices (PDF/text) for accounting systems.

Port 8105
Container hai-invoice-processor
Use case Accounts payable automation, bookkeeping, expense management
Compliance GDPR, CCPA, SOC 2, ISO 27001, PCI DSS awareness (no card data stored)

How it works

Upload an invoice (PDF or text) and receive structured JSON: vendor, invoice number, date, line items, tax, total, and payment terms. Ready to feed into QuickBooks, Xero, or any accounting system.

API

Process an invoice

curl -X POST http://localhost:8105/api/v1/process \
  -H "X-API-Key: hai_your_key" \
  -F "file=@invoice-2026-0042.pdf"

Response:

{
  "vendor_name": "CloudHost Solutions Inc.",
  "vendor_address": "123 Tech Blvd, San Jose, CA 95134",
  "invoice_number": "INV-2026-0042",
  "invoice_date": "2026-04-01",
  "due_date": "2026-05-01",
  "currency": "USD",
  "subtotal": 4500.00,
  "tax": 393.75,
  "total": 4893.75,
  "line_items": [
    {"description": "Cloud hosting - Pro tier (April)", "quantity": 1, "unit_price": 3500.00, "amount": 3500.00},
    {"description": "SSL certificate renewal", "quantity": 2, "unit_price": 500.00, "amount": 1000.00}
  ],
  "payment_terms": "Net 30",
  "notes": "Wire transfer preferred. Account details on page 2.",
  "latency_ms": 2340,
  "model": "claude-sonnet-4-20250514"
}

Supported formats: PDF, plain text

Max file size: 20MB

Accounting system integration

The structured JSON output maps directly to common accounting APIs:

Field QuickBooks Xero FreshBooks
vendor_name Vendor.DisplayName Contact.Name Client.Name
invoice_number Bill.DocNumber Invoice.InvoiceNumber Invoice.Number
total Bill.TotalAmt Invoice.Total Invoice.Amount
line_items Bill.Line[] Invoice.LineItems[] Invoice.Lines[]

Financial data handling

PCI DSS

The Invoice Processor reads and extracts data from invoices. It does not store or process payment card numbers. If invoices contain credit card numbers, they are extracted as part of the text but encrypted at rest like all other data. For PCI DSS compliance, ensure your infrastructure meets Level 4 merchant requirements if applicable.