# Answer key: fictional sample invoices

Every invoice below is invented. Names, BRNs, VAT numbers and amounts are made up for testing. Not an official MRA document. Not tax advice.

| Sample | Invoice no. | Seeded issue | Rules the checker flags | How to fix |
|---|---|---|---|---|
| S00 Clean invoice | SAMPLE-INV-1001 | None. Every hard check passes. | none | Nothing to fix. Use it as the reference layout. |
| S01 Wrong VAT rate | SAMPLE-INV-1002 | A standard-rated line (TC01) charges 10% VAT instead of 15%. | R15 | Recalculate VAT at 15% on standard-rated lines: 1000.00 x 15% = 150.00. Then update the line total and header totals. |
| S02 Missing buyer BRN and VAT number | SAMPLE-INV-1003 | A B2B invoice leaves the buyer BRN and buyer VAT number blank. | R12, R13 | Add the buyer's BRN and VAT number from your customer master data. They are mandatory for B2B and B2G invoices. |
| S03 Line total does not add up | SAMPLE-INV-1004 | The line total is 1250.00, but 1000.00 + 150.00 VAT = 1150.00. | R18 | Make the line total equal the amount excluding VAT plus VAT. Check for a manual override or a stray delivery fee. |
| S04 Duplicate invoice number | SAMPLE-INV-1005 | Two different invoices share the number SAMPLE-INV-1005. | Duplicate-number note, plus R17, R17B (lines from both invoices are pooled) | Give every invoice a unique number. Duplicates usually come from a reset sequence or a copied invoice. Their lines also get mixed up in the totals check. |
| S05 Missing invoice date | SAMPLE-INV-1006 | The issue date and time field is blank. | R06 | Fill dateTimeInvoiceIssued in the format yyyyMMdd HH:mm:ss, for example 20261116 10:30:00. |
| S06 Wrong date format | SAMPLE-INV-1007 | The date is written 16/11/2026 instead of 20261116 10:30:00. | R06 | Export the date as yyyyMMdd HH:mm:ss (17 characters). Most systems let you set this in the export template. |
| S07 Invalid tax code | SAMPLE-INV-1008 | A line uses tax code TC99, which is not in the official list. | R14 | Map every product to an official tax code, for example TC01 for standard-rated supplies. |
| S08 Credit note with no reference or reason | SAMPLE-CRN-2001 | A credit note (CRN) does not say which invoice it corrects, or why. | R05, R20 | On credit and debit notes, fill invoiceRefIdentifier with the original invoice number and reasonStated with a short reason. |

Rule ids: R05 original invoice reference on credit/debit notes; R06 date format yyyyMMdd HH:mm:ss; R12 buyer VAT number; R13 buyer BRN; R14 tax code; R15 VAT amount vs rate; R17/R17B header totals vs lines; R18 line total; R20 reason on credit/debit notes.

Generated by build_samples.py, which runs each sample through the live rules engine and stops if a result does not match this key.