errorbusinessPLKSeF 2.0

KSEF-21181:Sellers are not identical for all invoices in a KSeF batch

Fix: Split the batch so that every invoice inside a single session belongs to one seller NIP.

The KSeF 2.0 API rejected a batch session because at least one invoice inside the batch has a Podmiot1 (issuer) NIP that differs from the others. KSeF requires every invoice in a single batch session to belong to the same seller.

Severity
Fatal
Rule set
KSeF 2.0
Country
PL
Fix type
BLOCKED
Confidence
0%

Engine Classification

Financial or legal field · Modification blocked by policy

Reason: Not fixable at XML level — the client must resubmit as separate batches. Invoice Navigator can detect the mixed-seller condition before submission and flag it.

What is KSEF-21181?

KSEF-21181 is a fatal validation rule defined in the KSeF 2.0 specification (PL national rules). It validates the batch when the aggregated invoice set contains more than one distinct issuer NIP. The API returns HTTP 400 with code 21181 and message "Nieprawidłowe żądanie eksportu faktur" or "Sprzedawcy nie są identyczni we wszystkich dostarczonych fakturach". No invoices in the batch are ingested — the entire batch is rejected atomically. element under sessions in the UBL invoice XML.

When this rule fires, the invoice is rejected by Peppol access points and never reaches the buyer.

Target path: Triggered on POST /sessions/batch when the aggregated invoice set contains more than one distinct issuer NIP. The API returns HTTP 400 with code 21181 and message "Nieprawidłowe żądanie eksportu faktur" or "Sprzedawcy nie są identyczni we wszystkich dostarczonych fakturach". No invoices in the batch are ingested — the entire batch is rejected atomically.

This error requires manual correction — financial fields are protected by policy.

Why This Error Matters

Multi-tenant ERP installations (accounting firms, group companies, shared-service centres) commonly aggregate invoices from several legal entities into a single export job. KSeF per-batch single-seller rule breaks that assumption. Getting this wrong at go-live means invoices for the entire client base fail together.

KSEF-21181 is a hard failure — the invoice must be corrected and re-sent before it can reach the recipient.

Blocks entire batches of invoices from being submitted. Critical for accounting firms and multi-company ERP installations.

Validator Behavior

  • ·Causes invoice rejection
  • ·Error returned: KSEF-21181
  • ·Specification: KSeF 2.0

How to Fix It

1.

2.

3.

4.

XML Example

Generic example based on the rule's target XPath. Your actual XML structure may differ.

Before
<!-- Triggers validation error -->
<batch when the aggregated invoice set contains more than one distinct issuer NIP. The API returns HTTP 400 with code 21181 and message "Nieprawidłowe żądanie eksportu faktur" or "Sprzedawcy nie są identyczni we wszystkich dostarczonych fakturach". No invoices in the batch are ingested — the entire batch is rejected atomically.></batch when the aggregated invoice set contains more than one distinct issuer NIP. The API returns HTTP 400 with code 21181 and message "Nieprawidłowe żądanie eksportu faktur" or "Sprzedawcy nie są identyczni we wszystkich dostarczonych fakturach". No invoices in the batch are ingested — the entire batch is rejected atomically.>
After
<!-- Corrected -->
<batch when the aggregated invoice set contains more than one distinct issuer NIP. The API returns HTTP 400 with code 21181 and message "Nieprawidłowe żądanie eksportu faktur" or "Sprzedawcy nie są identyczni we wszystkich dostarczonych fakturach". No invoices in the batch are ingested — the entire batch is rejected atomically.>VALID_VALUE</batch when the aggregated invoice set contains more than one distinct issuer NIP. The API returns HTTP 400 with code 21181 and message "Nieprawidłowe żądanie eksportu faktur" or "Sprzedawcy nie są identyczni we wszystkich dostarczonych fakturach". No invoices in the batch are ingested — the entire batch is rejected atomically.>

Technical Reference

XPathTriggered on POST /sessions/batch when the aggregated invoice set contains more than one distinct issuer NIP. The API returns HTTP 400 with code 21181 and message "Nieprawidłowe żądanie eksportu faktur" or "Sprzedawcy nie są identyczni we wszystkich dostarczonych fakturach". No invoices in the batch are ingested — the entire batch is rejected atomically.
SpecKSeF 2.0
Strategysplit-batch-by-seller

Common Causes

  • ·Accounting firm submits invoices from multiple client NIPs in one export job
  • ·Shared service centre batches subsidiaries together
  • ·ERP export incorrectly uses buyer NIP instead of seller NIP as the grouping key
  • ·Test data mixed with production data in a single batch

Seeing this in production? The API handles KSEF-21181 automatically. See the fix response →

Commonly Seen In

Comarch Optima (Biuro Rachunkowe)Symfonia (multi-company)SAP eDocument multi-company setupsCustom aggregators used by accounting firms

Frequently Asked Questions

No. KSeF 2.0 requires every invoice inside a single batch session to have the same seller (Podmiot1) NIP. Mixed batches are rejected with code 21181.

One batch per client NIP. You can run those batches in parallel with the same technical token, so throughput is not affected as long as your integration parallelises correctly.

No. The rule only checks the seller identifier. Buyer NIPs can vary freely within a single batch.

Yes — Invoice Navigator groups invoices by Podmiot1 NIP during pre-flight and blocks batches with mixed sellers so KSeF never sees a rejectable submission.

Related Errors

Related Content

Last updated: 7 July 2026

Share this guide:

Validate your invoice

Drop your XML here to check for KSEF-21181

Detect KSEF-21181 before submission

This error involves a financial field that can't be auto-modified. We'll flag it with a clear diagnosis so you can fix it at the source.