Poland · ERP and accounts-payable controls

KSeF duplicate-invoice and duplicate-payment prevention controls

Prevent duplicate KSeF sends, ERP postings and supplier payments with invoice hashes, KSeF numbers, retry controls, matching and exception evidence.

Quick verdict:
  • Four separate risks require four controls: resend, double billing, repeated posting and repeated settlement.
  • The most dangerous state is an unconfirmed submission followed by an automatic replay.
  • First, make final-XML hashing and atomic pre-send locking mandatory in the outbound connector.
Last checked: 6 August 2026Based on official sourcesClear summaryBusiness guidance, not legal advice
Official sources prioritized
Last-checked dates visible
Free checker, no signup required

What you need to know

Guide

Separate the four duplicate failure modes

Official fact: KSeF acceptance gives an invoice a unique KSeF number; that does not prove the underlying commercial event is unique or unpaid. Distinguish four failures: the same XML is transmitted twice; separate invoices for one event are both accepted; one KSeF invoice is ingested twice; or one liability is paid twice. Integration owns transmission identity, billing owns commercial documents, AP owns postings, and treasury owns payments. Recommended control: classify every alert before remediation and preserve both records. A monthly control should report counts by category, owner, ageing and financial exposure, with 100% of high-value alerts assigned within one business day. The principal risk is treating a KSeF number as an all-purpose duplicate-payment guarantee.

Guide

Recommended control: outbound idempotency and a pre-send lock

Create an immutable outbound idempotency key from the issuing entity, ERP document ID and document version, and calculate SHA-256 over the final original FA(3) XML. Before any send, atomically lock that key and store the XML hash, byte size, P_2 seller invoice number, payload version, timestamp and submitting service. Reject a second job with the same key unless an authorised operator has resolved the first state. Enforce a unique database constraint rather than a queue flag. If two workers pick FV/1042 simultaneously, one obtains the lock and the other records a suppressed attempt. Acceptance criterion: 10,000 concurrent replay tests produce one KSeF submission per key, zero hash changes after lock, and a complete actor-and-time audit trail. This is an ERP recommendation, not a statutory KSeF rule.

Guide

Official flow, recommended state machine: status before retry

Official fact: interactive sending is asynchronous. POST /sessions/online/{referenceNumber}/invoices returns a document referenceNumber, not immediate proof of acceptance; the client must check processing status and retrieve the UPO. The request carries the original XML SHA-256 hash and size plus encrypted-document metadata. Therefore an HTTP timeout or lost response never means rejection. Recommended states are READY, SUBMITTING, SUBMITTED_UNKNOWN, PROCESSING, ACCEPTED, REJECTED_REPAIRABLE and MANUAL_REVIEW. Persist the session and document references before further work, poll with bounded backoff, and allow retry only after a conclusive rejection or a documented reconciliation showing no accepted document. Integration support owns unknown states. Test by cutting the connection after submission: the system must recover status without a blind resend; 100% of simulated timeouts must end in reconciled evidence or a blocked exception.

Guide

Evidence model: never merge hash, references, UPO and invoice numbers

Official fact: the KSeF number is assigned automatically only after acceptance, appears in the UPO and differs from the seller's invoice number in FA(3) field P_2. The document referenceNumber tracks asynchronous processing; the original invoiceHash identifies exact source XML. Official batch guidance recommends calculating and retaining each original XML invoiceHash so returned statuses can be correlated unambiguously. Store separately: ERP ID/version, P_2, original XML hash and size, applicable encrypted hash and size, session and document references, status history, KSeF number, UPO location and timestamps. Security owns retention and access; integration owns completeness. Acceptance criterion: an auditor can select any accepted invoice and reproduce its source-to-UPO chain within five minutes, while uniqueness checks prevent one KSeF number from attaching to two local documents.

Guide

Recommended control: inbound AP deduplication and matching

KSeF does not perform the buyer's duplicate-ingestion or duplicate-payment checks. On receipt, AP should first enforce uniqueness on KSeF number, then compare supplier tax ID, P_2, issue date, currency, gross amount and structured line details. Use the XML hash as supporting evidence, not as the only business-duplicate key: two XML files can differ yet bill the same delivery. Match the invoice to purchase order, goods receipt or service acceptance, and supplier master data; place unmatched or suspicious items on payment hold. Example: the connector replays one accepted document under a new import batch. The KSeF-number constraint blocks a second posting and links the replay to the original journal entry. AP systems owner is accountable. Measure 100% KSeF-number uniqueness, zero auto-postings when three-way-match tolerances fail, false-positive rate, queue age and duplicate value prevented.

Guide

Recommended payment-run controls and the 2027 reference change

Official fact: from 1 January 2027, active VAT taxpayers making covered transfers for structured invoices generally must include the KSeF number for one invoice or a KSeF aggregate identifier for several; the aggregate identifier can be decoded to its KSeF-number list. Confirm scope and exceptions with an adviser. Recommended controls: build the payment proposal from approved, unblocked ERP liabilities; deduplicate bank account, supplier, amount, due date and underlying KSeF-number set; require maker-checker approval; and mark the liability paid atomically with payment-file creation. Validate that every aggregate identifier resolves to exactly the invoices in the payment batch and that no KSeF number is already in a released file. Treasury owns release, AP owns holds, tax owns interpretation. Acceptance criterion: duplicate-file replay and overlapping aggregate-set tests are blocked, with 100% reference coverage for in-scope payments.

Guide

Corrections and exceptions: investigate, hold and link

Official fact: an FA(3) correction invoice references the original invoice's KSeF number. Never delete an accepted invoice or overwrite its identifiers. Recommended workflow: freeze payment where appropriate, preserve both accepted documents, determine whether the issue is transmission, ingestion or a genuine second commercial invoice, and obtain accounting or tax advice on the legally appropriate correction. Example: supplier Alpha issues INV-88 twice from separate source records; both XML documents are accepted and receive different KSeF numbers, but they concern one delivery. AP links both to the same purchase order, blocks both from automatic payment, requests clarification, and posts the valid document plus the correctly issued correction when confirmed. AP owns the case, procurement confirms receipt, and tax/accounting approves treatment. Close only when linked evidence, rationale, approver and payment disposition are complete.

Guide

Acceptance test pack and measurable evidence

Run production-like tests before go-live and after connector changes. Include concurrent duplicate sends, timeout after KSeF receipt, delayed processing, explicit rejection followed by corrected XML, status-poll failure, replayed inbound message, same supplier/P_2 with changed amount, different KSeF numbers for one purchase, correction linking, duplicate payment-file creation and aggregate-identifier overlap. For each test retain input XML, hashes, API timestamps and references, state transitions, UPO or rejection evidence, ERP journals, holds, approvals and bank-file outcome. The test manager owns sign-off; integration, AP and treasury own defects in their domains. Release criteria should be zero blind retries, zero duplicate accepted submissions caused by the test harness, 100% identifier-field separation, 100% duplicate payment attempts blocked, and all critical exceptions routed within 15 minutes. Reconcile daily accepted KSeF records to ERP postings and unresolved outbound states.

Guide

Supplier decision criteria, common mistakes and next actions

Assess software on demonstrated controls, not a claim that it is 'KSeF compliant'. Require atomic idempotency, durable asynchronous states, separate identifier fields, UPO retrieval, inbound uniqueness constraints, configurable matching, payment holds, aggregate-reference support, searchable audit evidence and named support SLAs. Common mistakes are assuming a timeout is rejection, blindly retrying, equating P_2 with the KSeF number, hashing a pre-final XML, auto-paying merely because KSeF accepted the invoice, and deleting an accepted duplicate. Require shortlisted suppliers to run the acceptance pack with your data and price exception handling, storage and monitoring. Name integration, AP, treasury and tax owners; baseline duplicate rates and queue age; then pilot one entity. This is practical information, not legal or tax advice.

Guide

Practical question summary

For KSeF duplicate-invoice and duplicate-payment prevention: Most KSeF questions are about who must use the system, whether current accounting software is ready, how authentication works, how corrections are handled, whether ecommerce or ERP needs API integration, and how accountants access invoice data. This guide focuses on those operational decisions.

Guide

Decision framework for businesses

For KSeF duplicate-invoice and duplicate-payment prevention: A KSeF-ready workflow should show who creates invoices, who submits them, who monitors status, who handles rejection or correction, how invoices are archived and how the accountant sees the records.

Guide

How to use this guide

Use this guide to decide whether KSeF duplicate-invoice and duplicate-payment prevention affects your Poland workflow and which evidence is still missing. Start with KSeF authentication, structured invoice submission, invoice status handling, then test submit a KSeF invoice and simulate an API rejection before comparing software.

Guide

Data and terms to prepare

For KSeF duplicate-invoice and duplicate-payment prevention, the important terms are KSeF duplicate-invoice and duplicate-payment prevention, Poland, KSeF authentication, structured invoice submission, invoice status handling, corrections and rejections, accounting or ecommerce integration. Clean these fields in customer, supplier, tax and accounting records before rollout; otherwise validation and support issues appear during daily invoicing.

Guide

Software proof to request

For KSeF duplicate-invoice and duplicate-payment prevention, ask vendors to show show KSeF authentication, submission status, corrections, permissions and accounting export using your examples. The demo should cover submit a KSeF invoice, simulate an API rejection, create a correction, verify user permissions and explain who handles errors, corrections, archive access and accountant handoff for KSeF authentication, structured invoice submission, invoice status handling.

Guide

Evidence before rollout

Keep official links, screenshots, test invoices and the decision reason for KSeF duplicate-invoice and duplicate-payment prevention. For KSeF duplicate-invoice and duplicate-payment prevention, the implementation file should prove how KSeF authentication, structured invoice submission, invoice status handling, corrections and rejections were checked, not just that a tool was selected.

Guide

Decision checkpoint

Do not close KSeF duplicate-invoice and duplicate-payment prevention until someone can explain KSeF duplicate-invoice and duplicate-payment prevention in Poland, name the workflow owner, show one tested invoice scenario and describe how the team avoids choosing software for Poland before proving the real KSeF duplicate-invoice and duplicate-payment prevention workflow.

Checklist

Define and report the four duplicate categories with named integration, billing, AP and treasury owners.

Generate an immutable outbound idempotency key and atomically lock each ERP document version before sending.

Calculate and retain the SHA-256 invoiceHash and byte size of the final original FA(3) XML.

Persist session and document referenceNumber values, then reconcile status and UPO before any retry decision.

Store P_2, KSeF number, invoiceHash, API references and UPO evidence in separate immutable fields.

Enforce inbound KSeF-number uniqueness and match supplier, amount, currency, lines, order and receipt.

Place ambiguous invoices on payment hold and route them to an ageing-controlled exception queue.

Block repeated payment files and overlapping KSeF-number or aggregate-identifier payment sets.

Test timeouts, replays, corrections, two accepted invoices for one purchase and duplicate bank-file release.

Reconcile accepted KSeF invoices, ERP postings, open exceptions and payments daily with retained evidence.

FAQ

Can KSeF accept the same invoice twice?

KSeF assigns a unique number to each accepted invoice, but businesses should not treat that as an ERP idempotency control. If the same XML may have been resent, reconcile the invoiceHash, document referenceNumber, status, KSeF number and UPO before acting. Preserve every accepted record and obtain advice on any required correction.

Does KSeF prevent duplicate supplier payments?

No. KSeF acceptance and numbering do not establish that an invoice was posted or paid only once. The buyer still needs inbound uniqueness, commercial matching, approval, payment holds, maker-checker release and bank-file replay controls. KSeF identifiers strengthen the evidence and payment reference, but AP and treasury controls prevent duplicate disbursement.

Which identifiers should the ERP store?

Store the local ERP ID and version, P_2, original XML SHA-256 hash and size, encryption metadata where applicable, session reference, document referenceNumber, full status history, KSeF number and UPO evidence in distinct fields. Do not collapse them into one 'invoice number' because they represent different objects and lifecycle stages.

When is it safe to retry a KSeF submission?

Retry only after status reconciliation. A timeout is inconclusive, and the document may already be processing or accepted. Query using the saved references, inspect status and recover the UPO. A new send should follow only a conclusive rejection or a controlled, documented finding that no accepted submission exists; unknown cases belong in manual review.

How should AP match incoming KSeF invoices?

Start with a unique KSeF-number check, then compare supplier tax ID, P_2, dates, currency, totals and lines. Match purchase invoices to the order, receipt or service acceptance and supplier master. Use invoiceHash to identify exact XML, while recognising that different hashes can still describe the same commercial event.

What if two KSeF numbers represent one purchase?

Hold payment and preserve both invoices. Link them to the purchase evidence, ask the supplier to clarify which document is valid, and involve accounting or tax advisers in determining the lawful correction. Do not merge identifiers, delete either accepted invoice or select one for payment merely because it arrived first.

How are correction invoices handled in FA(3)?

An FA(3) correction invoice references the original invoice's KSeF number. Your ERP should maintain that relationship, retain both UPO trails and reflect the approved accounting effect without overwriting the original. Validate supplier, amounts and reason, and use the legally appropriate process confirmed by your accountant or tax adviser.

How should the 2027 payment reference be controlled?

For covered transfers from 1 January 2027, active VAT taxpayers generally use one KSeF number or an aggregate identifier for several structured invoices. Validate applicability professionally, decode aggregate identifiers to their KSeF-number lists, compare that list with approved liabilities, and block missing, extra, repeated or already-released invoice references before payment-file approval.

What do businesses usually ask about KSeF?

For KSeF duplicate-invoice and duplicate-payment prevention: They ask about software readiness, API integration, authentication, corrections, accountant access and ecommerce workflows.

What is the most practical KSeF risk?

For KSeF duplicate-invoice and duplicate-payment prevention: The practical risk is late discovery that permissions, corrections or invoice status handling do not match the business process.

What should I test first for KSeF duplicate-invoice and duplicate-payment prevention?

For KSeF duplicate-invoice and duplicate-payment prevention, start with submit a KSeF invoice, simulate an API rejection, create a correction because those scenarios reveal whether the workflow is practical.

What is the main risk for KSeF duplicate-invoice and duplicate-payment prevention?

The main risk is choosing software for Poland before proving the real KSeF duplicate-invoice and duplicate-payment prevention workflow.

Key regulations, formats and terms

PolandKSeFKrajowy System e-FakturPolish Ministry of Financepodatki.gov.plstructured invoiceAPI authenticationinvoice correctionsaccounting softwareVATSMEecommerceEuropean CommissioneInvoicingEN 16931Directive 2014/55/EUstructured electronic invoiceVAT automationcross-border tradeKSeF duplicate-invoice and duplicate-payment prevention

Poland — Country hub

Continue reading

Official sources

We prioritize official government and EU sources where available and keep last-checked dates visible for mandate-sensitive pages.