errorcountryPOLKSeF

KSEF-005:KSeF VAT rate invalid — StawkaPodatku not in the Ministry of Finance dictionary

Fix: Map every line's tax treatment to an allowed KSeF value before serialising: numeric rates to 23/8/5/0, exemptions to zw, out-of-scope to np, reverse charge to the dedicated markers, then make sure each line's net and VAT amounts roll up into the matching P_13_x / P_14_x group. The numeric-rate-to-dictionary mapping is largely deterministic and Invoice Navigator can apply it, but exemptions and reverse-charge classifications are a tax decision and are surfaced for confirmation. Pair an exemption with its legal basis (P_19) where the schema requires it. Provide the required value in the free validator.

KSEF-005 is raised when a VAT rate or tax category on an FA(2)/FA(3) invoice does not match the values the KSeF schema and the Ministry of Finance dictionary allow. KSeF does not accept arbitrary percentages or free-text descriptions: each line's rate must map to an allowed value (currently 23%, 8%, 5%, 0%) or to one of the markers — zw (exempt), np (out of scope), and the reverse-charge handling — declared through P_12 and consistent with the document totals (P_13_x / P_14_x). A non-dictionary percentage, or a marker inconsistent with the amounts reported for that group, is rejected.

Severity
Fatal
Rule set
KSeF
Country
POL
Fix type
INPUT REQUIRED
Confidence
45%

Engine Classification

Business data required · Explicit input workflow · No assumptions made

What is KSEF-005?

KSEF-005 is a fatal validation rule defined in the KSeF specification (POL national rules). It validates the np. (3) A marker that does not match the amounts (a zw line whose value is added to the 23% totals). (4) Reverse-charge scenarios with mismatched markers. KSeF validates the rate against the dictionary and cross-checks the per-rate totals. element under out-of-scope lines sent with numeric 0 instead of zw in the UBL invoice XML.

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

Target path: The rate must line up with both the dictionary and the per-rate totals. Triggers: (1) a foreign VAT percentage (19%, 20%, 7%) from a non-Polish tax code written into P_12. (2) Exempt/out-of-scope lines sent with numeric 0 instead of zw/np. (3) A marker that does not match the amounts (a zw line whose value is added to the 23% totals). (4) Reverse-charge scenarios with mismatched markers. KSeF validates the rate against the dictionary and cross-checks the per-rate totals.

Why This Error Matters

KSeF cross-checks each line's VAT rate against the Ministry of Finance dictionary and the per-rate totals. A non-dictionary rate or a mismatched marker blocks the whole invoice.

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

Validator Behavior

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

How to Fix It

.

.

.

Before / After

Failing XML
<FaWiersz>
  <P_12>19</P_12>
</FaWiersz>
Corrected XML
<FaWiersz>
  <P_12>23</P_12>
</FaWiersz>

Technical Reference

XPathThe rate must line up with both the dictionary and the per-rate totals. Triggers: (1) a foreign VAT percentage (19%, 20%, 7%) from a non-Polish tax code written into P_12. (2) Exempt/out-of-scope lines sent with numeric 0 instead of zw/np. (3) A marker that does not match the amounts (a zw line whose value is added to the 23% totals). (4) Reverse-charge scenarios with mismatched markers. KSeF validates the rate against the dictionary and cross-checks the per-rate totals.
SpecKSeF

Code Example

P_12 must be a Ministry of Finance dictionary value (23, 8, 5, 0, zw, np or the reverse-charge handling). A foreign 19% rate is corrected to the Polish standard rate 23 and the line's amounts must reconcile with the P_13_1 / P_14_1 totals.

Common Causes

  • ·A foreign percentage in P_12, numeric 0 instead of zw/np, or a marker inconsistent with the P_13/P_14 totals.

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

Frequently Asked Questions

The dictionary values 23%, 8%, 5% and 0%, plus zw (exempt), np (out of scope) and the reverse-charge handling. Arbitrary percentages and free text are rejected.

Exempt and out-of-scope sales are not a 0% rate. They must use zw or np, and the line value must roll into the matching total bucket — a numeric 0 in place of zw causes a mismatch.

Where the schema requires it, yes — pair a zw line with its legal basis (P_19). A bare exemption marker without justification can still fail.

Only the safe part. Mapping a recognisable numeric rate to the dictionary value is deterministic; choosing between zw, np or a numeric rate is a VAT decision and is surfaced for confirmation. Confidence is 0.45.

KSeF cross-checks each line's rate against the totals grouped by rate (P_13_x net, P_14_x VAT). A mismatch between a line's marker and its bucket triggers KSEF-005 even when the rate itself is valid.

Related Errors

Related Content

Last updated: 16 June 2026

Share this guide:

Validate your invoice

Drop your XML here to check for KSEF-005

Fix KSEF-005 with guided input

Upload your invoice and we'll ask for the missing data, then apply a safe, auditable fix.