KSeF FA(3) rules cover the Polish structured invoice: XSD schema errors (element order, NIP and date patterns, allowed values) and semantic rules from the Ministry of Finance (annotations, party roles, bank accounts, currency rates, amounts).
Source: KSeF FA(3) schema 1-0E + semantic rules (@ksefuj/validator 0.4)
All rules (56)
| ID | Rule | Severity |
|---|---|---|
ADNOTACJE_NST_MISSING | NoweSrodkiTransportu element is mandatory in Adnotacje (§9.6) | Error |
ADNOTACJE_P16_MISSING | P_16 is mandatory in Adnotacje (§9.6) | Error |
ADNOTACJE_P17_MISSING | P_17 is mandatory in Adnotacje (§9.6) | Error |
ADNOTACJE_P18_MISSING | P_18 is mandatory in Adnotacje (§9.6) | Error |
ADNOTACJE_P18A_MISSING | P_18A is mandatory in Adnotacje (§9.6) | Error |
ADNOTACJE_P23_MISSING | P_23 is mandatory in Adnotacje (§9.6) | Error |
ADNOTACJE_PMARZY_MISSING | PMarzy element is mandatory in Adnotacje (§9.6) | Error |
ADNOTACJE_ZWOLNIENIE_MISSING | Zwolnienie element is mandatory in Adnotacje (§9.6) | Error |
AMOUNT_NO_SEPARATORS | Amount fields must not contain spaces, commas, or any non-numeric characters except… | Error |
CURRENCY_RATE_MISMATCH | KursWaluty does not match the NBP Table A mid-rate for the reference date (Art | Warning |
CURRENCY_RATE_UNVERIFIABLE | KursWaluty cannot be verified — NBP rate unavailable or outside the valid date window (Art | Warning |
DECIMAL_PRECISION | Amount field exceeds maximum decimal precision defined in §2.6 of FA(3) specification | Error |
DUPLICATE_LINE_NUMBERS | Line numbers (NrWierszaFa) must be unique within the invoice (except in corrective… | Error |
ELEMENT_NOT_ALLOWED | Element not allowed at this location | Error |
ENCODING_ERROR | Character encoding error | Error |
FOREIGN_CURRENCY_TAX_PLN | Foreign currency invoice with tax amounts should include PLN conversions in P_14_*W… | Warning |
GTU_FORMAT | GTU value must match pattern GTU_XX (GTU_01 through GTU_13) | Error |
GV_REQUIRES_PODMIOT3 | When Podmiot2/GV = '1', at least one Podmiot3 must exist with Rola = '10' (§6.1,… | Error |
INVALID_BANK_ACCOUNT_FORMAT | Polish bank account (NrRB) must be 28 characters for IBAN format (PL + 26 digits) or… | Error |
INVALID_ELEMENT_VALUE | Element value does not match schema constraints | Error |
IPKSEF_FORMAT | IPKSeF must be exactly 13 alphanumeric characters [0-9a-zA-Z] (§12.1) | Warning |
JST_REQUIRES_PODMIOT3 | When Podmiot2/JST = '1', at least one Podmiot3 must exist with Rola = '8' (§6.1,… | Error |
KOR_NRKSEF_CONSISTENCY | DaneFaKorygowanej | Error |
KURS_WALUTA_PAIR | KursUmowny and WalutaUmowna must both be present or both absent (§13.1, Appendix D #11) | Error |
KURS_WALUTY_Z_PLACEMENT | KursWalutyZ at Fa level is ONLY valid for advance invoices (RodzajFaktury = ZAL or… | Error |
MALFORMED_XML | XML is not well-formed | Error |
NEGATIVE_QUANTITY_NOT_ALLOWED | Negative quantities (P_8B) are only allowed in corrective invoices (RodzajFaktury =… | Error |
NIP_IN_WRONG_FIELD | Polish NIP detected in NrVatUE field - must be in NIP field for purchaser KSeF access… | Warning |
NRRB_LENGTH | NrRB must be 10–34 characters (§12.1) | Warning |
NST_LOGIC | NoweSrodkiTransportu | Error |
OO_RATE_FOREIGN_BUYER | P_12 = 'oo' is for domestic reverse charge only | Warning |
P6_P6A_MUTUAL_EXCLUSION | P_6 (common delivery date) and P_6A (per-line delivery date) are mutually exclusive… | Error |
P12_ENUMERATION | P_12 must be one of | Error |
P15_MISSING | P_15 (total amount due) is mandatory in Fa (§9.4) | Error |
PAYMENT_ZAPLACONO_DATE | When Platnosc/Zaplacono = '1', DataZaplaty must be present (§12.1) | Warning |
PMARZY_LOGIC | PMarzy | Error |
PODMIOT2_GV_MISSING | GV element is mandatory in Podmiot2 (§6.1) | Error |
PODMIOT2_JST_MISSING | JST element is mandatory in Podmiot2 (§6.1) | Error |
PODMIOT3_ROLE_MISSING | When Podmiot3 has no Rola, both RolaInna and OpisRoli must be present | Error |
PODMIOT3_UDZIAL_REQUIRES_ROLE_4 | Udzial element on Podmiot3 is only permitted when Rola = '4' (§7.2) | Error |
RACHUNEKBANKOWY_NRRB | When RachunekBankowy element is filled, NrRB is mandatory (nested obligation) (§2.2,… | Error |
REQUIRED_ELEMENT_MISSING | Required element missing according to schema | Error |
REVERSE_CHARGE_CONSISTENCY | Reverse charge | Warning |
RODZAJ_FAKTURY_SECTIONS | Invoice type determines required sections | Error |
SCHEMA_VALIDATION_FAILED | XML does not conform to FA(3) XSD schema | Error |
SELF_BILLING_PODMIOT3_CONFLICT | Self-billing (P_17 = '1') | Warning |
TAX_CALCULATION_MISMATCH | Tax calculation error | Error |
TRANSPORT_MINIMUM_DATA | Transport requires | Warning |
WALUTA_UMOWNA_PLN | WalutaUmowna must NEVER be 'PLN' (§13.1, Appendix D #10) | Error |
XML_BOM_PRESENT | File starts with a UTF-8 BOM | Error |
XML_DISCOURAGED_CHARACTER | Character discouraged by the W3C XML spec ([#x7F-#x84], [#x86-#x9F], [#xFDD0-#xFDEF],… | Error |
XML_DISCOURAGED_CHARACTER_MORE | Summary | Error |
XML_ENCODING_NOT_UTF8 | XML declaration names an encoding other than UTF-8 | Error |
XML_PROCESSING_INSTRUCTION | XML processing instruction (e.g | Error |
XML_PROCESSING_INSTRUCTION_MORE | Summary | Error |
ZWOLNIENIE_LOGIC | Zwolnienie | Error |