← All Error Rules
error Class A

BR-DE-07 VAT Number Format

What this rule checks

BR-DE-07 validates that the seller’s VAT identification number in field BT-31 (Seller VAT identifier) follows the correct format. When a VAT ID is provided, it must match the pattern defined by the respective EU member state. For German businesses, this means: the country prefix DE followed by exactly 9 digits.

In the XRechnung XML context, this rule inspects the element cac:PartyTaxScheme/cbc:CompanyID, where the associated cac:TaxScheme/cbc:ID must be set to VAT.

Why this rule exists

The VAT identification number is a critical identifier in intra-community trade and automated invoice processing. Malformed or incomplete VAT IDs cause:

  • Rejection by validation systems such as the Peppol infrastructure or government verification endpoints
  • Failures in automated matching within ERP and accounting systems
  • Issues with input tax deduction eligibility, as the Federal Central Tax Office (BZSt) performs machine-based VAT ID verification
  • Delays in EC Sales List (Zusammenfassende Meldung) reporting for intra-community supplies

What triggers a failure

The rule fails when:

  • The country prefix DE is missing (e.g., just 123456789)
  • The digit count is incorrect (e.g., DE12345678 with only 8 digits)
  • Invalid characters are present (e.g., DE 123 456 789 with spaces)
  • The format does not match any recognized EU VAT ID pattern
  • The TaxScheme/ID is not set to VAT

Failing XML example

<cac:AccountingSupplierParty>
  <cac:Party>
    <cac:PartyTaxScheme>
      <!-- ERROR: Missing DE country prefix -->
      <cbc:CompanyID>1234567</cbc:CompanyID>
      <cac:TaxScheme>
        <cbc:ID>VAT</cbc:ID>
      </cac:TaxScheme>
    </cac:PartyTaxScheme>
  </cac:Party>
</cac:AccountingSupplierParty>

This example violates BR-DE-07 in two ways: the country prefix DE is missing, and the number has only 7 digits instead of the required 9.

The fix

<cac:AccountingSupplierParty>
  <cac:Party>
    <cac:PartyTaxScheme>
      <!-- CORRECT: DE + 9 digits -->
      <cbc:CompanyID>DE123456789</cbc:CompanyID>
      <cac:TaxScheme>
        <cbc:ID>VAT</cbc:ID>
      </cac:TaxScheme>
    </cac:PartyTaxScheme>
  </cac:Party>
</cac:AccountingSupplierParty>

Make sure that:

  1. The value in cbc:CompanyID includes the full country prefix (e.g., DE for Germany)
  2. Exactly 9 digits follow the country prefix
  3. No spaces, dots, or separators are included
  4. cac:TaxScheme/cbc:ID is set to VAT

Edge cases and common mistakes

  • Non-German EU VAT IDs: Other EU member states have different formats (e.g., ATU12345678 for Austria, FR12345678901 for France). These are also valid in BT-31 and are validated according to the respective country format.
  • Tax number vs. VAT ID: The German tax number (Steuernummer, e.g., 123/456/78901) belongs in a different field (BT-32, PartyLegalEntity/CompanyID) and follows a completely different format. Confusing these two identifiers is a frequent source of errors.
  • Country prefix is part of the value: The DE prefix is not passed as a separate XML attribute; it is an integral part of the text content of cbc:CompanyID.
  • Lowercase letters: de123456789 may cause validation failures. Always use uppercase: DE123456789.
  • Check digit logic: The 9th digit of a German VAT ID is a check digit. BR-DE-07 typically validates only the format, not the mathematical correctness of the check digit. However, invalid numbers will be caught during BZSt verification.