Overview
P_2 is the invoice number (in Polish, "numer identyfikujący fakturę"). It is a required field in the Fa section of the FA(3) XML and holds the unique number the seller assigns to the invoice.
Each seller must keep P_2 unique so the invoice can be identified unambiguously. A duplicate P_2 for the same seller makes it hard for the buyer, the accountant or the tax office to tell two documents apart, and it breaks reconciliation in your own systems.
Use a short, stable numbering scheme. Software subscriptions commonly use a prefix, a year and a running sequence, for example FV/2026/10/001. Avoid characters that are easy to mistype, and do not reuse a number after correcting an invoice — corrections have their own FA(3) mechanisms rather than reusing the original number.
P_2 is independent of the KSeF number. The KSeF number is assigned by the KSeF system after the invoice is accepted; P_2 is the number you assign before sending. The UPO is a separate document: the official confirmation of receipt that KSeF issues for the submission. Keeping P_2 and the KSeF number visible side by side in your system makes support and reconciliation much easier.
The Notaly API takes the invoice number as the number property, a plain string that must not be empty, and writes it to P_2 without reformatting it. On a connected KSeF account, what you send is what appears in the stored XML and the PDF. In the free sandbox, which sends from a shared test NIP on KSeF TEST, Notaly appends a short suffix such as /1a2b3c4d to the number so that test invoices from different accounts do not collide; the suffix is visible in the XML, the PDF and the API response.
<P_2>FV/2026/10/001</P_2>This snippet shows only the field(s) on this page. Mandatory FA(3) sections (Nagłówek, Podmiot1, Podmiot2, the remaining Fa fields, Adnotacje, RodzajFaktury and at least one FaWiersz) are omitted for brevity. It is not a complete or valid invoice on its own.
Sources
Source: crd.gov.pl