FinchContext
Run with

Build Poland JPK_V7M XML (SAF-T VAT)

Skill: Convert VAT records + return figures into a JPK_V7M XML

Region: Poland (Polska) Category: JPK — Jednolity Plik Kontrolny (SAF-T) Does: Takes a month's sales and purchase VAT records plus the computed VAT-return figures and emits a valid JPK_V7M XML — the combined VAT records + declaration file that VAT-registered taxpayers send monthly to the Ministerstwo Finansów (KAS) gateway. Schema: JPK_VAT z deklaracją, kodSystemowy="JPK_V7M (2)", wersjaSchemy="1-0E" (monthly). The quarterly variant is JPK_V7K (records every month, declaration only in the last month of the quarter).

This is a conversion task: input = your VAT registers and return totals, output = JPK_V7M XML. The element names below are the mapping target. Field codes (P_*, K_*), GTU groups, and procedure markers are revised periodically — always validate the emitted XML against the current official XSD from the Ministerstwo Finansów before sending.


When JPK_V7M is required


Input data required

Group Fields
Header tax-office code, year, month, purpose (original/correction), system name, generation timestamp
Entity (Podmiot1) NIP, full name, email (+ optional phone)
Declaration (Deklaracja) the P_* return positions — output base/VAT, input VAT, amount payable or excess
Sales records (SprzedazWiersz) per document: counterparty NIP + name, document number, issue/sale dates, doc type, GTU + procedure markers, net/VAT amounts by rate (K_*)
Sales control (SprzedazCtrl) number of sales rows, total output VAT
Purchase records (ZakupWiersz) per document: supplier NIP + name, document number, purchase/receipt dates, input net + VAT (K_*), markers
Purchase control (ZakupCtrl) number of purchase rows, total input VAT

Document structure

JPK
├─ Naglowek            KodFormularza(JPK_VAT), WariantFormularza=2, DataWytworzeniaJPK,
│                      NazwaSystemu, CelZlozenia, KodUrzedu, Rok, Miesiac
├─ Podmiot1 rola="Podatnik"
│   └─ OsobaNiefizyczna  NIP, PelnaNazwa   (or OsobaFizyczna for sole traders)
│   └─ (Email, Telefon)
├─ Deklaracja
│   ├─ Naglowek         KodFormularzaDekl(VAT-7), WariantFormularzaDekl=22
│   ├─ PozycjeSzczegolowe   P_10 … P_68 (only non-zero positions are emitted)
│   └─ Pouczenia = 1
└─ Ewidencja
    ├─ SprzedazWiersz[]    one per output document
    ├─ SprzedazCtrl        LiczbaWierszySprzedazy, PodatekNalezny
    ├─ ZakupWiersz[]       one per input document
    └─ ZakupCtrl           LiczbaWierszyZakupow, PodatekNaliczony

Field rules and code tables

Header (Naglowek)

Entity (Podmiot1)

Declaration positions (PozycjeSzczegolowe) — most-used

Position Meaning
P_19 / P_20 net base / VAT due on 23% (22%) domestic sales
P_17 / P_18 net base / VAT due on 8% (7%) sales
P_15 / P_16 net base / VAT due on 5% sales
P_13 net base of 0% sales
P_37 total taxable base (sum of bases)
P_38 total output VAT (podatek należny)
P_42 / P_43 net / input VAT on fixed-asset purchases
P_44 / P_45 net / input VAT on other purchases
P_48 total input VAT (podatek naliczony)
P_51 amount of VAT to pay (kwota do zapłaty)
P_53 excess of input over output VAT
P_54 amount to refund

Sales row (SprzedazWiersz)

Purchase row (ZakupWiersz)

Control sums


Calculation rules


Worked example — one 23% sale, one 23% purchase (June 2026)

Records

<?xml version="1.0" encoding="UTF-8"?>
<JPK xmlns="http://crd.gov.pl/wzor/2021/12/27/11148/"
     xmlns:tns="http://crd.gov.pl/wzor/2021/12/27/11148/">
  <Naglowek>
    <KodFormularza kodSystemowy="JPK_V7M (2)" wersjaSchemy="1-0E">JPK_VAT</KodFormularza>
    <WariantFormularza>2</WariantFormularza>
    <DataWytworzeniaJPK>2026-07-05T09:00:00Z</DataWytworzeniaJPK>
    <NazwaSystemu>ERP 1.0</NazwaSystemu>
    <CelZlozenia poz="P_7">1</CelZlozenia>
    <KodUrzedu>1471</KodUrzedu>
    <Rok>2026</Rok>
    <Miesiac>6</Miesiac>
  </Naglowek>

  <Podmiot1 rola="Podatnik">
    <OsobaNiefizyczna>
      <NIP>1234567890</NIP>
      <PelnaNazwa>Przyklad Sp. z o.o.</PelnaNazwa>
    </OsobaNiefizyczna>
  </Podmiot1>

  <Deklaracja>
    <Naglowek>
      <KodFormularzaDekl kodSystemowy="VAT-7 (22)" kodPodatku="VAT"
        rodzajZobowiazania="Z" wersjaSchemy="1-0E">VAT-7</KodFormularzaDekl>
      <WariantFormularzaDekl>22</WariantFormularzaDekl>
    </Naglowek>
    <PozycjeSzczegolowe>
      <P_19>10000</P_19>
      <P_20>2300</P_20>
      <P_37>10000</P_37>
      <P_38>2300</P_38>
      <P_44>4000</P_44>
      <P_45>920</P_45>
      <P_48>920</P_48>
      <P_51>1380</P_51>
    </PozycjeSzczegolowe>
    <Pouczenia>1</Pouczenia>
  </Deklaracja>

  <Ewidencja>
    <SprzedazWiersz>
      <LpSprzedazy>1</LpSprzedazy>
      <NrKontrahenta>5252445767</NrKontrahenta>
      <NazwaKontrahenta>Klient S.A.</NazwaKontrahenta>
      <DowodSprzedazy>FV/2026/06/001</DowodSprzedazy>
      <DataWystawienia>2026-06-10</DataWystawienia>
      <DataSprzedazy>2026-06-10</DataSprzedazy>
      <K_19>10000.00</K_19>
      <K_20>2300.00</K_20>
    </SprzedazWiersz>
    <SprzedazCtrl>
      <LiczbaWierszySprzedazy>1</LiczbaWierszySprzedazy>
      <PodatekNalezny>2300.00</PodatekNalezny>
    </SprzedazCtrl>

    <ZakupWiersz>
      <LpZakupu>1</LpZakupu>
      <NrDostawcy>7010001234</NrDostawcy>
      <NazwaDostawcy>Dostawca Sp. z o.o.</NazwaDostawcy>
      <DowodZakupu>Z/77</DowodZakupu>
      <DataZakupu>2026-06-15</DataZakupu>
      <K_42>4000.00</K_42>
      <K_43>920.00</K_43>
    </ZakupWiersz>
    <ZakupCtrl>
      <LiczbaWierszyZakupow>1</LiczbaWierszyZakupow>
      <PodatekNaliczony>920.00</PodatekNaliczony>
    </ZakupCtrl>
  </Ewidencja>
</JPK>

Validation checklist


Last updated: 2026-06-07 — verify the field names, the JPK_V7M(2) schema version, GTU/procedure markers, and declaration field ranges against the current Ministerstwo Finansów / KAS JPK_V7M XSD before use.