Tax integration case study

ERP and CRM Integration with KSeF - MPED KSeF Gateway Platform

A middleware layer connects ERP and CRM systems with KSeF, automating validation, asynchronous invoice submission, status handling and UPO archiving.

Project at a glance

Platform
MPED KSeF Gateway
Source systems
ERP and CRM
Architecture
Azure and asynchronous processing
Scope
Submission, statuses, KSeF identifiers and UPO

Regulatory context

Challenge

The introduction of the Polish National e-Invoicing System (KSeF) requires companies to adapt ERP and CRM systems to new electronic invoicing regulations. Most business platforms were not designed for direct integration with an asynchronous government system. Key issues include asynchronous communication, duplicate prevention, document and KSeF identifier tracking, UPO retrieval and archiving, security, regulatory compliance and enterprise-grade operational stability. A stable middleware layer was needed to separate business systems from the external state platform.

Delivery response

Solution

MPED designed and implemented MPED KSeF Gateway as a middleware layer between ERP/CRM systems and KSeF. Its consistent API accepts invoices, assigns correlation identifiers, queues documents, processes them asynchronously, submits them to KSeF, monitors status and stores UPO confirmations and KSeF identifiers. The platform supports both widely used business systems and custom client platforms.

From invoice to UPO

Platform functionality

MPED KSeF Gateway provides complete, secure and auditable electronic-invoice processing in a multi-tenant model.

  • Receiving invoices from ERP and CRM systems via API.
  • Validating input data.
  • Duplicate control through idempotency.
  • Queueing documents for asynchronous processing.
  • Sending invoices to KSeF.
  • Assigning and storing correlation identifiers for each invoice.
  • Checking invoice status in KSeF.
  • Retrieving the KSeF number and processing details.
  • Automatic retrieval and archiving of UPO.
  • API endpoints for status checks and UPO download.
  • Handling incoming invoices from KSeF in pull mode.
  • Storing technical artefacts and audit data.
  • Resilience through retry, throttling, circuit breaker and DLQ mechanisms.
  • System monitoring, health checks and operational alerting.
  • Secure secret management with Key Vault and Managed Identity.
  • Redaction of sensitive data in logs.
  • Multi-tenant deployments and environment isolation per client.
  • Replay capability and process recovery after failure.

Integration readiness

Connectors and integrations

MPED prepared integration capabilities for widely used platforms and also delivers connections to custom ERP and CRM systems.

Standard and custom systems
  • HubSpot
  • Microsoft Dynamics
  • NetSuite
  • SAP
  • Xero
  • QuickBooks

KSeF in context

Official e-invoicing system introduction

The official GOV video introduces the KSeF context, accompanied by the visual identity of the Polish National e-Invoicing System.

KSeF logo

Platform detail

Technology stack

The Azure architecture separates the synchronous API layer from scalable background document processing.

E-invoicing process impact

Results

  • Structured ERP/CRM integration process with KSeF.
  • Automated invoice submission and document status handling.
  • Full traceability of the invoicing process.
  • Elimination of duplicate invoice submissions.
  • Increased stability through asynchronous processing.
  • A central integration platform reusable across multiple clients and ERP systems.

Summary

A controlled e-invoice path from business systems to KSeF

MPED KSeF Gateway automates invoice receipt, data validation, document queueing, KSeF submission, status tracking and UPO retrieval and archiving. Its Azure Functions, Service Bus and Azure Storage architecture provides scalability and resilience during high load or temporary KSeF unavailability. Idempotency, retry, DLQ, secure secret management and multi-tenant deployment make the solution ready for enterprise environments and multiple ERP and CRM systems.