Invoice data extraction API

An invoice data extraction API reads an invoice and returns its key fields (supplier, invoice number, dates, subtotal, tax, total, line items) as JSON for your accounting system. Prebuilt invoice parsers return a fixed set of fields; a field-based API lets you name exactly what you need. Our Document to JSON API does the second for $0.03 per invoice, with 5 free tries a day.

Try it free Document to JSON API — extract fields from any file · $0.03 / call

A field list that works for most invoices

Write each description the way you'd brief a bookkeeper. The more exact the format, the cleaner the JSON.

POST https://iamai.markets/api/x402/services/YJwWWlLP8th0
Content-Type: application/json

{
  "url": "https://example.com/invoices/a-1042.pdf",
  "fields": {
    "supplier": "the seller's company name",
    "supplier_tax_id": "the seller's VAT or tax ID",
    "invoice_number": "the invoice number",
    "invoice_date": "issue date as YYYY-MM-DD",
    "due_date": "due date as YYYY-MM-DD",
    "currency": "3-letter currency code",
    "subtotal": "amount before tax as a number",
    "tax": "total tax as a number",
    "total": "amount due as a number",
    "lines": "every line item as a list of {description, quantity, unit_price, amount}"
  },
  "instructions": "Use the invoice's own currency. Do not convert amounts."
}

Check the numbers before you book them

  1. The first answer is 402 with the price ($0.03). Any x402 v2 client (Coinbase's x402 packages, or AgentKit with the iamai-agentkit plugin) pays in USDC on Base and repeats the request.
  2. Read result.fields. Anything the invoice doesn't show is null, not a guess.
  3. Check that subtotal plus tax equals total, and that the line amounts add up to the subtotal. If they don't, send the invoice to a person.
  4. Match supplier_tax_id against your supplier list before paying, to catch fake invoices.

Scanned and photographed invoices

Document to JSON reads the text inside a file. A scanned PDF or a phone photo has no text, only pixels. Send the image to our OCR API first ($0.03, returns the text in reading order with tables as Markdown), then send that text to Document to JSON in the "text" field. Two calls, $0.06 per invoice.

How it compares

OptionStrengthTrade-off
AWS Textract (AnalyzeExpense)Prebuilt invoice and receipt fields, good on scansAWS account; fixed field set
Google Document AI, Azure Document IntelligencePrebuilt invoice models, can be trainedCloud project and setup
Mindee, other invoice OCR servicesInvoice-focused, ready to useAccount, usually plans or credits
Document to JSON (iamai.markets)Any fields you name, no accountText files only (OCR first for scans); x402 payment

The product

Questions

Can it read invoices in other languages?

Yes, the field descriptions can be in English while the invoice is in another language. Ask for dates as YYYY-MM-DD so the format is the same for all.

How many invoices can I process?

There's no monthly cap, you pay per invoice. Each paying wallet can run up to 4 calls at the same time.

Does it work from n8n or Make?

The HTTP request is ordinary JSON, but the payment needs an x402 client with a USDC wallet, which those tools don't include.

Related

Updated 2026-12-01