EN 16931 · PEPPOL 3.0.17 CERTIFIED ENGINE
Pay-As-You-Go API Credits ($0.05/op) →
InvoiceSpec / Rules Registry / peppol-bis-3 / SE-R-002
fatal ASSERTION · SE-R-002 Peppol BIS Billing 3.0 (UBL-2.1) Jurisdiction: EU

SE-R-002: For Swedish suppliers, the Swedish VAT-numbers must have the trailing 12 characters in numeric form

Official Peppol BIS Billing 3.0 Spec ↗
01. Technical Specification & XPath Evaluation Context

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.

Evaluated XPath Location:
//cac:AccountingSupplierParty/cac:Party[cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'SE' and cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 1, 2) = 'SE']
Deterministic Remediation Steps

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'.

02. Side-by-Side UBL-2.1 Payload Diff (Rejected vs. Compliant)
--- a/invoice-rejected.xml (SE-R-002) FAIL
1 <!-- Invalid: Swedish VAT number has non-numeric characters after 'SE' -->
2 <cac:AccountingSupplierParty>
3 <cac:Party>
4 <cac:PostalAddress>
5 <cac:Country>
6 <cbc:IdentificationCode>SE</cbc:IdentificationCode>
7 </cac:Country>
8 </cac:PostalAddress>
9 <cac:PartyTaxScheme>
10 <cbc:CompanyID>SE12345678901A</cbc:CompanyID> <!-- Error: trailing 12 characters include 'A' -->
11 <cac:TaxScheme>
12 <cbc:ID>VAT</cbc:ID>
13 </cac:TaxScheme>
14 </cac:PartyTaxScheme>
15 </cac:Party>
16 </cac:AccountingSupplierParty>
+++ b/invoice-compliant.xml (EN 16931 VALID) PASS
1 + <!-- Valid: Swedish VAT number has exactly 12 numeric digits after 'SE' -->
2 <cac:AccountingSupplierParty>
3 <cac:Party>
4 <cac:PostalAddress>
5 <cac:Country>
6 <cbc:IdentificationCode>SE</cbc:IdentificationCode>
7 </cac:Country>
8 </cac:PostalAddress>
9 <cac:PartyTaxScheme>
10 + <cbc:CompanyID>SE123456789012</cbc:CompanyID> <!-- Correct: 12 digits -->
11 <cac:TaxScheme>
12 <cbc:ID>VAT</cbc:ID>
13 </cac:TaxScheme>
14 </cac:PartyTaxScheme>
15 </cac:Party>
16 </cac:AccountingSupplierParty>
03. Interactive Peppol BIS Billing 3.0 Validation & Auto-Fix Workbench
BALANCE:3 CREDITS
invoice.xmlUBL-2.1
ORIGINCustom ERP / Billing Engine
BT-131 LINE SUM0.00 EUR
BT-106 HEADER0.00 EUR
STATUS: FAIL (2 FATAL, 1 WARN)· 1ms
Peppol BIS Billing 3.0
BR-01An Invoice shall have a valid EN 16931 Specification identifier (BT-24)
Spec & Diff
xpath: /ubl:Invoice/cbc:CustomizationID

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>.

PEPPOL-EN16931-R020Seller electronic address (BT-34) MUST be provided with a valid EAS @schemeID
Spec & Diff
xpath: /ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cbc:EndpointID

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>.

BR-DE-15Buyer reference / Leitweg-ID (BT-10) is missing
Spec & Diff
xpath: /ubl:Invoice/cbc:BuyerReference

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.

Deploy Direct Custom ERP / Billing Engine → Peppol BIS Billing 3.0 AP Bridge

Automated Peppol Access Point & ZUGFeRD delivery without manual XML maintenance

04. Adjacent Peppol BIS Billing 3.0 Assertions Browse All 1,145 Rules →