SE-R-002: For Swedish suppliers, the Swedish VAT-numbers must have the trailing 12 characters in numeric form
This fatal rule (SE-R-002) enforces the Swedish national VAT number format within Peppol BIS Billing 3.0. It applies to the AccountingSupplierParty (BG-4) when the supplier's country code (BT-40, cac:PostalAddress/cac:Country/cbc:IdentificationCode) is 'SE' and the supplier has a VAT tax scheme (cac:PartyTaxScheme with TaxScheme/cbc:ID = 'VAT'). The context XPath selects the cac:Party element only if the CompanyID (BT-31, the VAT identifier) starts with 'SE' (substring(cbc:CompanyID,1,2) = 'SE'). The assertion then requires that the trailing 12 characters of that CompanyID (i.e., characters 3 through 14) are all numeric digits. In EN 16931 terms, BT-31 must be a valid Swedish VAT number: 'SE' followed by 12 digits (e.g., SE123456789012). The rule is evaluated in the XPath context of the cac:Party element, so the test typically uses a pattern like matches(substring(cbc:CompanyID,3), '^[0-9]{12}$') or equivalent. Failure occurs when the VAT number contains non-numeric characters after 'SE', is too short, or has extra characters.
1. Locate the supplier's VAT identifier (BT-31) in the UBL document at /Invoice/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID='VAT']/cbc:CompanyID. 2. Ensure the value starts with 'SE' (country code) followed by exactly 12 numeric digits (0-9). No spaces, hyphens, or other characters are allowed. 3. If the VAT number is invalid, correct it by removing any non-numeric characters after 'SE' and ensuring the total length is 14 characters (2 letters + 12 digits). 4. Validate the corrected XML against the Peppol BIS Billing 3.0 Schematron to confirm the rule passes. 5. For programmatic generation, enforce a regex pattern like ^SE[0-9]{12}$ on the CompanyID field when the supplier country is 'SE'.
Missing <cbc:CustomizationID> or value does not declare EN 16931 CIUS compliance.
fix: Insert <cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0</cbc:CustomizationID>.
Missing <cbc:EndpointID schemeID="..."> inside <cac:AccountingSupplierParty>/<cac:Party>.
fix: Add <cbc:EndpointID schemeID="9930">DE123456789</cbc:EndpointID> as the first child of Seller <cac:Party>.
No <cbc:BuyerReference> (BT-10) found. Mandatory in XRechnung 3.0 (BR-DE-15) and required in Peppol BIS 3.0 (PEPPOL-EN16931-R003) when OrderReference is absent.
fix: Insert <cbc:BuyerReference>991-12849-74</cbc:BuyerReference> in the document header.
If both supplier and customer are located in Germany, an invoice shall contain information on "PAYMENT INSTRUCTIONS" (BG-16).
If both supplier and customer are located in Germany, the group "SELLER CONTACT" (BG-6) shall be provided.
If both supplier and customer are located in Germany, the element "Buyer reference" (BT-10) shall be provided.
If both supplier and customer are located in Germany, and if one of the VAT codes S, Z, E, AE, K, G, L, or M is used, an invoice shall contain at least one of the following elements: "Seller VAT identifier" (BT-31) or "Seller tax registration identifier" (BT-32) or "SELLER TAX REPRESENTATIVE PARTY" (BG-11).
If both supplier and customer are located in Germany, the element "Invoice type code" (BT-3) should only contain the following values from code list UNTDID 1001: 326 (Partial invoice), 380 (Commercial invoice), 384 (Corrected invoice), 389 (Self-billed invoice), 381 (Credit note), 875 (Partial construction invoice), 876 (Partial final construction invoice), 877 (Final construction invoice).