clean

Validate AI-Extracted Invoice JSON

Validate and normalize LLM / OCR invoice JSON before downstream accounting workflows

  • Detects missing and invalid invoice fields from LLMs
  • Converts stringified quantities and prices into numbers
  • Produces a schema-approved safe_payload for downstream systems

Paste AI-generated invoice JSON — instantly validate and normalize it locally in your browser.

Why this package exists

Common problems

  • LLMs and OCR pipelines invent inconsistent field names (`invoiceNo` vs `invoice_id`, `desc` vs `description`).
  • Invoice totals, quantities, and prices frequently arrive as strings while downstream accounting systems expect numeric JSON values.
  • Fields disappear, duplicate, or drift across extraction runs with no schema enforcement to catch the inconsistency.
  • AI-generated invoice JSON often reaches downstream systems before structural validation occurs.

When to use

Use this after an LLM or OCR invoice extraction step and before downstream accounting, reconciliation, ERP, analytics, or vendor-processing workflows.

Expected outcome

A validation envelope containing `{ valid, errors, safe_payload }`. `errors[]` identifies missing or invalid invoice fields, while `safe_payload` exposes only schema-approved invoice data downstream systems can safely consume.

Automatically detects

  • Vendor-shaped keys
  • String quantities
  • String prices
  • Currency-suffixed totals
  • Missing invoice fields

What the wizard asks

4 steps

Each step shows your input, the question, and a preview of the output.

  1. 1

    Rename AI-generated invoice fields into canonical accounting fields?

    Map inconsistent LLM-generated field names into a stable invoice vocabulary downstream systems can rely on.

  2. 2

    Normalize invoice quantities and prices into numeric JSON values?· Optional

    Convert stringified invoice quantities and prices into stable JSON numbers downstream accounting systems can safely process.

  3. 3

    Validate the invoice matches the downstream accounting contract?

    Validate required invoice fields and preserve the normalized payload under `safe_payload` for downstream extraction.

  4. 4

    Which invoice fields should downstream systems receive?

    Expose only validation results and schema-approved invoice fields downstream.