.png)
KSeF affects more than just how invoices are issued and received. From January 1, 2027, new requirements will also apply to the payment process.
For certain payments between active VAT taxpayers, it will be necessary to provide the KSeF invoice number or the KSeF Collective Identifier. For organizations using Microsoft Dynamics AX 2012 , this means the need to integrate KSeF data with another area of the ERP system – payment and settlement processing.
Of particular importance is the Collective Identifier, which allows a single payment to be linked to multiple KSeF invoices.
At Retcon, we have developed a solution that extends Microsoft Dynamics AX 2012 to support the Collective Identifier for both outgoing payments related to purchase invoices and incoming payments related to sales invoices.
From January 1, 2027, a payer who is an active VAT taxpayer, when making a specific payment to another active VAT taxpayer, will be required to indicate in the payment the number identifying the invoice in KSeF or the Collective Identifier assigned by KSeF.
This applies to payments made via bank transfer or any other payment instrument that allows for a payment reference to be provided.
In practice, this marks the next stage of integrating KSeF with a company's financial processes.
Until now, the main task of the ERP system was, among other things, to send sales invoices to KSeF, receive the KSeF number, and download purchase invoices. From 2027, the KSeF number will also be used during the execution and settlement of payments.
The process no longer ends with the invoice:
invoice → KSeF number → payment → Collective Identifier → settlement
For systems like Microsoft Dynamics AX 2012, this means extending the existing payment process to include communication with KSeF.
KSeF Collective Identifier (CI) is a number generated in KSeF for a group of structured invoices that already have KSeF numbers.
Its use is particularly important when a single payment covers multiple invoices from the same vendor.
Example:
a company has a dozen or so unpaid invoices from a single supplier and wants to settle them with one bank transfer.
Each invoice has its own KSeF number. Instead of handling all these numbers individually, a single Collective Identifier can be generated for the relevant set of invoices.
As a result, one CI points to the set of invoices covered by a given payment.
The Collective Identifier is 35 characters long and includes, among other things, the tax ID (NIP) of the generating entity, the "IZ" designation, the year and month of generation, a unique string of characters, and check digits.
What matters most, however, is not its technical structure, but the ability to unambiguously link a payment to specific invoices recorded in KSeF.
Generating a Collective Identifier requires meeting specific conditions.
A single CI can cover between 2 and a maximum of 10,000 invoices.
Invoices must have a KSeF number assigned and must relate to the same seller. The process also includes a time-based restriction – invoices covered by a given Collective Identifier are grouped within the appropriate monthly period.
Therefore, if a payment journal contains 100 invoices from 10 different suppliers, the system should not create one single Collective Identifier. Invoices are grouped by supplier, and separate CIs are generated for each respective group.
It is also possible to use a single invoice in more than one Collective Identifier. This is particularly important in cases such as partial payments.
The KSeF number is a mandatory requirement. If a document does not have a number assigned by KSeF, it cannot be included in the Collective Identifier generation process.
This applies, among others, to documents that have not been accepted into KSeF, are not subject to KSeF, or have not yet been assigned a KSeF number at a given time.
Microsoft Dynamics AX 2012 was designed many years before the National e-Invoicing System (KSeF) was created.
The standard payment process in AX 2012 allows users to prepare payment proposals, select vendor invoices, generate payments, and settle documents. However, it does not have native support for the KSeF Collective Identifier mechanism.
Without an extension, part of the process would have to be performed outside the ERP system.
This could mean the need for:
With a few documents, the process may seem simple. With hundreds or thousands of invoices, it becomes an additional burden for the finance department and increases the number of manual operations.
That is why the Retcon solution was designed as an extension of the existing AX 2012 process. The user continues to work in the familiar system environment, and Collective Identifier handling is integrated into the payment process.
In the case of purchase invoices, the starting point is posted and unpaid vendor invoices with an assigned KSeF number.
The user prepares a payment in the standard Microsoft Dynamics AX 2012 payment journal.
The Retcon extension then allows for the generation of a Collective Identifier in two ways.
The user can run the "Generate CI automatically".
The system analyzes the invoices in the payment journal, groups them by vendor, and prepares the appropriate sets for generating Collective Identifiers.
A corresponding CI is created for each vendor, provided the required criteria are met.
The second option is manual document selection.
The user runs the "Mark invoices for CI"function, selects the specific invoices to be included in the Collective Identifier, and then uses the "Generate CI manually"function.
The system monitors the minimum and maximum number of invoices as well as other process requirements.
This allows the user to decide whether to automatically process the documents in the journal or create a CI for a specific group of invoices.
Simply adding a "Collective Identifier" field does not solve the problem. Communication is required between Microsoft Dynamics AX 2012 and KSeF.
Before sending a request, the system performs the necessary validations.
It checks, among other things, whether:
Only after successful validation does AX 2012 communicate with the KSeF API.
Data requiring transmission to KSeF is properly prepared and encrypted, and then the system sends a request to generate a Collective Identifier.
Upon receiving the response, the CI number is saved in AX 2012.
In the payment journal, the user can see both the KSeF numberand the Collective Identifier assigned to the documents.
Information about the CI can then be transferred to the subsequent payment preparation process.
The solution therefore utilizes the standard AX 2012 process, extending it with a communication stage with KSeF and support for the Collective Identifier.
The process described in the Retcon purchasing solution concludes with the generation of the appropriate payment file from AX 2012. The method for subsequently transmitting the file to the bank depends on the specific solution and integrations used by the organization.
The Collective Identifier is also significant on the other side of the process – when a company receives a payment from a customer.
The starting point is posted but unsettled sales invoices that have KSeF numbers.
The company receives a bank statement and imports it into the Microsoft Dynamics AX 2012 financial journal.
If the payment data contains a Collective Identifier, the solution can use it to determine which invoices the payment covers.
For example, a single bank statement line might contain a payment of 10,000 PLN, which in reality settles 10 invoices of 1,000 PLN each.
The CI number itself does not directly tell the user which documents need to be settled.
The system therefore communicates with KSeF in order to decode the Collective Identifier and obtain the KSeF numbers of the invoices covered by the payment.
This makes it possible to trace a single bank statement entry back to the specific sales documents recorded in AX 2012.
After decoding the Collective Identifier, the system receives information about the KSeF numbers of the invoices assigned to that specific CI.
Next, AX 2012 uses the KSeF numbers to link the information returned by KSeF with the sales invoices present in the system.
In a scenario where the CI is correct, all invoices are open, and the data allows for an unambiguous payment match, the system can:
The Batch ID is simultaneously saved in the relevant financial journal data and on the invoices.
However, not every situation will allow for full automated settlement.
If the Batch ID is incorrect, does not exist in the KSeF, required data is missing, or a payment cannot be unambiguously matched to documents, the item may be directed for manual user processing.
Automation does not replace process control, but it does take over repetitive scenarios where data is complete and unambiguous.
Integration with the KSeF involves a series of requests and responses exchanged between systems. In financial processes, it is important not only to execute an operation but also to be able to verify its progress later.
Therefore, the Retcon solution includes a dedicated "Communication History – Batch ID"function.
The history is available for both purchasing and sales processes.
The system records information regarding AX 2012 communication with the KSeF, including, among others:
This allows the user to check what happened during the generation or decoding of the Collective Identifier.
The history is important both for ongoing error handling and for process auditing.
Additionally, for purchase invoices, a history of the Collective Identifiers themselves is provided. The user can check, among other things, the date the CI was generated, the current CI number, and the previous CI number assigned to a given invoice.
This is particularly important in situations where a single invoice is included in more than one Collective Identifier.
The payment process does not always follow the simplest scenario. Therefore, handling the Collective Identifier also requires appropriate validations and responses to exceptional situations.
A single invoice can be assigned to more than one Collective Identifier.
This is primarily relevant when an invoice is settled in parts. In such a case, AX 2012 can store both the current and the previously generated CI number associated with the document.
A single Collective Identifier can include from 2 to 10,000 invoices.
The system monitors the scope of selected documents. If a user attempts to generate a Collective Identifier (IZ) for an incorrect number of invoices, the process will not execute, and an appropriate message will be displayed.
If any of the selected invoices lack a KSeF number, they cannot be used to generate a Collective Identifier.
The system halts the process before sending a request to the KSeF API and notifies the user that the Collective Identifier cannot be generated.
The solution also accounts for situations where KSeF services are unavailable or operating in offline mode.
Before generating a Collective Identifier, the system can verify service availability. In the event of an issue, the user is notified of the KSeF outage and can decide how to proceed in accordance with their organization's internal policies.
In the purchase invoice solution, the system also verifies the supplier's country. The generation of Collective Identifiers is intended for Polish contractors who meet the process requirements.
If a user selects documents from a foreign supplier, the Collective Identifier generation process will be stopped, and the user will receive a notification regarding the invalid data scope.
In the sales process, a situation may arise where a customer provides an incorrect Collective Identifier or the data does not allow for the accurate identification of invoices.
In such cases, the system should not automatically settle documents that cannot be clearly identified. The item is then routed for further manual processing by the user.
Similarly, overpayments and underpayments remain subject to the organization's existing settlement procedures. The Collective Identifier itself is primarily used to identify the documents covered by the payment.
KSeF implementation does not end with issuing and receiving invoices.
Starting January 1, 2027, another area requiring preparation will be payment processes and the use of KSeF numbers and Collective Identifiers.
For organizations using Microsoft Dynamics AX 2012 this means that existing financial processes must be appropriately expanded.
Retcon has developed a solution that enables the handling of the Collective Identifier in AX 2012 for both outgoing payments for purchase invoices and incoming payments for sales invoices.
The solution covers AX–KSeF–AX communication, generation and decoding of the Collective Identifier, linking the CI with KSeF invoice numbers, settlement handling, and communication history.
https://www.retcon.pl/contact