Beleq / Validator / KoSIT Error Codes / BR-CO-13
FATAL · BR-CO-13 EN 16931 (v1.3.16) Verified with KoSIT v1.6.3 (0-Error Fix) BT-107BT-108BT-109BT-131

How to Fix KoSIT Error BR-CO-13: TaxBasisTotalAmount Mismatch

KoSIK 1.6.3 rejects invoices where BT-109 (TaxBasisTotalAmount) does not equal BT-131 (LineTotalAmount) minus BT-107 (AllowanceTotalAmount) plus BT-108 (ChargeTotalAmount). This is a fatal error. Fix by recalculating BT-109 using the correct formula.

Official KoSIT v1.6.3 Schematron Message (EN16931 (CII))
[BR-CO-13]-Invoice total amount without VAT (BT-109) = Σ Invoice line net amount (BT-131) - Sum of allowances on document level (BT-107) + Sum of charges on document level (BT-108).

1. Why KoSIT Validator v1.6.3 Rejects This Invoice

EN 16931 mandates that the invoice total without VAT (BT-109) must equal the sum of line net amounts (BT-131) minus document-level allowances (BT-107) plus document-level charges (BT-108). The XPath test in KoSIT v1.6.3 checks this formula in both CII and UBL contexts. If the values do not align, the invoice is rejected as non-conformant. This ensures financial consistency and prevents errors in downstream accounting systems.

CII Context: //ram:SpecifiedTradeSettlementHeaderMonetarySummation
CII Schematron Test: (xs:decimal(ram:TaxBasisTotalAmount[1]) = round((xs:decimal(ram:LineTotalAmount[1]) - xs:decimal(ram:AllowanceTotalAmount[1]) + xs:decimal(ram:ChargeTotalAmount[1])) * 10 * 10) div 100) or ((xs:decimal(ram:TaxBasisTotalAmount[1]) = round((xs:decimal(ram:LineTotalAmount[1]) - xs:decimal(ram:AllowanceTotalAmount[1])) * 10 * 10) div 100) and not(ram:ChargeTotalAmount)) or ((xs:decimal(ram:TaxBasisTotalAmount[1]) = round((xs:decimal(ram:LineTotalAmount[1]) + xs:decimal(ram:ChargeTotalAmount[1])) * 10 * 10) div 100) and not(ram:AllowanceTotalAmount)) or ((xs:decimal(ram:TaxBasisTotalAmount[1]) = round((xs:decimal(ram:LineTotalAmount[1])) * 10 * 10) div 100) and not(ram:ChargeTotalAmount) and not(ram:AllowanceTotalAmount))
UBL Context: cac:LegalMonetaryTotal

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

✕ Invalid CII XML — Rejected by KoSIT 1.6.3 (BR-CO-13)
  <ram:SpecifiedTradeSettlementHeaderMonetarySummation>
    <ram:LineTotalAmount>140.00</ram:LineTotalAmount>
    <ram:AllowanceTotalAmount>8.67</ram:AllowanceTotalAmount>
    <ram:TaxBasisTotalAmount>140.00</ram:TaxBasisTotalAmount>
    <ram:TaxTotalAmount currencyID="EUR">20.47</ram:TaxTotalAmount>
    <ram:GrandTotalAmount>151.80</ram:GrandTotalAmount>
    <ram:TotalPrepaidAmount>151.80</ram:TotalPrepaidAmount>
    <ram:DuePayableAmount>0.00</ram:DuePayableAmount>
  </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
</ram:ApplicableHeaderTradeSettlement>
✓ Fixed CII XML — Passed KoSIT 1.6.3 (0 Errors)
  <ram:SpecifiedTradeSettlementHeaderMonetarySummation>
    <ram:LineTotalAmount>140.00</ram:LineTotalAmount>
    <ram:AllowanceTotalAmount>8.67</ram:AllowanceTotalAmount>
    <ram:TaxBasisTotalAmount>131.33</ram:TaxBasisTotalAmount>
    <ram:TaxTotalAmount currencyID="EUR">20.47</ram:TaxTotalAmount>
    <ram:GrandTotalAmount>151.80</ram:GrandTotalAmount>
    <ram:TotalPrepaidAmount>151.80</ram:TotalPrepaidAmount>
    <ram:DuePayableAmount>0.00</ram:DuePayableAmount>
  </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
</ram:ApplicableHeaderTradeSettlement>

In the broken XML, TaxBasisTotalAmount (140.00) does not match the calculated value (140.00 - 8.67 = 131.33). The fixed XML sets TaxBasisTotalAmount to 131.33, aligning with the formula. This passes the KoSIT 1.6.3 validation with no errors.

3. Step-by-Step Fix Checklist

  1. Step 1: Inspect the TaxBasisTotalAmount (BT-109) in the XML header monetary summation.
  2. Step 2: Recalculate BT-109 using the formula: LineTotalAmount - AllowanceTotalAmount + ChargeTotalAmount.
  3. Step 3: Re-validate with Beleq's free KoSIT v1.6.3 validator to confirm compliance.

4. Common Shopify Store & DATEV Workflow Trigger

Shopify B2B orders with order-level discounts (AllowanceTotalAmount) or surcharges (ChargeTotalAmount) may trigger BR-CO-13 if the TaxBasisTotalAmount is not recalculated correctly. Beleq ensures that the TaxBasisTotalAmount is dynamically updated to match the formula, preventing rejections during DATEV import or KoSIT validation.

Guide (DE): Partial Refunds & TypeCode 381 Credit Notes →

5. Frequently Asked Questions

Can BR-CO-13 be ignored if the invoice is manually reviewed by the recipient?

No. BR-CO-13 is a fatal error in KoSIT 1.6.3 and must be fixed for technical EN 16931 compliance. Recipients using automated systems will reject the invoice.

Does this rule apply to both ZUGFeRD and XRechnung formats?

Yes. BR-CO-13 applies to both ZUGFeRD 2.3 and XRechnung 3.0 as they both implement EN 16931. The XPath context differs slightly, but the formula is the same.

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