# Synthetic Invoice Dataset

Canonical source: [Synthetic Invoice Dataset](https://docsetgenerator.com/synthetic-invoice-dataset)

Guide · Invoice data

## Generate invoice data with coherent facts

Invoice testing needs more than plausible-looking amounts. V2 keeps issuer, buyer, line items, tax, payment state, due terms, and grounded fields consistent so extraction tests can identify a real parser error.

**Command-line setup**

Guide commands use the tools included with your Windows or Linux download; no separate Python installation is needed. Each guide's command examples show the complete command for the platform you choose. [Open platform setup](https://docsetgenerator.com/getting-started#command-line).

Why invoices need a model

### Test relationships, not isolated strings

A useful invoice fixture ties the issuer, buyer, invoice reference, date, terms, line items, tax, payment state, and balance together. V2's authored invoice routes render those facts into several invoice layouts and retain their provenance in annotations. Amounts use cent-rounded arithmetic, and progress billing charges completed quantities while leaving pending work outside posted totals.

Keep invoice and receipt tests separate. An invoice requests or records payment with due terms and a balance; a receipt acknowledges payment with a receipt reference, method, date/time, and amount received. The receipt renderer does not borrow invoice due-date or payment-demand language.

Short example

### Generate a small coherent invoice set

Windows PowerShell

```powershell
& '.\_internal\DocumentGenerator_v2.0_cli.exe' generate --type invoice --count 3 --seed 42 --content-pack business-v2 --output output/invoices-business --export layoutlm docvqa --validate
```

Linux AppImage

```sh
./DocumentGenerator_v2.0.0_Linux-x86_64.AppImage --cli generate --type invoice --count 3 --seed 42 --content-pack business-v2 --output output/invoices-business --export layoutlm docvqa --validate
```

Linux Flatpak

```sh
flatpak run com.docsetgenerator.DocSetGenerator --cli generate --type invoice --count 3 --seed 42 --content-pack business-v2 --output output/invoices-business --export layoutlm docvqa --validate
```

This creates three invoice PDFs with authored business content and records their source facts, word geometry, and grounded fields. The export files are derived from those annotations. For specific states, industries, linked documents, or challenge controls, use a JSON SuiteSpec and inspect it with `--preflight` before generating.

A scalar field record is intended to look like a real document target: an invoice number, a printed total, a due date with a visible label, or an amount paid. A number that exists only in private model metadata is not exported as an extractive answer.

Targeted extraction challenges

### Test missing fields, competing totals and ambiguous dates

| Challenge | Target | What it tests |
| --- | --- | --- |
| `role_contrast` | `invoice_number` | Two role variants in one independent family. |
| `absent_field` | One of `po_number`, `due_date`, or `buyer_contact` is explicitly absent. | Whether a parser distinguishes absence from an invented value. |
| `multiple_totals` | `balance_due` | Whether labeled totals remain distinct and arithmetically consistent. |
| `ambiguous_dates` | `invoice_date` | Whether a parser uses an explicit date-order cue rather than guessing. |
| `words_and_digits` | `amount_paid` | Whether words and a separately labeled numeric balance are kept distinct. |
| `prompt_injection` | `total` | Whether visible or supported hidden instructions are kept out of the target. |
| `prior_period_noise` | Current `invoice_number` and `total` | Whether a parser ignores a labeled historical row. |

Challenge admission depends on the selected state and document type. Preflight refuses combinations where a target is not guaranteed to be printed. Run your parser on the neutral bundle and score its predictions to measure performance on those challenges.

Fields versus DocVQA

### Use the evaluator for scalar business extraction

The content pack publishes a field schema with names, types, descriptions, and formats without putting target values into the public parser bundle. A parser can use its own key names: add `--field-map keys.json` to the [fields scoring command](https://docsetgenerator.com/docvqa-dataset#fields-scoring), where `keys.json` maps each parser key to a canonical field name. Exact, normalized, and typed matches remain separate, and absent-field decisions are explicit.

For coherent business content, the current DocVQA export supplies the document-type question, not scalar business-field questions. Other supported routes can supply grounded questions where answers are actually printed. Use the [fields evaluation workflow](https://docsetgenerator.com/evaluation) when the task is scalar invoice extraction.

Limits

### Plan your invoice coverage

- Generated invoices are synthetic test material, not accounting records, shipment evidence, tax advice, or valid commercial documents.
- The business pack provides reviewed English-language plans, states, industries, and linked case facts.
- Changing names, amounts, or cosmetic layout does not by itself create a new business situation. Related invoice, letter, memo, and report projections can share one case and one split family.
- The evaluator scores supported PDF inputs and single-value fields; native formats, table extraction, and unsupported situation revisions remain outside the scorer.

### Related guides

Start with [the first run](https://docsetgenerator.com/getting-started), learn [suite planning](https://docsetgenerator.com/suites), and use [test documents for OCR](https://docsetgenerator.com/test-documents-for-ocr) for the neutral handoff. For export formats, see [LayoutLM](https://docsetgenerator.com/layoutlm-training-data), [FUNSD](https://docsetgenerator.com/funsd-format), and [DocVQA](https://docsetgenerator.com/docvqa-dataset).
