Peppol BIS Billing 3.0.21 · UBL

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

Peppol BIS Billing 3.0.21 · UBL

fatalcountry

Original rule text

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

Stored validation assertion
string(number(substring(cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/cbc:CompanyID, 3, 12))) != 'NaN'

SE-R-002 is a fatal rule in the country layer of Peppol BIS Billing 3.0.21 · UBL. An invoice that breaks it is rejected.

What this rule requires

For a Swedish supplier whose VAT identifier in cbc:CompanyID starts with SE, the characters after the SE prefix must be numeric. The rule message says the trailing 12 characters must be numeric. The test checks that the substring from position 3 for length 12 converts to a number (string(number(...)) != 'NaN'). However, the test does not require exactly 12 digits; it only checks that whatever characters are present in that range are numeric. If fewer than 12 digits follow SE and all are digits, the test still passes.

How to fix

In cac:PartyTaxScheme/cac:TaxScheme/cbc:ID = 'VAT' for the Swedish supplier, change cbc:CompanyID so that the part after the initial SE consists only of numeric digits. To meet the message's expectation, provide the standard 12 digits after SE. The test itself only requires that the characters from position 3 up to length 12 are numeric, so ensure no non-numeric characters appear there.

Guidance on this rule. The original text above is authoritative.

Where to go next

No published Peppol BIS Billing UBL release comparison lists a change to SE-R-002.

Validate an invoice against these rules · All release changes