Is your organization ready to process mass payments in KSeF?
Mass payments in KSeF are becoming increasingly important in the context of ERP system integration. As ERP systems adapt to the new landscape of electronic invoicing, one of the main challenges is effective integration with the National e-Invoicing System (KSeF) – especially when it comes to handling mass payments.
For companies using SAP or legacy systems, implementing this functionality requires not only technical knowledge of integration but also an understanding of the new model for processing accounting data.
In this article, we provide a comprehensive overview of handling collective payments within the KSeF framework, with a focus on SAP integration. We explain how the collective identifier works, which interfaces are required, the most common errors, and how to avoid them. We also share our experience in implementing such processes – both within SAP environments and beyond.
What are Mass Payments in KSeF?
Mass payments are a mechanism that allows for making a single transfer to cover multiple invoices. In the KSeF environment, this process requires assigning a unique collective payment identifier (known as the collective identifier), which allows a payment to be clearly linked to specific documents in the e-invoicing system.
How Does It Work?
The process can be broken down into a few steps:
- Selecting multiple invoices eligible for a joint payment.
- Generating a collective identifier (e.g., in SAP or another ERP system).
- Using this identifier in the title of the bank transfer.
- The ability to “decode” the collective identifier – i.e., determining which invoices were included in the payment.
KSeF enables linking this identifier to invoices registered in the system. As a result, both accounting systems and audit institutions have easy access to complete payment information.
Integration of Collective Payments with SAP – Challenges and Best Practices
SAP System Structure
As an ERP-class system, SAP offers a variety of integration options – from file-based interfaces and IDocs to modern REST APIs. However, implementing mass payments with KSeF requires specific adjustments:
- Selecting invoices for a mass payment – requires implementing grouping logic for documents within SAP transactions (e.g., in the FI module).
- Generating the collective identifier – typically implemented as an extension of existing functions, with the ability to store data in custom Z* tables.
- Sending and receiving identifiers from KSeF – requires using an API interface for communication with KSeF.
Technical Interfaces
Depending on the system architecture, different integration scenarios with KSeF are possible:
- REST API (HTTP) – recommended for direct SAP integration with the service communicating with KSeF (this is how we implement it in our product),
- WebService (SOAP) – an alternative for older integrations (available upon request),
- FI module extensions – used to mark invoices and retrieve identifiers.
Adapting to Organizational Needs
From a project perspective, it is crucial to:
- Consider existing SAP architecture – e.g., whether data is processed centrally or locally across units, whether all invoices flow from KSeF to SAP or via other interfaces,
- Ensure compliance with security policies – especially in the context of communication with external APIs,
- Provide API documentation and perform client testing – preferably via environments such as Swagger or Postman.
Mass Payments in KSeF. Common Mistakes in Implementing Mass Payment Integration with KSeF for SAP
Despite available technologies, many implementations encounter the same issues. Here are the most common:
1. Lack of logical connection between payment and invoices
If the collective identifier is not clearly linked to invoices in the ERP system, automatic bank statement processing becomes problematic.
2. Incorrect data format sent to KSeF
Especially at the start, API compliance is crucial. Many KSeF error messages are not clearly descriptive.
Recommendation: Use the latest documentation from the Ministry of Finance and tools for validating data structure (e.g., XSD + online validators).
3. Inadequate integration testing
Integration with KSeF is not just a technical connection but also requires understanding the business context of invoices.
Recommendation: Test on anonymized production data and create test scenarios using different invoice types.
4. Ignoring KSeF offline compliance (fallback mode)
As of KSeF version 2.0, it is essential to account for fallback scenarios (e.g., “offline24” mode).
Recommendation: Implement buffering and deferred sending mechanisms, including retrieval of collective identifiers.
What About Integration with Legacy Systems and Non-SAP Platforms?
For organizations not using SAP, the challenges are different – but just as important. In practice, we most often encounter needs such as:
- CSV / TAB-separated files – used in older accounting systems,
- Flat or block files – common in mainframe and dedicated environments,
- Manual data loading and export – e.g., via dedicated apps or integration tools.
In such cases, we offer adapters and converters that enable generating collective identifiers and synchronizing data with KSeF, without requiring a full ERP system overhaul.
Why Are Mass Payments Important?
For many organizations processing a large number of monthly invoices, mass payments in KSeF offer:
- Time savings – eliminates the need for multiple individual transfers,
- Easier automated accounting – one transfer = one bank operation,
- Data consistency – easy matching of payments to multiple documents in the ERP system.
In the KSeF context, where each invoice must be recorded and linked to a payment, the collective identifier becomes a key functionality.
Why Implement Mass Payments Support in KSeF?
Implementing mass payments integrated with KSeF is not just a legal requirement, but primarily an opportunity to:
- Automate accounting processes,
- Reduce errors in settlements,
- Improve transparency in cash flow,
- Ensure full compliance with Ministry of Finance requirements.
Leverage Haergi Experts’ Knowledge
If your company is facing the challenge of integrating KSeF with SAP or another ERP system – we are here to help. We have experience in implementations in large SAP environments as well as in adapting legacy systems to e-invoicing requirements.
Contact us for a free consultation and a tailored integration architecture proposal for your system.