Invoice PDF to JSON API: extract line items
One request and one response: an invoice PDF in, line items out as typed JSON, plus the check that catches a bad row before it reaches your books.
3 min readUpdated 17 October 2026To turn an invoice PDF into JSON, send the PDF and a JSON Schema to one endpoint and read typed line items from the result. Veralens is a document extraction API (OCR plus schema-typed JSON): numbers arrive as numbers even when the invoice printed 1.234,56, and a field that is not on the page comes back null.
Veryfi source: pricing page. Updated 2026-10-17.
This is one request and one response: an invoice PDF in, line items out as JSON. For the full field-by-field schema design, read the invoice walkthrough. For the general case, see PDF to JSON. Here the goal is only the line items.
The request
Swap the data URL for your own base64 PDF. You get 201 with the job in pending. Add a webhook_url to be called on completion, or poll GET /jobs/:jobId/get every 2 to 3 seconds (Jobs and queue).
The response
On completed, output is a JSON string:
The values are illustrative. The shape is what the schema fixes: numbers arrive as numbers even when the invoice printed 1.234,56, and the field names are the ones you wrote. The job also reports its own usage.cost, so you see what each invoice cost.
Check the line items
Line items are the weakest part of any invoice extraction, ours included. Check them in your own code:
If the sum is off, flag the invoice for review. Keep required small so an absent field comes back null rather than guessed.
Try it
- Create an account and an API key.
- Add funds in Billing. There is no free balance, so top up before your first job. Billing is prepaid per token, you can add from $5, and a failed job refunds its hold in full. See pricing.
- Run the request above on one of your own invoices.