Invoice parsing API
Accounts-payable teams and AI agents both hit the same wall: invoices arrive as PDFs, scanned images, and email attachments with wildly different layouts, and none of them are machine-readable. The AIDataParser invoice parsing API takes any invoice file — a supplier PDF, a photographed paper invoice, or a base64 blob — and returns clean, structured JSON that matches a schema you define. No OCR pipeline to maintain, no per-vendor templates, no brittle regex.
Because extraction is schema-first, you decide exactly which fields you want back: the invoice number, issue and due dates, subtotal, tax, grand total, currency, vendor details, and a nested array of line items. Every response is validated against that JSON Schema, so downstream code can trust the shape without defensive parsing. A confidence score and review_needed flag ship with every result, so you can auto-post high-confidence invoices to your ledger and route ambiguous ones to a human.
The endpoint is a single POST. Send the invoice by URL, multipart upload, or base64, add your schema, and you get back structured data in seconds — one credit per document, charged only on success. It slots directly into an AP automation workflow, a Zapier-style connector, or an LLM agent's tool-use loop where the model needs reliable numbers instead of hallucinated ones.
Fields you can extract from a invoice
invoice_numberstringSupplier's invoice identifier.
invoice_datestringIssue date (ISO 8601).
due_datestringPayment due date.
vendor_namestringBilling party / supplier.
subtotalnumberPre-tax total.
taxnumberTax amount.
totalnumberGrand total due.
currencystringISO currency code.
line_itemsarrayDescription, quantity, unit price, amount per row.
Example request
POST the invoice by URL, upload, or base64, with a JSON Schema describing the output you want.
curl -X POST https://aidataparser.com/v1/parse/document \
-H "Authorization: Bearer adp_live_..." \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/invoice.pdf",
"schema": {
"type": "object",
"properties": {
"invoice_number": {
"type": "string"
},
"invoice_date": {
"type": "string"
},
"due_date": {
"type": "string"
},
"vendor_name": {
"type": "string"
},
"total": {
"type": "number"
},
"currency": {
"type": "string"
},
"line_items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"quantity": {
"type": "number"
},
"amount": {
"type": "number"
}
}
}
}
}
}
}'Example response
The data field is guaranteed to match your schema.
{
"object": "parse.document",
"data": {
"invoice_number": "INV-2043",
"invoice_date": "2026-07-02",
"due_date": "2026-08-01",
"vendor_name": "Northwind Supplies",
"total": 1240,
"currency": "USD",
"line_items": [
{
"description": "API credits",
"quantity": 1,
"amount": 1240
}
]
},
"confidence": "high",
"review_needed": false,
"credits_charged": 1,
"credits_remaining": 49
}FAQ
What invoice formats does the API accept?
PDF invoices (text-based and, on the roadmap, scanned), plus PNG, JPEG, WebP, and GIF images of invoices. Send them by public URL, multipart file upload, or base64 — no pre-processing required.
Can I guarantee the output matches my accounting schema?
Yes. Pass a JSON Schema in the request and every response's data field is validated against it, so fields like total and due_date always come back with the types you expect.
How much does invoice parsing cost?
One credit per invoice, charged only on a successful extraction. New accounts get 50 free credits with no card, so you can test your real invoices before paying.
How does it handle line items?
Line items are returned as a nested array — one object per row with description, quantity, unit price, and amount — so you can reconcile totals programmatically.