Back

KSeF Collective Identifier in AX 2012 – 2027 payments

September 10, 2026
INSIGHT
KseF AX 2012

KSeF Aggregate Identifier in payments – how to handle it in Microsoft Dynamics AX 2012

KSeF changes not only the way invoices are issued and received. From 1 January 2027, new requirements will also affect payment processes.

For certain payments between active VAT taxpayers, it will be necessary to provide either the invoice KSeF number or an Aggregate Identifier assigned by KSeF. For organisations using Microsoft Dynamics AX 2012, this means connecting KSeF data with another ERP area: payments, bank statements and settlements.

The KSeF Aggregate Identifier is particularly important because it allows a single payment to be linked to multiple invoices that have KSeF numbers.

Retcon has developed an extension for Microsoft Dynamics AX 2012 that supports this process both for outgoing payments related to purchase invoices and incoming payments related to sales invoices.

What is the KSeF Aggregate Identifier?

The KSeF Aggregate Identifier is an aggregating number that can be generated in KSeF for at least two structured invoices issued by the same seller.

To generate it, the KSeF numbers of the invoices to be included must be provided. This makes it possible to use one identifier for a payment covering multiple invoices instead of listing each individual KSeF number separately.

KSeF also allows the Aggregate Identifier to be decoded, meaning that it is possible to determine which invoice KSeF numbers are associated with it. It is also possible to check which Aggregate Identifiers contain a specific KSeF number.

The Aggregate Identifier consists of 35 characters. Its structure includes:

  • the tax identification number (NIP) of the entity generating the identifier,
  • the designation “IZ”,
  • the year and month of generation,
  • a unique 12-character string,
  • two check digits.

Example structure:

9999999999-IZ202704-FFFFFFFFFFFF-FF

KSeF Aggregate Identifier – key rules

Question Answer
What is the Aggregate Identifier used for? It links one payment to multiple invoices that have KSeF numbers.
How many invoices can one Aggregate Identifier include? From 2 to 10,000 invoices.
Do the invoices need to have KSeF numbers? Yes.
Can invoices from different sellers be included? No. All invoices within one Aggregate Identifier must relate to the same seller.
Can one invoice belong to several Aggregate Identifiers? Yes, for example in the case of partial payments.
Can an Aggregate Identifier be decoded? Yes. KSeF can return the KSeF numbers of invoices included in a given Aggregate Identifier.
From when will the Aggregate Identifier matter in payment processes? From 1 January 2027 for payments subject to the requirement to provide a KSeF number or Aggregate Identifier.

According to the Polish Ministry of Finance, a single Aggregate Identifier can cover between 2 and 10,000 invoices. All invoices must have a KSeF number and must relate to the same seller.

What changes in KSeF payments from 1 January 2027?

From 1 January 2027, an active VAT taxpayer making a payment for invoices covered by the relevant regulations to another active VAT taxpayer will be required to provide either a KSeF number or an Aggregate Identifier if the payment is made by bank transfer or another payment instrument that allows a payment reference to be entered.

For:

  • payment of a single invoice – the KSeF number will be used,
  • payment of more than one invoice – an Aggregate Identifier generated by KSeF may be used.

The requirement will also apply to relevant payments made by third parties. The changes also affect payments made under the split payment mechanism.

For businesses, this means that ERP integration with KSeF no longer ends with issuing or receiving an invoice.

The process can be represented as follows:

invoice → KSeF number → payment → Aggregate Identifier → settlement

KSeF data therefore begins to directly affect banking and accounts receivable/accounts payable processes.

Example: one payment for multiple KSeF invoices

A company has received four structured invoices from one supplier. Each invoice has been accepted by KSeF and has its own KSeF number.

The company wants to settle all four liabilities with one bank transfer.

Instead of handling four KSeF numbers separately, the buyer selects the invoices for which an Aggregate Identifier should be generated. KSeF then creates one identifier covering the selected documents.

This identifier can subsequently be used when making the combined payment.

The Polish Ministry of Finance describes an equivalent scenario in the official KSeF 2.0 manual: the buyer receives several e-invoices from the same seller, provides their KSeF numbers, generates an Aggregate Identifier and then uses it when making the payment.

What conditions must invoices meet to be included in one Aggregate Identifier?

For invoices to be included in one Aggregate Identifier:

  • each invoice must have a KSeF number,
  • the identifier must include at least two invoices,
  • one identifier may include a maximum of 10,000 invoices,
  • all invoices must relate to the same seller,
  • the entity generating the Aggregate Identifier must have the appropriate access rights to the invoices,
  • the list of invoice KSeF numbers must be submitted to KSeF.

One invoice may be assigned to more than one Aggregate Identifier. The Ministry of Finance identifies partial payments as one example of such a use case.

Why is the Aggregate Identifier a challenge for Microsoft Dynamics AX 2012?

Microsoft Dynamics AX 2012 was developed many years before the introduction of Poland’s National e-Invoice System. The standard system therefore does not include native support for KSeF numbers or the Aggregate Identifier mechanism.

AX 2012 can handle payment preparation, vendor invoices, settlements and bank statements, but KSeF-specific data requires an extension of the standard processes.

Without appropriate integration, users would need to perform part of the process outside the ERP system, for example:

  • search for invoice KSeF numbers,
  • create groups of documents to be included in one payment,
  • generate Aggregate Identifiers outside AX 2012,
  • manually transfer data into the payment process,
  • determine which invoices are covered by an incoming combined payment,
  • store part of the information outside the ERP system.

With a small number of documents, these activities can be handled manually. With hundreds or thousands of invoices, however, they increase the amount of work performed by finance teams and make the process more difficult to control.

How to generate a KSeF Aggregate Identifier in Microsoft Dynamics AX 2012

Handling the Aggregate Identifier in AX 2012 requires the payment process to be connected with KSeF.

In Retcon’s solution, the mechanism is integrated with financial processes in AX 2012. The system can prepare invoice data, perform the required validations, communicate with KSeF and save the returned identifier against the relevant documents.

As a result, users do not need to move the entire process to a separate application.

How to handle the Aggregate Identifier for purchase invoices in AX 2012

For purchase processes, the starting point is posted vendor invoices that have KSeF numbers.

The user prepares a payment in Microsoft Dynamics AX 2012. Invoices selected for payment can be grouped according to the conditions required to generate an Aggregate Identifier.

Before sending the request to KSeF, the system should verify in particular:

  • whether the documents have KSeF numbers,
  • whether at least two invoices have been selected,
  • whether the limit of 10,000 documents has been exceeded,
  • whether the invoices relate to the correct seller,
  • whether the documents can be included in one Aggregate Identifier.

After successful validation, the KSeF numbers of the relevant invoices are submitted to KSeF.

KSeF generates the Aggregate Identifier, which can then be stored in AX 2012 and used in the subsequent payment process.

Automatic and manual creation of invoice groups

In financial processes, not all documents included in a payment journal should always be handled in the same way.

For this reason, Aggregate Identifier handling can support two scenarios.

In automatic mode, the system analyses the documents and creates appropriate groups of invoices that meet the process requirements.

In manual mode, the user selects the documents for which the Aggregate Identifier should be generated.

This approach allows companies to automate high-volume processes while retaining user control over non-standard cases.

How to use the Aggregate Identifier for incoming payments

The Aggregate Identifier is also relevant when the company acts as the seller and receives payment from a customer.

Example:

A company has issued 10 invoices of PLN 1,000 each to one customer. The customer pays all invoices with one transfer of PLN 10,000 and uses an Aggregate Identifier in the payment reference.

After importing the bank statement into the ERP system, the amount of PLN 10,000 alone is not sufficient to determine which invoices should be settled.

The Aggregate Identifier can be used to obtain from KSeF a list of invoice KSeF numbers associated with the identifier.

The ERP system can then use those KSeF numbers to locate the correct sales invoices.

How to decode a KSeF Aggregate Identifier

KSeF allows an Aggregate Identifier to be decoded, meaning that the user can determine which invoice KSeF numbers are included in it.

From the perspective of Microsoft Dynamics AX 2012, the process may work as follows:

  1. the system reads the Aggregate Identifier from the incoming payment data,
  2. it sends a request to KSeF,
  3. KSeF returns a list of invoice KSeF numbers,
  4. AX 2012 searches for the corresponding sales documents,
  5. the invoices can be linked to the specific payment,
  6. further settlement is performed according to the configured financial process.

The ability to decode the Aggregate Identifier is an official KSeF functionality intended specifically to identify the invoices included in the set.

How can AX 2012 support invoice settlement based on an Aggregate Identifier?

In the most straightforward scenario, the system has a complete set of data:

  • a valid Aggregate Identifier,
  • a list of KSeF numbers returned by KSeF,
  • corresponding open invoices in AX 2012,
  • a payment that matches the documents.

The system can then link one payment transaction with the appropriate set of invoices.

The KSeF number plays the key role. It acts as the link between the document stored in AX 2012 and the information returned after decoding the Aggregate Identifier.

Not every payment should qualify for automatic settlement. If data is missing or inconsistencies occur, a safer scenario is to route the transaction for user verification.

What happens if the Aggregate Identifier is incorrect?

The process should also cover exception scenarios.

For example:

  • the Aggregate Identifier may be invalid,
  • KSeF may not return the expected data,
  • KSeF numbers may not match documents in the ERP system,
  • some invoices may already have been settled,
  • the payment amount may not match the expected settlement,
  • the payment may be partial.

In such cases, the system should not automatically settle invoices that cannot be identified unambiguously.

Automation should handle repetitive and unambiguous scenarios, while exceptions should remain subject to user review.

Aggregate Identifier and partial payments

One invoice may be used in more than one Aggregate Identifier.

This is relevant for partial payments. An invoice may be included in one set during the first partial payment and then used again in another Aggregate Identifier during the next settlement.

For this reason, the ERP system should be able to retain the history of relationships between the invoice, its KSeF number and subsequent Aggregate Identifiers.

The Polish Ministry of Finance confirms that one invoice may be assigned to more than one Aggregate Identifier, including in scenarios involving partial payments.

AX–KSeF communication history

In financial processes, it is important not only to perform the operation but also to be able to determine later what happened between the ERP system and the external platform.

For this reason, an AX 2012 integration with KSeF should record the communication history related to Aggregate Identifiers.

The recorded information may include:

  • date and time of the operation,
  • operation type,
  • communication status,
  • technical operation or session identifier,
  • information about the submitted request,
  • KSeF response,
  • error messages.

This makes it easier to diagnose issues and reconstruct the process during a subsequent review or audit.

What about payments under the split payment mechanism?

The changes also apply to the split payment mechanism.

From 1 January 2027, the requirement to provide the KSeF number also applies to relevant payments made under the split payment mechanism.

If the payment covers several selected e-invoices, the payment reference may include an Aggregate Identifier generated by KSeF. Official materials indicate that, in this context, the payment may cover invoices from one supplier for a period of no less than one day and no more than one month.

This distinction is important: the one-month limitation relates to the described split-payment process and should not be presented as a general rule governing the Aggregate Identifier itself.

When should companies using AX 2012 prepare for Aggregate Identifier handling?

The requirement relating to the KSeF number and the Aggregate Identifier in payment processes will apply from 1 January 2027.

Preparation should start earlier.

The integration does not involve simply adding one new field to AX 2012. It affects the entire process:

invoice → KSeF number → document selection → Aggregate Identifier generation → payment → bank statement import → Aggregate Identifier decoding → settlement

Before production deployment, companies should therefore test both standard payment scenarios and exceptions such as partial payments, missing KSeF numbers and incorrect identifiers.

Frequently asked questions about the KSeF Aggregate Identifier in Microsoft Dynamics AX 2012

Does Microsoft Dynamics AX 2012 support the KSeF Aggregate Identifier as standard?

No. AX 2012 was developed before KSeF was introduced, so the standard version of the system does not contain a mechanism for handling the Aggregate Identifier. An extension of the system and integration with KSeF are required.

Does the Aggregate Identifier replace the invoice KSeF number?

No. Each invoice continues to have its own KSeF number. The Aggregate Identifier aggregates the KSeF numbers of several invoices and allows them to be linked to one payment.

Can an Aggregate Identifier be generated for one invoice?

No. The Aggregate Identifier is intended for at least two invoices. For a payment covering a single invoice, its individual KSeF number is used.

How many invoices can one Aggregate Identifier include?

One Aggregate Identifier can include from 2 to 10,000 invoices.

Can one Aggregate Identifier include invoices from different suppliers?

No. All invoices included in one Aggregate Identifier must relate to the same seller.

Can one invoice belong to several Aggregate Identifiers?

Yes. This is possible and can be used, for example, for partial payments.

Can an Aggregate Identifier be decoded?

Yes. KSeF allows users with the appropriate permissions to determine which invoice KSeF numbers are included in a specific Aggregate Identifier.

Who can generate an Aggregate Identifier?

An Aggregate Identifier may be generated by an entity with the appropriate rights to access the invoices. This may include the issuer or the recipient of the invoices.

From when will the KSeF number or Aggregate Identifier need to be included in payment references?

The relevant requirements will apply to payments made from 1 January 2027.

Does Retcon support the KSeF Aggregate Identifier in AX 2012?

Yes. Retcon’s solution for Microsoft Dynamics AX 2012 supports the use of the Aggregate Identifier in outgoing and incoming payment processes and integrates AX 2012 with KSeF communication.

KSeF Aggregate Identifier support in Microsoft Dynamics AX 2012

Implementing KSeF does not end with sending sales invoices and receiving purchase invoices.

From 1 January 2027, the KSeF number and the Aggregate Identifier will also become directly relevant to payment processes.

For organisations still using Microsoft Dynamics AX 2012, this means extending the system with mechanisms that enable KSeF data to be used in payments and settlements.

Retcon’s AX 2012 solution supports the Aggregate Identifier in both purchase and sales processes, integrating KSeF communication with financial processes carried out in the ERP system.

‍

Sources

Polish Ministry of Finance – “KSeF number and Aggregate Identifier”
Official information on the rules for generating, structuring and using the Aggregate Identifier.

Polish Ministry of Finance – “KSeF 2.0 Manual, Part III – Additional KSeF functionalities”
Detailed rules for generating the Aggregate Identifier, limits and example payment scenarios.

Official KSeF 2.0 API documentation
Technical documentation covering communication with the National e-Invoice System.

‍

‍

https://www.retcon.pl/contact

‍