DocPro · Invoice Agent

Invoice API that reads any layout and gives your ERP something it can post.

Most invoice OCR APIs hand you text and call it a day. The DocPro Invoice Agent identifies the invoice type, pulls header fields and line items into a schema, validates tax math and PO match, flags duplicates, and returns JSON with a confidence score on every field. Your AP team stops keying. Your auditor stops asking how a number got booked.

Why invoices break OCR

Three things a text-only OCR API can't fix for you.

Invoices look standard until you actually have to post a thousand of them on a Wednesday. These are the failure modes that send the work back to a human.

Layout drift

Every vendor decides the format differently.

Some put the GSTIN in the header. Some hide it next to a stamp. Some attach a credit note that subtracts from page 3. Template-based OCR cracks the first time a vendor redesigns their letterhead.

Invoice Agent: reads the document and infers field locations, so a new layout does not need a new template.
Line-item tables

Tables span pages and skip totals.

Line items wrap across pages. Sub-totals appear mid-table. Some rows are descriptions, not products. OCR returns a CSV that looks right and is wrong.

Invoice Agent: understands table semantics, joins continuations, and tags rows by role.
Validation gap

Reading the value is not checking the value.

OCR can pull a total of 1,75,584 with high confidence. That does not tell you whether the tax math is right, whether the PO has that line, or whether you have already paid this invoice last quarter.

Invoice Agent: runs your rules in the same call — tax math, PO match, duplicate check, GSTIN format.
What gets extracted

Every field your AP team would type, structured and tagged.

Header, line items, taxes, references, and footer terms. Each field comes back with a name, a value, and a confidence score. Mouse-over highlights below show what maps to what.

  • 1

    Header fields

    Invoice number, issue date, due date, PO reference, vendor name and address, vendor GSTIN, currency, place of supply. Tagged separately, so an "INV-2026/" prefix doesn't end up in the date column.

  • 2

    Line items

    SKU, description, HSN/SAC, quantity, unit of measure, rate, discount, line tax, and amount — one object per row. Continuation rows are joined to their parent.

  • 3

    Taxes & totals

    Subtotal, CGST, SGST, IGST, cess, rounding adjustments, and grand total. Each tax with its rate and taxable amount, so reconciliation does not have to back-calculate.

  • 4

    References & terms

    Bank details, payment terms, IRN and QR payload on e-invoices, delivery address, contact, signatures. Captured but optional — your schema decides what travels forward.

What the agent does

Built for the parts of AP.

The Invoice Agent is the work the finance team would rather not do — keying, matching, chasing — handled in a single API call.

Any layout, no templates

Tax invoices, proforma, credit notes, debit notes, utility bills, freight invoices. New vendors land in the system without a template build.

Line-item table parsing

Multi-page tables, continuation rows, mid-table sub-totals, mixed currencies. The agent maps rows to a clean schema, not a raw CSV.

Two, three, and four-way match

Invoice to PO, invoice to PO to GRN, plus contract or service confirmation. Mismatches return the reason, not a generic fail.

Duplicate detection

Cross-checks vendor, invoice number, date, and total against the last 24 months. Catches the same invoice resubmitted with a new scan ID.

Tax math & GSTIN check

Recomputes CGST, SGST, IGST, and cess against subtotal. Validates GSTIN format and checksum. Flags rate-vs-HSN mismatches.

Per-field confidence

Every field carries a confidence score. Auto-post above your threshold. Send the rest to the review queue with the original document attached.

Review queue UI

Low-confidence invoices land in a web UI. Reviewers correct fields side-by-side with the source. Corrections feed back into your tenant's tuning loop.

ERP-ready connectors

Pre-built handlers for SAP, Oracle, NetSuite, Tally, and Microsoft Dynamics. Webhooks for the in-house ledger nobody else has heard of.

How a call works

Upload to posted record, in one round trip.

No black box. At every step you get the data, the rules that fired, and a confidence score you can act on.

  1. Upload

    POST a PDF, image, or zip to /v1/extract with agent=invoice. Single file, batch, or a webhook-driven drop folder.

  2. Classify & read

    The agent identifies the invoice type, locates header and line-item regions, and reads the text. Skew, rotation, and phone photos are handled by the pipeline.

  3. Validate

    Tax math, PO match, GSTIN format, duplicate check, vendor whitelist. Each rule reports pass, fail, or warning, with the field it touched.

  4. Return JSON

    JSON shaped to your schema, with a confidence score per field. High-confidence invoices auto-post. Low-confidence ones route to a reviewer.

Built for engineers

One endpoint. Your schema. Your rules.

The Invoice Agent is a REST API, not a portal your dev team has to wrap. Upload the file, pass the schema name, get back validated JSON. The rules live in your repo, version-controlled like any other contract.

  • SDKs for Python, Node.js, Java, and .NET.
  • Webhooks for async batches and overnight runs.
  • Pre-built ERP connectors for SAP, Oracle, NetSuite, Tally, Dynamics.
  • Schema and rule definitions versioned in Git.
  • Every request logs model version, rule set, reviewer, timestamp.
Where it gets used

Three ways teams put the Invoice Agent to work.

The same API, three different jobs. Pick the one that sounds like your Monday.

AP automation, end to end

Vendor invoices arrive over email, portal, and paper. The agent reads, matches, and posts the safe ones to the ERP. Reviewers only see the exceptions.

Result: 70–85% of invoices auto-posted within an hour of receipt.

Audit & tax reconciliation

Pull 12 months of invoices into a clean dataset for GST reconciliation, ITC claims, or year-end audits. Every field is traceable to its source page.

Result: reconciliation cycles measured in days instead of weeks.

Embedded in a SaaS product

Procurement, expense, and ERP vendors embed the Invoice Agent under their own UI. White-label, multi-tenant, per-tenant tuning when needed.

Result: ship invoice capture without building an ML team.
97–99%
Header accuracy on clean PDFs
93–98%
Line-item accuracy, tuned
< 6s
Median API response, 2-page PDF
Security & compliance

Treated like the regulated data it is.

Invoices carry vendor PII, tax IDs, and bank details. The defaults reflect that, not your trust in us.

ISO 27001 & 9001–aligned

Controls mapped to ISO 27001 Annex A; ISO 9001 quality regime in place. Audit artefacts available under NDA.

Region–pinned data

Pick the region on AWS, Azure, or Google Cloud. On-premise and air-gapped options for regulated buyers.

DPA before invoice one

A Data Processing Agreement is signed before any document moves. Your paper or ours — either is fine.

No training on your data

Customer invoices are never used to train foundation models. Per-tenant tuning happens only when you opt in.

Full audit trail

Every extraction logs model version, rule set, reviewer actions, and timestamps. Exportable for internal and external audits.

Encryption end to end

TLS 1.2+ on the wire, AES-256 at rest. Customer-managed keys on enterprise plans.

FAQ

Questions AP leads and engineers ask before they sign anything

If yours isn't here, a 30-minute call with an engineer is usually faster than an email chain.

Is the Invoice Agent just an OCR API?

No. OCR returns text and coordinates. The Invoice Agent identifies the invoice type, extracts header fields and line items into a schema, validates tax math and PO match, flags duplicates, and returns JSON with a confidence score per field. The OCR step is one part of a longer pipeline — and not the part that determines whether the output is usable.

What invoice formats does it handle?

PDFs (native and scanned), images (JPG, PNG, TIFF), multi-page scans, phone photos, and e-invoice JSON or XML payloads. Layouts include tax invoices, proforma invoices, credit and debit notes, utility bills, freight invoices, and the vendor templates from 2004 that nobody has updated since.

What accuracy should we expect on invoices?

Header field accuracy is typically 97 to 99% on clean PDFs and 92 to 97% on phone photos or messy scans. Line-item accuracy depends on table complexity and falls in the 93 to 98% range once the agent is tuned to your vendor mix. The number that actually matters is how many invoices clear the auto-post threshold — that lands between 70 and 85% on most AP pipelines.

Does it handle GST and e-invoicing?

Yes. GSTIN format and checksum are validated. CGST, SGST, IGST, and cess are extracted separately. HSN and SAC codes are pulled at the line-item level for ITC matching. On e-invoices, the IRN and QR payload are parsed and reconciled against the document fields, so a tampered total gets flagged automatically rather than silently posted.

Can it match invoices to a PO or GRN?

Two-way match (invoice to PO), three-way match (invoice to PO to GRN), and four-way match (adds contract or service confirmation) are all supported out of the box. Mismatches return the specific reason — short quantity, rate variance, tax mismatch — not a generic fail flag. The reasoner is configurable per tenant if your tolerance bands differ.

How do we integrate with our ERP?

One REST endpoint. Upload the file, get JSON back, post the JSON to SAP, Oracle, NetSuite, Tally, Microsoft Dynamics, or your in-house ledger. Pre-built connectors exist for the common ERPs. SDKs ship for Python, Node.js, Java, and .NET. Webhooks are available for async batches and high-volume overnight runs.

Where is invoice data stored?

In the cloud region you pick on AWS, Azure, or Google Cloud. On-premise and air-gapped deployments are available for regulated buyers. A DPA is signed before any invoice moves. Customer documents are never used to train foundation models — your data stays your data.

Is there a sandbox or trial?

Yes. Send a batch of your own invoices to the sandbox and get JSON back within a working day. No credit card and no upfront sales call. If the output works on your documents, we talk pricing. If it doesn't, you still walk away with data you can compare against any other vendor.

How is the Invoice Agent priced?

Per invoice, with volume tiers. Pricing is indicative until we see your actual document mix — a phone-photo-heavy AP queue and a clean PDF EDI feed sit at different points on the cost curve. Enterprise plans bundle committed throughput, customer-managed keys, priority support, and a named solutions engineer.

Send 100 of your worst invoices.

The ones with rotated scans, missing line totals, the ones your team has flagged "do not auto-process". We run them through the Invoice Agent and send back the JSON. No deck, no sales call. Just output you can compare against what you have now.