UntangledAPI
Extract

Invoice

Extract vendor, line items, totals, and dates from an invoice.

POST /v1/extract/invoice returns a fixed shape covering the fields most billing pipelines need.

Request

curl https://api.untangledapi.com/v1/extract/invoice \
  -H "x-api-key: $UNTANGLED_KEY" \
  -H "content-type: application/json" \
  -d '{
    "document": {
      "text": "Acme Co.\nInvoice #1042\nLine: Widget x10 @ $100 = $1,000\nLine: Setup fee = $250\nSubtotal: $1,250\nTax: $0\nTotal: $1,250.00\nDue: 2026-05-15"
    }
  }'

Response

{
  "data": {
    "vendor": "Acme Co.",
    "invoice_number": "1042",
    "issue_date": null,
    "due_date": "2026-05-15",
    "currency": "USD",
    "subtotal": 1250.00,
    "tax": 0.00,
    "total": 1250.00,
    "line_items": [
      { "description": "Widget x10 @ $100", "quantity": 10, "unit_price": 100.00, "amount": 1000.00 },
      { "description": "Setup fee", "quantity": 1, "unit_price": 250.00, "amount": 250.00 }
    ]
  },
  "model": "claude-haiku-4-5",
  "usage": {
    "inputTokens": 420,
    "outputTokens": 160
  }
}

Fields

FieldTypeNotes
vendorstringBest-effort extraction of the issuing party.
invoice_numberstring | nullWhatever the document calls it (Invoice #, Inv No, Reference).
issue_datestring (ISO 8601) | null
due_datestring (ISO 8601) | null
currencyISO 4217 | nullInferred from the document.
subtotal / tax / totalnumber | nullNumeric values in the document's currency.
line_items[]arrayEmpty array if no line items detected.

Document inputs

Either document.text (raw string) or document.url (HTTPS URL to a PDF/image hosted somewhere we can reach). URL inputs go through a strict allowlist — see the request body schema in the API reference.

On this page