Build the ZUS Settlement Envelope (KEDU XML)
Skill: Assemble payroll documents into a consolidated ZUS KEDU submission
Region: Poland (Polska) Category: Social security — Ubezpieczenia społeczne (ZUS) Does: Takes the individual ZUS documents produced from payroll (DRA, RCA, RSA) and registration documents (ZUA, ZWUA, ZZA) and wraps them in a single KEDU XML — the parent submission unit (Kompleksowy Elektroniczny Dokument Ubezpieczeniowy) that employers (płatnicy składek) transmit through Płatnik / ePłatnik (PUE/eZUS) to ZUS. Spec: ZUS KEDU XML wrapper / interchange document (current Płatnik version; document templates revised May 2025)
KEDU is not a form but the transport envelope: one KEDU file carries an ordered set of insurance documents for a payer, all sharing the same payer identity. This skill focuses on the wrapper — how DRA/RCA/RSA and the registration documents nest inside it, the payer-block consistency, and document ordering — and defers the per-document content to
build-zus-dra-rca-xmlandbuild-zus-rsa-zua-xml. Element names follow the KEDU/Płatnik structures, not a verbatim XSD.
When this applies
- Any time a płatnik składek submits insurance documents to ZUS: a monthly settlement run (DRA + RCA [+ RSA]), an ad-hoc registration batch (ZUA/ZWUA/ZZA), or a correction set — each is packaged as one KEDU.
- A KEDU may mix settlement and registration documents for the same payer, but the payer block must be identical across all contained documents.
Structure (KEDU → nested documents)
KEDU
Header producer/program ID + version, creation timestamp, document count
Płatnik NIP, REGON, ZUS payer ID, name (one identity for the whole file)
Documents ordered list, each with an internal document number:
ZUA registration to insurance (see build-zus-rsa-zua-xml)
ZWUA deregistration (with cessation reason code)
ZZA registration to health insurance only
DRA settlement declaration — one per payer per period (see build-zus-dra-rca-xml)
RCA per-insured contribution report (rolls up into DRA)
RSA per-insured benefits/breaks report (reduces RCA base)
Trailer totals / document checksum
Data rules
- Single payer per KEDU — every nested document repeats the same NIP/REGON/payer ID; mismatches are rejected by Płatlik validation.
- Document ordering & numbering — each document carries a sequential identifier within the file; the DRA references the RCA/RSA set for the same period.
- Reconciliation — DRA totals must equal the sum of the RCA contributions (per fund), and RSA break days must match the reduced bases on the RCA (see the linked skills).
- Template versioning — DRA/RCA/RSA/ZUA/ZWUA/ZZA each follow their current ZUS template (revised May 2025); the KEDU header declares the producing program and version, which Płatnik enforces.
- A KEDU is either original or correction; corrections carry the correction identifier on the affected documents.
Worked example (outline)
KEDU (płatnik NIP 1234567890, REGON ..., 4 documents)
doc 01 ZUA new hire PESEL 90010112345, title 011000, from 2025-06-01
doc 02 RCA same insured — June contributions
doc 03 RSA same insured — sick-pay break 2025-06-10..16
doc 04 DRA payer summary June 2025 = Σ RCA
Emitted as one KEDU XML and submitted via Płatnik/ePłatnik (PUE/eZUS) to ZUS; the contained documents reconcile internally.
Validation checklist
- Current KEDU/Płatnik version declared in the header; document count matches
- One payer identity (NIP/REGON/payer ID) repeated identically across all documents
- Documents numbered/ordered; DRA references its RCA/RSA set for the period
- DRA totals reconcile to Σ RCA per fund; RSA breaks reconcile to RCA bases
- Each nested document uses its current template (revised May 2025)
- Original vs correction set marked correctly
- Submitted via Płatnik/ePłatnik (PUE/eZUS) by the payer's deadline
Last updated: 2026-06-04 — confirm the current KEDU/Płatnik schema and the DRA/RCA/RSA/ZUA/ZWUA/ZZA template versions (revised May 2025) and deadlines against current ZUS (zus.pl) guidance before use.