KSEF-PL-NIP-01: Polish Seller NIP (Podmiot1/DaneIdentyfikacyjne/NIP) must be an exact 10-digit tax identifier without PL prefix
The KSEF-PL-NIP-01 rule enforces the Polish national e-invoicing requirement for the seller's tax identifier (NIP) within the KSeF FA(2) profile, which is based on UBL 2.1. The context XPath /Faktura/Podmiot1/DaneIdentyfikacyjne/NIP selects the NIP element of the seller (Podmiot1) under the Polish-specific extension. The assertion test matches(normalize-space(NIP), "^[0-9]{10}$") checks that the normalized text content of NIP consists of exactly 10 digits. This corresponds to the business term BT-31 (Seller VAT identifier) but with a Polish-specific constraint: the NIP must be a 10-digit number without the 'PL' country prefix. The rule is fatal because an invalid NIP prevents the invoice from being accepted by the KSeF system. The XPath evaluation context is the NIP element itself, so the test is applied to its string value after whitespace normalization.
1. Locate the seller's NIP element at /Faktura/Podmiot1/DaneIdentyfikacyjne/NIP. 2. Remove any leading 'PL' prefix or other country codes. 3. Ensure the value contains exactly 10 digits (0-9) with no spaces, hyphens, or other characters. 4. If the NIP is provided with separators (e.g., '123-456-32-18'), remove them to get '1234563218'. 5. Validate that the resulting string matches the regular expression ^[0-9]{10}$. 6. Update the XML with the corrected NIP.
KSeF XSD rejects NIP "PL1234567890". Country prefixes ("PL") and hyphens are forbidden.
fix: Normalize <NIP> to 10 digits: <NIP>1234567890</NIP>.