Invoice Batch Validator: PDF Invoices to JSON+CSV avatar

Invoice Batch Validator: PDF Invoices to JSON+CSV

Pricing

$50.00 / 1,000 invoice processeds

Go to Apify Store
Invoice Batch Validator: PDF Invoices to JSON+CSV

Invoice Batch Validator: PDF Invoices to JSON+CSV

Extract invoice PDFs, scans and photos to line-item JSON and CSV, re-check line math, tax and totals, and flag invoices that need review. Pay per invoice.

Pricing

$50.00 / 1,000 invoice processeds

Rating

0.0

(0)

Developer

Stan Lookoff

Stan Lookoff

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

12 hours ago

Last modified

Share

Invoice Batch Validator: PDF & Image Invoices to Checked JSON + CSV

Turn a batch of supplier invoices (PDFs, scans or photos) into structured JSON and CSV, and let the Actor recompute the arithmetic so you only look at the invoices that don't add up.

What you can do

  • Extract every invoice field: vendor, customer, invoice number, dates, currency, every line item, subtotal, discounts, shipping, tax and total.
  • Catch math errors automatically: line quantity × price, line sums, tax rates, totals and amount due are recomputed and compared with what is printed.
  • Catch misreads: every extracted amount is cross-checked against the recognised document text, so a misread number is flagged instead of silently accepted.
  • Enforce your rules: expected currency, allowed VAT rates, duplicates within the batch.
  • Get spreadsheet-ready files: invoices.csv (one row per invoice) and line-items.csv (one row per line item).
  • Automate it: call it from the API, a schedule, n8n, Make, Zapier or an AI agent via Apify MCP.

Checks and flags

FlagSeverityMeaning
LINE_MATH_MISMATCHerrorquantity × unit price ≠ line amount
LINE_TAX_MISMATCHerrorline tax ≠ line amount × line tax rate
LINE_SUM_MISMATCHerrorline amounts do not add up to the subtotal
TAX_RATE_MISMATCHerrorVAT summary: base × rate ≠ tax amount
TAX_BREAKDOWN_MISMATCH / LINE_TAX_SUM_MISMATCHerrortax lines do not add up to the tax total
TOTAL_MISMATCHerrorsubtotal − discount + shipping + tax ≠ total
AMOUNT_DUE_MISMATCHerrortotal + previous balance − paid ≠ amount due
LINE_VALUES_NOT_AS_PRINTEDerroran extracted quantity, price or amount does not match the numbers printed in that table row
VALUE_NOT_IN_DOCUMENTerroran extracted subtotal, tax total, total or amount due does not appear anywhere in the document text
DUPLICATE_IN_BATCHerrorsame vendor, invoice number and total as an earlier invoice in the run
CURRENCY_MISMATCHerrorcurrency differs from expectedCurrency
UNEXPECTED_TAX_RATEerrora tax rate not in allowedTaxRates
DUE_DATE_BEFORE_INVOICE_DATE, INVALID_INVOICE_DATEerrordate problems
MISSING_INVOICE_NUMBER, MISSING_INVOICE_DATE, MISSING_VENDOR, MISSING_TOTALerrorrequired field not found
MISSING_CURRENCY, NO_LINE_ITEMS, NOT_AN_INVOICE, INVOICE_DATE_IN_FUTURE, INVALID_DUE_DATEwarningworth a look
PAGE_CAP_REACHED, TEXT_TRUNCATEDwarningthe document was longer than the limits below

Amounts are compared with a tolerance of amountTolerance (default 0.01), plus half a cent per unit on quantity × price to allow for rounded unit prices. An invoice with any error flag gets status: "needs_review"; otherwise status: "valid".

How to use

  1. Put direct links to your invoice files in Invoice URLs — one invoice per file (PDF, JPG, PNG, WEBP, GIF, TIFF or AVIF). The links must download without a login: an Apify key-value store record, a pre-signed S3 link or a public file host all work.
  2. Optionally set the expected currency, the allowed VAT rates and the tolerance.
  3. Start the run. Each invoice becomes one row in the Output tab; the CSV files are linked there too.

A one-page invoice takes about 5–10 seconds; up to 3 invoices are processed in parallel.

FieldRequiredDescription
invoiceUrlsyesDirect, publicly downloadable links. Up to 1,000 per run; repeated links are processed once.
maxPagesPerInvoiceno1–5, default 5. Only the first N pages of each PDF are read.
expectedCurrencynoISO code such as EUR.
allowedTaxRatesnoTax/VAT rates in percent, e.g. 20, 10, 5.5, 0.
amountTolerancenoDefault 0.01.
includeOcrTextnoAdds the recognised page text to each item for auditing.

Pricing

You pay per processed invoice. Failed invoices (unreadable, not downloadable) are free.

EventPrice
Invoice processed (up to 5 pages)$0.05
Example runCost
1 invoice$0.05
100 invoices (a month of supplier bills)$5.00
1,000 invoices (maximum per run)$50.00

Before processing, the Actor checks that your run's maximum cost covers the whole batch ($0.05 × number of invoices). If it doesn't, the run stops without charging anything and tells you the amount to set.

Available on paid Apify plans.

Input example

{
"invoiceUrls": [
"https://example.com/invoices/INV-100.pdf",
"https://example.com/scans/receipt-7.jpg"
],
"expectedCurrency": "USD",
"allowedTaxRates": ["10"]
}

Output example

One dataset item per invoice:

{
"index": 0,
"sourceUrl": "https://example.com/invoices/INV-100.pdf",
"status": "needs_review",
"flagCodes": ["LINE_MATH_MISMATCH"],
"flags": [{ "code": "LINE_MATH_MISMATCH", "severity": "error", "message": "Line 1: 1 x 1 = 1.00, but the line shows 100.00." }],
"vendorName": "Example Supplies Ltd.",
"invoiceNumber": "INV-100",
"invoiceDate": "2026-09-15",
"currency": "USD",
"total": 110,
"amountDue": 610,
"invoice": {
"document_type": "invoice",
"invoice_number": "INV-100",
"invoice_date": "2026-09-15",
"due_date": "2026-10-15",
"currency": "USD",
"vendor": { "name": "Example Supplies Ltd.", "address": "1 Sample Street, Springfield", "tax_id": null },
"customer": { "name": "Demo Customer Inc.", "address": "99 Test Avenue, Riverside", "tax_id": null },
"line_items": [{ "description": "Consulting services", "quantity": 1, "unit_price": 1, "amount": 100, "...": "..." }],
"subtotal": 100, "tax_total": 10, "total": 110, "previous_balance": 500, "amount_due": 610, "...": "..."
},
"checks": { "lineItemsSum": 100, "lineTaxSum": null, "computedTotal": 110, "computedAmountDue": 610, "impliedTaxRate": 10 },
"pagesProcessed": 1,
"charged": true,
"error": null
}

The run's key-value store also gets:

  • invoices.csv — one row per invoice (header fields, totals, status, flag codes)
  • line-items.csv — one row per line item, keyed by source URL and invoice number
  • OUTPUT — run summary with counts and links to both CSV files

Files that cannot be downloaded or read come back with status: "failed" and an error message, and are not charged.

Limits

  • Up to 5 pages per invoice. Longer PDFs are cut after page 5 (or after maxPagesPerInvoice) and flagged PAGE_CAP_REACHED. Split multi-invoice PDFs into one file per invoice.
  • About 30,000 characters of recognised text per invoice are used for extraction; beyond that the invoice is flagged TEXT_TRUNCATED.
  • Up to 1,000 invoices per run, 3 processed in parallel.
  • Links must be directly downloadable without a login.

Good to know

  • Values are read as printed; the Actor never "corrects" a number, it flags it. Always review needs_review invoices before paying them.
  • Handwritten or very low-resolution scans may be read less reliably — the grounding checks will usually flag them.
  • Download links to the CSV files expire with your plan's storage retention — save the files you need.
  • Questions or a missing check? Open an issue on the Actor page.