KSeF validation error: what it means, how to fix
A validation error means the invoice XML doesn't meet KSeF requirements (most often it doesn't match the FA(3) schema), so KSeF rejects it. A rejected invoice gets no KSeF number and is not issued: you fix the file and send it again. The cause is usually a missing field, an element in the wrong place, or a value in the wrong format. KSeF 2.0 Handbook, part II, section 1.6.1
Some errors KSeF doesn't check at all. The Handbook says plainly that the system doesn't verify calculations, so an invoice with a wrong P_15 total (error 10) still gets a number. The schema doesn't catch a country prefix in NrVatUE (error 9) or P_6 together with P_6A (error 12), so KSeF may accept such an invoice. Once an invoice has a KSeF number, you fix it with a corrective invoice, not by sending it again. KSeF 2.0 Handbook, part II, sections 1.6.1 and 1.6.2
Validation messages are opaque: instead of "missing invoice number" you get something like Element 'P_6': This element is not expected. Expected is ( P_2 ). If your invoicing software generates the XML itself, it should catch most of these. Below are the 12 most common, from a wrong namespace to incomplete Adnotacje, each with its cause and XML you can copy. The explanations help when you integrate with KSeF (Krajowy System e-Faktur, Poland's national e-invoicing system) through the API, write a custom exporter, or want to know why an invoice was rejected. The examples are based on the FA(3) schema in force since 1 February 2026.
1. Missing or wrong namespace
The <Faktura> element must carry the FA(3) namespace. Without it the validator does not recognise the file as an FA(3) invoice: it reports a single error on Faktura and checks nothing else in the file. The usual causes are a template from the internet that uses FA(2), an omitted xmlns attribute, or a typo in the URI (2025/06/25/13775 is easy to get wrong). A namespace from templates predating February 2026 is almost certainly outdated, because FA(2) stopped applying on 31 January 2026.
<!-- ❌ No namespace -->
<Faktura>
...
</Faktura>
<!-- ❌ Old FA(2) namespace, invalid since 1 February 2026 -->
<Faktura xmlns="http://crd.gov.pl/wzor/2023/06/29/12648/">...</Faktura>
<!-- ✅ Correct FA(3) namespace -->
<Faktura xmlns="http://crd.gov.pl/wzor/2025/06/25/13775/">
...
</Faktura>More about this error: Wrong namespace in the invoice: xmlns for FA(3).
2. Wrong element order
The schema uses xs:sequence, so element order is mandatory. Podmiot2 placed before Podmiot1 rejects the whole file. Software normally keeps the order, but manual edits and custom exports break it.
At the top level: Naglowek → Podmiot1 → Podmiot2 → [Podmiot3] → [PodmiotUpowazniony] → Fa (including FaWiersz) → [Stopka] → [Zalacznik]. Elements in brackets are optional, but if present they have a fixed place. FaWiersz sits inside Fa, not next to it.
<!-- ❌ Podmiot2 before Podmiot1 -->
<Faktura xmlns="http://crd.gov.pl/wzor/2025/06/25/13775/">
<Naglowek>...</Naglowek>
<Podmiot2>...</Podmiot2>
<Podmiot1>...</Podmiot1>
<Fa>...</Fa>
</Faktura>
<!-- ✅ Correct order -->
<Faktura xmlns="http://crd.gov.pl/wzor/2025/06/25/13775/">
<Naglowek>...</Naglowek>
<Podmiot1>...</Podmiot1>
<Podmiot2>...</Podmiot2>
<Fa>...</Fa>
</Faktura>The same rule applies inside Naglowek (KodFormularza → WariantFormularza → DataWytworzeniaFa), Podmiot1, Podmiot2 and Fa. The full order is in the FA(3) XSD schema.
More about this error: Element in the wrong place in FA(3) invoice XML.
3. Missing required elements
FA(3) has dozens of mandatory fields at different levels, and the validator names the missing one. The easiest to forget are WariantFormularza, KodWaluty, P_15 and RodzajFaktury. The minimum:
- Naglowek:
KodFormularza(with attributeskodSystemowy="FA (3)"andwersjaSchemy="1-0E"),WariantFormularza,DataWytworzeniaFa - Podmiot1/DaneIdentyfikacyjne:
NIP,Nazwa - Podmiot1/Adres:
KodKraju,AdresL1 - Podmiot2/DaneIdentyfikacyjne: exactly one buyer identifier:
NIP,KodUE+NrVatUE,NrID(theKodKrajubefore it is optional) orBrakID=1(a buyer with no identifier, such as a consumer) - Podmiot2:
JST,GV - Fa:
KodWaluty,P_1,P_2,P_15,Adnotacje,RodzajFaktury
The buyer's Nazwa is optional in the schema, so leaving it out won't cause a schema validation error. The annotation in the schema and the KSeF Handbook tie omitting the name to the simplified invoice of up to PLN 450 or EUR 100 (RodzajFaktury = UPR), so on a regular invoice enter the buyer's name. KSeF 2.0 Handbook, part II: simplified invoice up to PLN 450
<!-- ❌ Missing WariantFormularza -->
<Naglowek>
<KodFormularza kodSystemowy="FA (3)" wersjaSchemy="1-0E">FA</KodFormularza>
<DataWytworzeniaFa>2026-09-15T10:00:00Z</DataWytworzeniaFa>
</Naglowek>
<!-- ✅ All required fields in Naglowek -->
<Naglowek>
<KodFormularza kodSystemowy="FA (3)" wersjaSchemy="1-0E">FA</KodFormularza>
<WariantFormularza>3</WariantFormularza>
<DataWytworzeniaFa>2026-09-15T10:00:00Z</DataWytworzeniaFa>
</Naglowek>More about this error: Missing required field in FA(3) invoice XML.
4. Wrong NIP format
The schema requires exactly 10 digits with no separators. 123-456-78-90 and PL 1234567890 are both wrong. The PL prefix never goes in the NIP field. The seller gives it separately in PrefiksPodatnika (Podmiot1) when it is required (e.g. for an intra-Community supply). A Polish buyer in Podmiot2 is identified by NIP alone; KodUE and NrVatUE are for the EU VAT number of a buyer from another member state.
<!-- ❌ Hyphens in NIP -->
<NIP>123-456-78-90</NIP>
<!-- ❌ Country prefix in NIP -->
<NIP>PL1234567890</NIP>
<!-- ✅ 10 digits, no separators -->
<NIP>1234567890</NIP>A Polish buyer's NIP must go in the NIP field of Podmiot2/DaneIdentyfikacyjne, not in
NrVatUE or NrID. In the wrong field the invoice will not be delivered correctly in KSeF.
More about this error: Invalid field value: NIP.
5. Wrong date format
The Polish 15.09.2026 instead of 2026-09-15 is the most common slip. The second is mixing up date fields (P_1) with the date-time field (DataWytworzeniaFa). Date fields (P_1, P_6, P_6A and others) take YYYY-MM-DD. DataWytworzeniaFa takes YYYY-MM-DDTHH:MM:SS. The MF information sheet gives an example in UTC, with Z at the end, but the schema also accepts a value without a time zone or with an offset (+02:00).
<!-- ❌ Polish date format -->
<P_1>15.09.2026</P_1>
<!-- ❌ Date and time in a date-only field -->
<P_1>2026-09-15T10:00:00Z</P_1>
<!-- ✅ Correct date -->
<P_1>2026-09-15</P_1>
<!-- ❌ Space instead of T, no seconds -->
<DataWytworzeniaFa>2026-09-15 10:00</DataWytworzeniaFa>
<!-- ✅ Date and time in UTC, with Z at the end -->
<DataWytworzeniaFa>2026-09-15T10:00:00Z</DataWytworzeniaFa>More about this error: Invalid field value: date format.
6. Too many decimal places
ERPs and spreadsheets store numbers at full precision (123.456789), and the excess ends up in the XML on export. Round to:
- amounts (P_11, P_13_x, P_14_x, P_15): max 2 places,
- quantities (P_8B): max 6 places,
- unit prices (P_9A, P_9B): max 8 places.
The decimal separator is always a dot. A comma or a space as a thousands separator is not allowed.
<!-- ❌ 3 decimal places in P_15 (max 2) -->
<P_15>123.123</P_15>
<!-- ✅ Correct, 2 places -->
<P_15>123.12</P_15>
<!-- ❌ 7 places in quantity P_8B (max 6) -->
<P_8B>1.1234567</P_8B>
<!-- ✅ Correct, 6 places -->
<P_8B>1.123456</P_8B>
<!-- ❌ Comma as decimal separator -->
<P_15>123,45</P_15>
<!-- ❌ Space as thousands separator -->
<P_15>1 234.56</P_15>
<!-- ✅ Dot only, no separators -->
<P_15>1234.56</P_15>More about this error: Invalid field value: too many decimal places.
7. Missing Podmiot2, JST and GV
JST and GV did not exist in FA(2), so an export based on an old template does not generate them. The schema always requires them, even when the value is 2 (not applicable). Add them at the end of Podmiot2, after Adres and any optional fields.
JST=1: the invoice concerns a subordinate local government unit;2: not applicable.GV=1: the invoice concerns a VAT group member;2: not applicable.
<!-- ❌ Missing JST and GV -->
<Podmiot2>
<DaneIdentyfikacyjne>
<NIP>9876543210</NIP>
<Nazwa>Firma Nabywcy</Nazwa>
</DaneIdentyfikacyjne>
<Adres>
<KodKraju>PL</KodKraju>
<AdresL1>ul. Testowa 1, 00-001 Warszawa</AdresL1>
</Adres>
</Podmiot2>
<!-- ✅ With JST and GV -->
<Podmiot2>
<DaneIdentyfikacyjne>
<NIP>9876543210</NIP>
<Nazwa>Firma Nabywcy</Nazwa>
</DaneIdentyfikacyjne>
<Adres>
<KodKraju>PL</KodKraju>
<AdresL1>ul. Testowa 1, 00-001 Warszawa</AdresL1>
</Adres>
<JST>2</JST>
<GV>2</GV>
</Podmiot2>More about this error: Missing JST and GV in Podmiot2: what to enter.
8. Wrong VAT rate in P_12
P_12 accepts only values from the FA(3) catalogue, and they are case- and space-sensitive. A bare 0 does not exist, you must give a variant (0 KR, 0 WDT, 0 EX), the space in 0 KR is mandatory, and zw is lowercase.
Allowed: 23, 22, 8, 7, 5, 4, 3, 0 KR, 0 WDT, 0 EX, zw, oo, np I, np II.
<!-- ❌ Bare 0, no variant -->
<P_12>0</P_12>
<!-- ✅ Domestic 0% rate -->
<P_12>0 KR</P_12>
<!-- ❌ Percent sign -->
<P_12>23%</P_12>
<!-- ✅ No percent sign -->
<P_12>23</P_12>
<!-- ❌ Uppercase -->
<P_12>ZW</P_12>
<!-- ✅ Lowercase -->
<P_12>zw</P_12>
<!-- ❌ Missing space -->
<P_12>0KR</P_12>
<!-- ✅ With space -->
<P_12>0 KR</P_12>The value oo (reverse charge) applies only to domestic transactions. For invoices to foreign buyers who account for VAT in their own country, use np I or np II.
More about this error: Invalid VAT rate in P_12: allowed values.
9. Wrong identification of a foreign buyer
FA(3) identifies the buyer differently depending on the country and on whether the buyer is a business:
- Poland: the
NIPfield (10 digits, no prefix), - EU:
KodUE+NrVatUE(country code separate, VAT number without prefix), - outside the EU: no identifier is required,
BrakID=1is enough; if you give one, put it inNrIDand the country code separately inKodKraju, - consumer:
BrakID=1.
A common mistake is putting the country code inside the VAT number (DE123456789 in NrVatUE) or inside NrID. KodKraju in DaneIdentyfikacyjne is about tax identification, and KodKraju in Adres is about the address. They are two separate fields.
<!-- ❌ Country prefix in VAT number -->
<DaneIdentyfikacyjne>
<KodUE>DE</KodUE>
<NrVatUE>DE123456789</NrVatUE>
<Nazwa>Deutsche Firma GmbH</Nazwa>
</DaneIdentyfikacyjne>
<!-- ✅ EU buyer: country code in a separate field -->
<DaneIdentyfikacyjne>
<KodUE>DE</KodUE>
<NrVatUE>123456789</NrVatUE>
<Nazwa>Deutsche Firma GmbH</Nazwa>
</DaneIdentyfikacyjne>
<!-- ✅ Non-EU buyer -->
<DaneIdentyfikacyjne>
<KodKraju>US</KodKraju>
<NrID>12-3456789</NrID>
<Nazwa>American Corp</Nazwa>
</DaneIdentyfikacyjne>
<!-- ✅ Consumer / buyer with no identifier -->
<DaneIdentyfikacyjne>
<BrakID>1</BrakID>
<Nazwa>Jan Kowalski</Nazwa>
</DaneIdentyfikacyjne>10. P_15 doesn't match the totals
P_15 (total amount due) must equal the sum of the net amounts (P_13_x) and the tax (P_14_x). The usual culprit is rounding (tax of 22.9977 rounded to 22.99 instead of 23.00) or a skipped P_13_x field, such as P_13_6_1 for the 0% rate.
Formula: P_15 = sum of all P_13_x + sum of all P_14_x, that is P_13_1 to P_13_11 and P_14_1 to P_14_5. Fields P_13_6_1 to P_13_11 (0% rate, exempt, reverse charge) have no matching P_14_x, but their net amounts count towards P_15.
<!-- ❌ P_15 doesn't match the sum -->
<P_13_1>1000.00</P_13_1>
<P_14_1>230.00</P_14_1>
<P_15>1200.00</P_15>
<!-- ✅ Correct sum: 1000 + 230 = 1230 -->
<P_13_1>1000.00</P_13_1>
<P_14_1>230.00</P_14_1>
<P_15>1230.00</P_15>
<!-- ✅ Mixed rates: 100 + 23 + 200 + 16 = 339 -->
<P_13_1>100.00</P_13_1>
<P_14_1>23.00</P_14_1>
<P_13_2>200.00</P_13_2>
<P_14_2>16.00</P_14_2>
<P_15>339.00</P_15>The ksefuj.to validator tolerates a difference of up to 0.01 PLN when comparing totals.
More about this error: VAT calculation error: P_14 or P_15 is wrong.
11. Incomplete Adnotacje
The name suggests notes, but Adnotacje is a mandatory section with eight fields, each of which needs a value. Three (Zwolnienie, NoweSrodkiTransportu, PMarzy) need nested elements even when the answer is "no". The order is mandatory too: P_16 → P_17 → P_18 → P_18A → Zwolnienie → NoweSrodkiTransportu → P_23 → PMarzy.
For a standard VAT invoice the block below works as a template unchanged:
<!-- ❌ Incomplete Adnotacje -->
<Adnotacje>
<P_16>2</P_16>
<P_17>2</P_17>
</Adnotacje>
<!-- ✅ Complete Adnotacje (standard invoice) -->
<Adnotacje>
<P_16>2</P_16>
<P_17>2</P_17>
<P_18>2</P_18>
<P_18A>2</P_18A>
<Zwolnienie><P_19N>1</P_19N></Zwolnienie>
<NoweSrodkiTransportu><P_22N>1</P_22N></NoweSrodkiTransportu>
<P_23>2</P_23>
<PMarzy><P_PMarzyN>1</P_PMarzyN></PMarzy>
</Adnotacje>12. P_6, P_6A and OkresFa
Three fields, three uses:
- P_6 (in
Fa): the delivery or service date, common to all lines, - P_6A (in
FaWiersz): the date for a specific line, when lines have different dates, - OkresFa (in
Fa): a billing period (for example a September subscription), withP_6_OdandP_6_Do.
In Fa, P_6 and OkresFa are mutually exclusive (xs:choice in the XSD). The ban on combining P_6 with P_6A is a separate semantic rule. OkresFa can appear together with P_6A, because it does not conflict with it at any level of the schema.
<!-- ❌ P_6 and P_6A at the same time -->
<Fa>
<P_6>2026-09-15</P_6>
...
</Fa>
<FaWiersz>
<NrWierszaFa>1</NrWierszaFa>
<P_6A>2026-09-14</P_6A>
...
</FaWiersz>
<!-- ✅ Option A: common delivery date (P_6 in Fa, no P_6A) -->
<Fa>
<P_6>2026-09-15</P_6>
...
</Fa>
<FaWiersz>
<NrWierszaFa>1</NrWierszaFa>
...
</FaWiersz>
<!-- ✅ Option B: per-line dates (P_6A in FaWiersz, no P_6) -->
<Fa>...</Fa>
<FaWiersz>
<NrWierszaFa>1</NrWierszaFa>
<P_6A>2026-09-14</P_6A>
...
</FaWiersz>
<FaWiersz>
<NrWierszaFa>2</NrWierszaFa>
<P_6A>2026-09-15</P_6A>
...
</FaWiersz>
<!-- ✅ Option C: billing period (OkresFa instead of P_6) -->
<Fa>
<OkresFa>
<P_6_Od>2026-09-01</P_6_Od>
<P_6_Do>2026-09-30</P_6_Do>
</OkresFa>
...
</Fa>P_6 is not P_1. P_1 is the invoice issue date and is always mandatory. P_6 is the delivery or service date, often the same as P_1 but with a different legal meaning.
Which XML requirements does the FA(3) schema not check?
A file that matches the schema must also meet a few technical requirements from the KSeF API documentation. It can't start with a BOM (an invisible encoding marker at the beginning of the file), and the prolog can't declare an encoding other than UTF-8 (for example encoding="windows-1250"). The file also can't contain processing instructions, i.e. notes for other programs such as <?xml-stylesheet ...?>, or discouraged Unicode characters.
The TEST and DEMO environments have rejected processing instructions and discouraged characters since API version 2.4.0 (April 2026). On 24 June the API team announced that production KSeF would start rejecting such files from 19 October 2026, but as of 2 November the API documentation hadn't confirmed it. CIRFMF/ksef-api, issue #718 Later, on 6 July, the API repository maintainer wrote about the discouraged-character check that they fear it will ultimately not reach version 2.0 in production, and named it a candidate for version 3.0. That comment doesn't cover processing instructions. CIRFMF/ksef-api, issue #700 The API changelog attributes the prolog encoding rule to the earlier version 2.3.0 and gives no date for the BOM rule, so it's unclear since when production enforces these two requirements. The ranges of discouraged characters and how to check your own files are covered in our post on stricter XML validation in KSeF.
Status as of 2 November 2026.
MF / CIRF, Invoice verification, section on XML verificationNext step
You can drop a failing file into ksefuj.to and the validator will point to each of the problems above; the file never leaves your browser. If you're just starting, begin with the first invoice guide, and when migrating from the old format, with the differences between FA(2) and FA(3).
Errors outside this list have their own pages too, such as XML is not well-formed or invalid bank account number.
FA(3) XSD Schema — crd.gov.plWas this article helpful?
Sources
- FA(3) Information Sheet (MF)
- FA(3) XSD Schema
- KSeF 2.0 Handbook, part II (6 Aug 2026), sections 1.6.1 and 1.6.2
- MF / CIRF: Invoice verification, section on XML verification
- CIRFMF/ksef-api: API changelog (versions 2.3.0 and 2.4.0)
- CIRFMF/ksef-api: issue #718 (19 October 2026 date)
- CIRFMF/ksef-api: issue #700 (discouraged characters and version 2.0)
Don’t miss KSeF changes
We’ll send a short email when KSeF rules or deadlines change. We only write then, so you won’t hear from us often.
You can unsubscribe at any time. Powered by Buttondown
Read next
- ErrorsGuide12 min read
FA(3) XSD schema and a sample XML invoice
The FA(3) KSeF XML schema is schemat.xsd plus three shared MF schemas. See how Faktura is built, the field types and a sample XML that passes validation.
- Errors12 min read
KSeF error 450: rejected invoice or bad token?
On an invoice, 450 means semantic verification failed: KSeF assigns no number, so fix the file and resend it. At login, 450 means an invalid token.
- ErrorsGuide9 min read
Validate FA(3) XML before you send it to KSeF
KSeF checks a file only when you send it. Before that, validate the XML against the FA(3) schema with xmllint or our validator; KSeF's verdict comes on TEST.