Beleq / Validator / KoSIT Error Codes / BR-DE-18
FATAL · BR-DE-18 XRechnung 3.0.2 Verified with KoSIT v1.6.3 (0-Error Fix) BT-115BT-20

How to Fix KoSIT Error BR-DE-18: Skonto Format Violation in BT-20

KoSIT 1.6.3 rejects the invoice due to incorrect Skonto formatting in BT-20. The regex requires uppercase, dot-decimal percentages, and a trailing #. Fix by replacing '2%#' with '2.00#'.

Official KoSIT v1.6.3 Schematron Message (EN16931 XRechnung (CII))
[BR-DE-18] Skonto Zeilen in rsm:CrossIndustryInvoice muessen diesem regulärem Ausdruck entsprechen: (^|\r?\n)#(SKONTO)#TAGE=([0-9]+#PROZENT=[0-9]+\.[0-9]{2})(#BASISBETRAG=-?[0-9]+\.[0-9]{2})?#$. Die Informationen zur Gewährung von Skonto müssen wie folgt im Element "Payment terms" (BT-20) übermittelt werden: Anzugeben ist im ersten Segment "SKONTO", im zweiten "TAGE=n", im dritten "PROZENT=n". Prozentzahlen sind ohne Vorzeichen sowie mit Punkt getrennt von zwei Nachkommastellen anzugeben. Liegt dem zu berechnenden Betrag nicht BT-115, "fälliger Betrag" zugrunde, sondern nur ein Teil des fälligen Betrags der Rechnung, ist der Grundwert zur Berechnung von Skonto als viertes Segment "BASISBETRAG=n" gemäß dem semantischen Datentypen Amount anzugeben. Jeder Eintrag beginnt mit einer #, die Segmente sind mit einer # getrennt und eine Zeile schließt mit einer # ab. Am Ende einer vollständigen Skontoangabe muss ein XML-konformer Zeilenumbruch folgen. Alle Angaben zur Gewährung von Skonto müssen in Großbuchstaben gemacht werden. Zusätzliches Whitespace (Leerzeichen, Tabulatoren oder Zeilenumbrüche) ist nicht zulässig. Andere Zeichen oder Texte als in den oberen Vorgaben genannt sind nicht zulässig.

1. Why KoSIT Validator v1.6.3 Rejects This Invoice

The official XPath test for BR-DE-18 enforces a strict regex pattern for Skonto lines in the <ram:Description> of BT-20. The regex (^|\r?\n)#(SKONTO)#TAGE=([0-9]+#PROZENT=[0-9]+\.[0-9]{2})(#BASISBETRAG=-?[0-9]+\.[0-9]{2})?#$ ensures correct formatting. Any deviation, such as using a percent sign instead of a dot-decimal format, or missing the trailing #, causes a fatal error. This applies to both CII and UBL-based XRechnung 3.0.2.

CII Context: /rsm:CrossIndustryInvoice
CII Schematron Test: every $line in rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradePaymentTerms/ram:Description[1]/tokenize(. , '(\r?\n)')[starts-with( normalize-space(.) , '#')] satisfies matches ( normalize-space ($line), $XR-SKONTO-REGEX ) and matches( rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradePaymentTerms/ram:Description[1]/tokenize(. , '#.+#')[last()], '^\s*\n' )
UBL Context: /ubl:Invoice | /cn:CreditNote

2. KoSIT-Verified XML Example: Broken vs. Fixed

✕ Invalid CII XML — Rejected by KoSIT 1.6.3 (BR-DE-18)
</ram:ApplicableTradeTax>
<ram:SpecifiedTradePaymentTerms>
  <ram:Description>#SKONTO#TAGE=14#PROZENT=2%#</ram:Description>
  <ram:DueDateDateTime>
    <udt:DateTimeString format="102">20261221</udt:DateTimeString>
  </ram:DueDateDateTime>
</ram:SpecifiedTradePaymentTerms>
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
✓ Fixed CII XML — Passed KoSIT 1.6.3 (0 Errors)
      </ram:ApplicableTradeTax>
      <ram:SpecifiedTradePaymentTerms>
        <ram:Description>#SKONTO#TAGE=14#PROZENT=2.00#
</ram:Description>
        <ram:DueDateDateTime>
          <udt:DateTimeString format="102">20261221</udt:DateTimeString>
        </ram:DueDateDateTime>
      </ram:SpecifiedTradePaymentTerms>

The broken XML uses 'PROZENT=2%#' which fails because percentages must be in dot-decimal format (e.g., 2.00) and end with a #. The fixed XML replaces '2%#' with '2.00#' and adds a newline, satisfying the regex and passing KoSIT validation.

3. Step-by-Step Fix Checklist

  1. Step 1: Inspect the <ram:Description> element in BT-20 (Payment Terms) for Skonto lines.
  2. Step 2: Replace any percent signs (%) with dot-decimal format (e.g., 2.00), ensure all segments are uppercase and end with a #.
  3. Step 3: Re-validate the XML using Beleq's free KoSIT v1.6.3 validator to confirm compliance.

4. Common Shopify Store & DATEV Workflow Trigger

German Shopify B2B merchants often manually enter Skonto terms like '2% Skonto bei Zahlung in 14 Tagen' into BT-20, which violates the strict regex. Beleq helps by validating the invoice format before sending it to DATEV, preventing rejections and ensuring compliance with XRechnung 3.0.2.

Guide (DE): German BMF Error Classes & Input VAT →

5. Frequently Asked Questions

What is the correct format for Skonto in XRechnung 3.0.2?

Skonto must be in uppercase, with segments like #SKONTO#TAGE=14#PROZENT=2.00#, and must end with a # followed by a newline.

Does this rule apply to ZUGFeRD 2.3 (Factur-X) as well?

No, BR-DE-18 is specific to XRechnung 3.0.2. ZUGFeRD 2.3 uses a different format for Skonto in the <PaymentMeans> element.

Related KoSIT Error Codes

Validate your ZUGFeRD PDF or XRechnung XML free online

Check your hybrid ZUGFeRD PDF or XRechnung XML in under 1 second against the official German KoSIT Validator v1.6.3 — 100% RAM-based on Frankfurt servers with zero retention and no registration.

Open Free KoSIT v1.6.3 Validator → See Beleq for Shopify