InvoiceSpec / Rules Registry / ksef-fa-2 / KSEF-PL-P1-DATE
fatal ASSERTION · KSEF-PL-P1-DATE KSeF FA(2) / FA(3) (Polish Mandate) (FA-2-XML) Jurisdiction: PL

KSEF-PL-P1-DATE: KSeF Invoice Issue Date (Fa/P_1) must conform to YYYY-MM-DD and cannot exceed session submission timestamp

Official KSeF FA(2) / FA(3) (Polish Mandate) Spec ↗
01. Technical Specification & XPath Evaluation Context

This rule enforces the Polish KSeF (Krajowy System e-Faktur) specific requirement for the invoice issue date (P_1) in the FA(2) format. The context XPath /Faktura/Fa/P_1 selects the P_1 element, which corresponds to BT-2 (Invoice issue date) in EN 16931. The test xs:date(P_1) <= current-date() checks that the value of P_1, when cast to xs:date, is less than or equal to the current date (the date of validation, which approximates the session submission timestamp). The rule triggers if the cast fails (e.g., invalid date format) or if the date is in the future. The severity is fatal, meaning the invoice is rejected. Note: The official assertion message mentions YYYY-MM-DD format, but the XPath test only checks the date value; format compliance is enforced by the underlying XML Schema (xs:date). However, the test will fail if P_1 is not a valid xs:date, which includes format errors. The rule is specific to KSeF and does not appear in standard EN 16931 or Peppol BIS.

Evaluated XPath Location:
/Faktura/Fa/P_1
Deterministic Remediation Steps

1. Ensure that the P_1 element contains a date value in the format YYYY-MM-DD (e.g., 2023-10-15). Do not include time or timezone information. 2. Verify that the date is not later than the current date at the time of invoice submission to KSeF. If the invoice is generated in advance, adjust the date to the actual issue date or the submission date. 3. If using a library to generate the XML, configure it to output xs:date without time component. 4. Validate the invoice against the KSeF FA(2) schema and Schematron rules before submission to catch such errors early.

02. Side-by-Side FA-2-XML Payload Diff (Rejected vs. Compliant)
--- a/invoice-rejected.xml (KSEF-PL-P1-DATE) FAIL
1 <Faktura xmlns="http://crd.gov.pl/wzor/2023/06/29/12648/">
2 <Fa>
3 <!-- P_1 is in the future (2025-12-31) and also not in YYYY-MM-DD format (has time) -->
4 <P_1>2025-12-31T00:00:00</P_1>
5 </Fa>
6 </Faktura>
+++ b/invoice-compliant.xml (EN 16931 VALID)
PASS
1 <Faktura xmlns="http://crd.gov.pl/wzor/2023/06/29/12648/">
2 <Fa>
3 + <!-- P_1 is a valid date in YYYY-MM-DD format and not in the future -->
4 + <P_1>2023-10-15</P_1>
5 </Fa>
6 </Faktura>
03. Interactive KSeF FA(2) / FA(3) (Polish Mandate) Validation & Auto-Fix Workbench
3 CREDITS
invoice.xmlFA-2-XML
DETECTED SOURCECustom ERP / Billing Engine
BT-131 LINE SUM0.00 EUR
BT-106 HEADER0.00 EUR
SCHEMATRON: 1 FATAL· 1ms
KSeF FA(2) / FA(3) (Poland)
KSEF-PL-NIP-01Polish Seller NIP ("MISSING") must be an exact 10-digit tax identifier without PL prefix
Spec & Diff
xpath: /Faktura/Podmiot1/DaneIdentyfikacyjne/NIP

KSeF XSD rejects NIP "MISSING". Country prefixes ("PL") and hyphens are forbidden.

fix: Normalize <NIP> to 10 digits: <NIP>1111111111</NIP>.

Automate Custom ERP / Billing Engine → KSeF FA(2) / FA(3) (Poland) AP Delivery

Deploy certified Peppol Access Point & ZUGFeRD ERP connector

04. Adjacent KSeF FA(2) / FA(3) (Polish Mandate) Assertions Browse All Rules →