E-Invoice Validation Rules Reference

Look up any e-invoice validation rule by its ID — what it checks, the technical test, which formats enforce it and how to fix a violation. Covers the EN 16931 European core, PEPPOL BIS 3.0, XRechnung and national CIUS profiles, generated from the same schematron our validators run.

209documented rules
196fatal (blocking)
12rule families

Showing209209rules

EN 16931 — core rules (59)

BR-01

fatal

An Invoice shall have a Specification identifier (BT-24).

EN 16931CIIUBLBT-24
Technical test (XPath)
normalize-space(rsm:ExchangedDocumentContext/ram:GuidelineSpecifiedDocumentContextParameter/ram:ID) != ''
Validate against this rule

BR-03

fatal

An Invoice shall have an Invoice issue date (BT-2).

EN 16931CIIUBLBT-2
Technical test (XPath)
normalize-space(rsm:ExchangedDocument/ram:IssueDateTime/udt:DateTimeString[@format='102']) != ''
Validate against this rule

BR-04

fatal

An Invoice shall have an Invoice type code (BT-3).

EN 16931CIIUBLBT-3
Technical test (XPath)
normalize-space(rsm:ExchangedDocument/ram:TypeCode) != ''
Validate against this rule

BR-05

fatal

An Invoice shall have an Invoice currency code (BT-5).

EN 16931CIIUBLBT-5
Technical test (XPath)
normalize-space(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode) != ''
Validate against this rule

BR-06

fatal

An Invoice shall contain the Seller name (BT-27).

EN 16931CIIUBLBT-27
Technical test (XPath)
normalize-space(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:Name) != ''
Validate against this rule

BR-07

fatal

An Invoice shall contain the Buyer name (BT-44).

EN 16931CIIUBLBT-44
Technical test (XPath)
normalize-space(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:Name) != ''
Validate against this rule

BR-08

fatal

An Invoice shall contain the Seller postal address.

EN 16931CIIUBL
Technical test (XPath)
rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:PostalTradeAddress
Validate against this rule

BR-09

fatal

The Seller postal address (BG-5) shall contain a Seller country code (BT-40).

EN 16931CIIUBLBG-5BT-40
Technical test (XPath)
normalize-space(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:PostalTradeAddress/ram:CountryID) != ''
Validate against this rule

BR-10

fatal

An Invoice shall contain the Buyer postal address (BG-8).

EN 16931CIIUBLBG-8
Technical test (XPath)
rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:PostalTradeAddress
Validate against this rule

BR-11

fatal

The Buyer postal address shall contain a Buyer country code (BT-55).

EN 16931CIIUBLBT-55
Technical test (XPath)
normalize-space(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:PostalTradeAddress/ram:CountryID) != ''
Validate against this rule

BR-17

fatal

The Payee name (BT-59) shall be provided in the Invoice, if the Payee (BG-10) is different from the Seller (BG-4).

EN 16931CIIUBLBT-59BG-10BG-4
Technical test (XPath)
(ram:Name) and (not(ram:Name = ../../ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:Name) and not(ram:ID = ../../ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:ID) and not(ram:SpecifiedLegalOrganization/ram:ID = ../../ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedLegalOrganization/ram:ID))
Validate against this rule

BR-18

fatal

The Seller tax representative name (BT-62) shall be provided in the Invoice, if the Seller (BG-4) has a Seller tax representative party (BG-11).

EN 16931CIIUBLBT-62BG-4BG-11
Technical test (XPath)
(ram:Name)
Validate against this rule

BR-19

fatal

The Seller tax representative postal address (BG-12) shall be provided in the Invoice, if the Seller (BG-4) has a Seller tax representative party (BG-11).

EN 16931CIIUBLBG-12BG-4BG-11
Technical test (XPath)
(ram:PostalTradeAddress)
Validate against this rule

BR-20

fatal

The Seller tax representative postal address (BG-12) shall contain a Tax representative country code (BT-69), if the Seller (BG-4) has a Seller tax representative party (BG-11).

EN 16931CIIUBLBG-12BT-69BG-4BG-11
Technical test (XPath)
(ram:PostalTradeAddress/ram:CountryID)
Validate against this rule

BR-21

fatal

Each Invoice line (BG-25) shall have an Invoice line identifier (BT-126).

EN 16931CIIUBLBG-25BT-126
Technical test (XPath)
normalize-space(ram:AssociatedDocumentLineDocument/ram:LineID) != ''
Validate against this rule

BR-22

fatal

Each Invoice line (BG-25) shall have an Invoiced quantity (BT-129).

EN 16931CIIUBLBG-25BT-129
Technical test (XPath)
(ram:SpecifiedLineTradeDelivery/ram:BilledQuantity)
Validate against this rule

BR-23

fatal

An Invoice line (BG-25) shall have an Invoiced quantity unit of measure code (BT-130).

EN 16931CIIUBLBG-25BT-130
Technical test (XPath)
(ram:SpecifiedLineTradeDelivery/ram:BilledQuantity/@unitCode)
Validate against this rule

BR-24

fatal

Each Invoice line (BG-25) shall have an Invoice line net amount (BT-131).

EN 16931CIIUBLBG-25BT-131
Technical test (XPath)
(ram:SpecifiedLineTradeSettlement/ram:SpecifiedTradeSettlementLineMonetarySummation/ram:LineTotalAmount)
Validate against this rule

BR-25

fatal

Each Invoice line (BG-25) shall contain the Item name (BT-153).

EN 16931CIIUBLBG-25BT-153
Technical test (XPath)
normalize-space(ram:SpecifiedTradeProduct/ram:Name) != ''
Validate against this rule

BR-26

fatal

Each Invoice line (BG-25) shall contain the Item net price (BT-146).

EN 16931CIIUBLBG-25BT-146
Technical test (XPath)
(ram:SpecifiedLineTradeAgreement/ram:NetPriceProductTradePrice/ram:ChargeAmount)
Validate against this rule

BR-29

fatal

If both Invoicing period start date (BT-73) and Invoicing period end date (BT-74) are given then the Invoicing period end date (BT-74) shall be later or equal to the Invoicing period start date (BT-73).

EN 16931CIIUBLBT-73BT-74
Validate against this rule

BR-30

fatal

If both Invoice line period start date (BT-134) and Invoice line period end date (BT-135) are given then the Invoice line period end date (BT-135) shall be later or equal to the Invoice line period start date (BT-134).

EN 16931CIIUBLBT-134BT-135
Validate against this rule

BR-31

fatal

Each Document level allowance (BG-20) shall have a Document level allowance amount (BT-92).

EN 16931CIIUBLBG-20BT-92
Technical test (XPath)
(../ram:ActualAmount)
Validate against this rule

BR-32

fatal

Each Document level allowance (BG-20) shall have a Document level allowance VAT category code (BT-95).

EN 16931CIIUBLBG-20BT-95
Technical test (XPath)
(../ram:CategoryTradeTax[upper-case(ram:TypeCode) = 'VAT']/ram:CategoryCode)
Validate against this rule

BR-33

fatal

Each Document level allowance (BG-20) shall have a Document level allowance reason (BT-97) or a Document level allowance reason code (BT-98).

EN 16931CIIUBLBG-20BT-97BT-98
Technical test (XPath)
(../ram:Reason) or (../ram:ReasonCode)
Validate against this rule

BR-36

fatal

Each Document level charge (BG-21) shall have a Document level charge amount (BT-99).

EN 16931CIIUBLBG-21BT-99
Technical test (XPath)
(../ram:ActualAmount)
Validate against this rule

BR-37

fatal

Each Document level charge (BG-21) shall have a Document level charge VAT category code (BT-102).

EN 16931CIIUBLBG-21BT-102
Technical test (XPath)
(../ram:CategoryTradeTax[upper-case(ram:TypeCode) = 'VAT']/ram:CategoryCode)
Validate against this rule

BR-38

fatal

Each Document level charge (BG-21) shall have a Document level charge reason (BT-104) or a Document level charge reason code (BT-105).

EN 16931CIIUBLBG-21BT-104BT-105
Technical test (XPath)
(../ram:Reason) or (../ram:ReasonCode)
Validate against this rule

BR-41

fatal

Each Invoice line allowance (BG-27) shall have an Invoice line allowance amount (BT-136).

EN 16931CIIUBLBG-27BT-136
Technical test (XPath)
(../ram:ActualAmount)
Validate against this rule

BR-42

fatal

Each Invoice line allowance (BG-27) shall have an Invoice line allowance reason (BT-139) or an Invoice line allowance reason code (BT-140).

EN 16931CIIUBLBG-27BT-139BT-140
Technical test (XPath)
(../ram:Reason) or (../ram:ReasonCode)
Validate against this rule

BR-43

fatal

Each Invoice line charge (BG-28) shall have an Invoice line charge amount (BT-141).

EN 16931CIIUBLBG-28BT-141
Technical test (XPath)
(../ram:ActualAmount)
Validate against this rule

BR-44

fatal

Each Invoice line charge shall have an Invoice line charge reason or an invoice line allowance reason code.

EN 16931CIIUBL
Technical test (XPath)
(../ram:Reason) or (../ram:ReasonCode)
Validate against this rule

BR-47

fatal

Each VAT breakdown (BG-23) shall be defined through a VAT category code (BT-118).

EN 16931CIIUBLBG-23BT-118
Technical test (XPath)
(.[upper-case(ram:TypeCode) = 'VAT']/ram:CategoryCode)
Validate against this rule

BR-48

fatal

Each VAT breakdown (BG-23) shall have a VAT category rate (BT-119), except if the Invoice is not subject to VAT.

EN 16931CIIUBLBG-23BT-119
Technical test (XPath)
(.[upper-case(ram:TypeCode) = 'VAT']/ram:RateApplicablePercent) or (.[upper-case(ram:TypeCode) = 'VAT']/ram:CategoryCode = 'O')
Validate against this rule

BR-50

fatal

A Payment account identifier (BT-84) shall be present if Credit transfer (BG-17) information is provided in the Invoice.

EN 16931CIIUBLBT-84BG-17
Technical test (XPath)
(ram:IBANID) or (ram:ProprietaryID)
Validate against this rule

BR-51

fatal

In accordance with card payments security standards an invoice should never include a full card primary account number (BT-87).

EN 16931CIIUBLBT-87
Technical test (XPath)
string-length(ram:ID)<=10
Validate against this rule

BR-52

fatal

Each Additional supporting document (BG-24) shall contain a Supporting document reference (BT-122).

EN 16931CIIUBLBG-24BT-122
Technical test (XPath)
normalize-space(ram:IssuerAssignedID) != ''
Validate against this rule

BR-53

fatal

If the VAT accounting currency code (BT-6) is present, then the Invoice total VAT amount in accounting currency (BT-111) shall be provided.

EN 16931CIIUBLBT-6BT-111
Technical test (XPath)
not(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:TaxCurrencyCode) or (/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:TaxCurrencyCode and (ram:TaxTotalAmount/@currencyID = /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:TaxCurrencyCode) and not(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:TaxCurrencyCode = /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode))
Validate against this rule

BR-54

fatal

Each Item attribute (BG-32) shall contain an Item attribute name (BT-160) and an Item attribute value (BT-161).

EN 16931CIIUBLBG-32BT-160BT-161
Technical test (XPath)
(ram:Description) and (ram:Value)
Validate against this rule

BR-55

fatal

Each Preceding Invoice reference (BG-3) shall contain a Preceding Invoice reference (BT-25).

EN 16931CIIUBLBG-3BT-25
Technical test (XPath)
normalize-space(ram:IssuerAssignedID) != ''
Validate against this rule

BR-56

fatal

Each Seller tax representative party (BG-11) shall have a Seller tax representative VAT identifier (BT-63).

EN 16931CIIUBLBG-11BT-63
Technical test (XPath)
normalize-space(ram:SpecifiedTaxRegistration/ram:ID[@schemeID='VA']) != ''
Validate against this rule

BR-57

fatal

Each Deliver to address (BG-15) shall contain a Deliver to country code (BT-80).

EN 16931CIIUBLBG-15BT-80
Technical test (XPath)
(ram:ShipToTradeParty/ram:PostalTradeAddress and normalize-space(ram:ShipToTradeParty/ram:PostalTradeAddress/ram:CountryID) != '') or not (ram:ShipToTradeParty/ram:PostalTradeAddress)
Validate against this rule

BR-61

fatal

If the Payment means type code (BT-81) means SEPA credit transfer, Local credit transfer or Non-SEPA international credit transfer, the Payment account identifier (BT-84) shall be present.

EN 16931CIIUBLBT-81BT-84
Technical test (XPath)
(ram:IBANID) or (ram:ProprietaryID)
Validate against this rule

BR-62

fatal

The Seller electronic address (BT-34) shall have a Scheme identifier.

EN 16931CIIUBLBT-34
Technical test (XPath)
normalize-space(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:URIUniversalCommunication[1]/ram:URIID/@schemeID) != '' or not (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:URIUniversalCommunication)
Validate against this rule

BR-63

fatal

The Buyer electronic address (BT-49) shall have a Scheme identifier.

EN 16931CIIUBLBT-49
Technical test (XPath)
normalize-space(rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:URIUniversalCommunication[1]/ram:URIID/@schemeID) != '' or not (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:URIUniversalCommunication)
Validate against this rule

BR-64

fatal

The Item standard identifier (BT-157) shall have a Scheme identifier.

EN 16931CIIUBLBT-157
Technical test (XPath)
normalize-space(ram:SpecifiedTradeProduct/ram:GlobalID/@schemeID) != '' or not (ram:SpecifiedTradeProduct/ram:GlobalID)
Validate against this rule

BR-65

fatal

The Item classification identifier (BT-158) shall have a Scheme identifier.

EN 16931CIIUBLBT-158
Technical test (XPath)
normalize-space(ram:ClassCode/@listID) != '' or not (ram:ClassCode)
Validate against this rule

EN 16931 — calculation rules (18)

BR-CO-03

fatal

Value added tax point date (BT-7) and Value added tax point date code (BT-8) are mutually exclusive.

EN 16931CIIUBLBT-7BT-8
Technical test (XPath)
((//ram:TaxPointDate) and not(//ram:DueDateTypeCode)) or (not (//ram:TaxPointDate) and (//ram:DueDateTypeCode)) or (not (//ram:TaxPointDate) and not (//ram:DueDateTypeCode))
Validate against this rule

BR-CO-04

fatal

Each Invoice line (BG-25) shall be categorized with an Invoiced item VAT category code (BT-151).

EN 16931CIIUBLBG-25BT-151
Technical test (XPath)
(ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax[upper-case(ram:TypeCode) = 'VAT']/ram:CategoryCode)
Validate against this rule

BR-CO-05

fatal

Document level allowance reason code (BT-98) and Document level allowance reason (BT-97) shall indicate the same type of allowance.

EN 16931CIIUBLBT-98BT-97
Technical test (XPath)
true()
Validate against this rule

BR-CO-06

fatal

Document level charge reason code (BT-105) and Document level charge reason (BT-104) shall indicate the same type of charge.

EN 16931CIIUBLBT-105BT-104
Technical test (XPath)
true()
Validate against this rule

BR-CO-07

fatal

Invoice line allowance reason code (BT-140) and Invoice line allowance reason (BT-139) shall indicate the same type of allowance reason.

EN 16931CIIUBLBT-140BT-139
Technical test (XPath)
true()
Validate against this rule

BR-CO-08

fatal

Invoice line charge reason code (BT-145) and Invoice line charge reason (BT-144) shall indicate the same type of charge reason.

EN 16931CIIUBLBT-145BT-144
Technical test (XPath)
true()
Validate against this rule

BR-CO-09

fatal

The Seller VAT identifier (BT-31), the Seller tax representative VAT identifier (BT-63) and the Buyer VAT identifier (BT-48) shall have a prefix in accordance with ISO code ISO 3166-1 alpha-2 by which the country of issue may be identified. Nevertheless, Greece may use the prefix 'EL'.

EN 16931CIIUBLBT-31BT-63BT-48
Technical test (XPath)
contains(' 1A AD AE AF AG AI AL AM AN AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BL BJ BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH EL ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS XI YE YT ZA ZM ZW ', concat(' ', substring(.,1,2), ' '))
Validate against this rule

BR-CO-10

fatal

Sum of Invoice line net amount (BT-106) = Sum of Invoice line net amounts (BT-131).

EN 16931CIIUBLBT-106BT-131
Technical test (XPath)
xs:decimal(ram:LineTotalAmount) = round(xs:decimal(sum(../../ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeSettlement/ram:SpecifiedTradeSettlementLineMonetarySummation/ram:LineTotalAmount)) * xs:decimal(100)) div xs:decimal(100)
Validate against this rule

BR-CO-11

fatal

Sum of allowances on document level (BT-107) = Sum of Document level allowance amounts (BT-92).

EN 16931CIIUBLBT-107BT-92
Technical test (XPath)
(not(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator=false()])and not (ram:AllowanceTotalAmount)) or ram:AllowanceTotalAmount = (round(sum(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator=false()]/ram:ActualAmount)* 10 * 10 ) div 100)
Validate against this rule

BR-CO-12

fatal

Sum of charges on document level (BT-108) = Sum of Document level charge amounts (BT-99).

EN 16931CIIUBLBT-108BT-99
Technical test (XPath)
(not(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator=true()])and not (ram:ChargeTotalAmount)) or ram:ChargeTotalAmount = (round(sum(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge[ram:ChargeIndicator/udt:Indicator=true()]/ram:ActualAmount)* 10 * 10 ) div 100)
Validate against this rule

BR-CO-13

fatal

Invoice total amount without VAT (BT-109) = Sum of Invoice line net amounts (BT-131) - Sum of allowances on document level (BT-107) + Sum of charges on document level (BT-108).

EN 16931CIIUBLBT-109BT-131BT-107BT-108
Technical test (XPath)
(xs:decimal(ram:TaxBasisTotalAmount) = round((xs:decimal(ram:LineTotalAmount) - xs:decimal(ram:AllowanceTotalAmount) + xs:decimal(ram:ChargeTotalAmount)) *10 * 10) div 100) or ((xs:decimal(ram:TaxBasisTotalAmount) = round((xs:decimal(ram:LineTotalAmount) - xs:decimal(ram:AllowanceTotalAmount)) *10 * 10) div 100) and not (ram:ChargeTotalAmount)) or ((xs:decimal(ram:TaxBasisTotalAmount) = round((xs:decimal(ram:LineTotalAmount) + xs:decimal(ram:ChargeTotalAmount)) *10 * 10) div 100) and not (ram:AllowanceTotalAmount)) or ((xs:decimal(ram:TaxBasisTotalAmount) = round((xs:decimal(ram:LineTotalAmount)) *10 * 10) div 100) and not (ram:ChargeTotalAmount) and not (ram:AllowanceTotalAmount))
Validate against this rule

BR-CO-15

fatal

Invoice total amount with VAT (BT-112) = Invoice total amount without VAT (BT-109) + Invoice total VAT amount (BT-110).

EN 16931CIIUBLBT-112BT-109BT-110
Technical test (XPath)
every $Currency in rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode satisfies ( count ( rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementHeaderMonetarySummation/ram:TaxTotalAmount[@currencyID=$Currency] ) eq 1 and (//ram:SpecifiedTradeSettlementHeaderMonetarySummation/xs:decimal(ram:GrandTotalAmount) = round( (//ram:SpecifiedTradeSettlementHeaderMonetarySummation/xs:decimal(ram:TaxBasisTotalAmount) + (//ram:SpecifiedTradeSettlementHeaderMonetarySummation/xs:decimal(ram:TaxTotalAmount[@currencyID=$Currency]))) * 10 * 10) div 100)) or (//ram:SpecifiedTradeSettlementHeaderMonetarySummation/xs:decimal(ram:GrandTotalAmount) = (//ram:SpecifiedTradeSettlementHeaderMonetarySummation/xs:decimal(ram:TaxBasisTotalAmount)))
Validate against this rule

BR-CO-16

fatal

Amount due for payment (BT-115) = Invoice total amount with VAT (BT-112) - Paid amount (BT-113) + Rounding amount (BT-114).

EN 16931CIIUBLBT-115BT-112BT-113BT-114
Technical test (XPath)
(xs:decimal(ram:DuePayableAmount) = xs:decimal(ram:GrandTotalAmount) - xs:decimal(ram:TotalPrepaidAmount) + xs:decimal(ram:RoundingAmount)) or ((xs:decimal(ram:DuePayableAmount) = xs:decimal(ram:GrandTotalAmount) + xs:decimal(ram:RoundingAmount)) and not (xs:decimal(ram:TotalPrepaidAmount))) or ((xs:decimal(ram:DuePayableAmount) = xs:decimal(ram:GrandTotalAmount) - xs:decimal(ram:TotalPrepaidAmount)) and not (xs:decimal(ram:RoundingAmount))) or ((xs:decimal(ram:DuePayableAmount) = xs:decimal(ram:GrandTotalAmount)) and not (xs:decimal(ram:TotalPrepaidAmount)) and not (xs:decimal(ram:RoundingAmount)))
Validate against this rule

BR-CO-17

fatal

VAT category tax amount (BT-117) = VAT category taxable amount (BT-116) x (VAT category rate (BT-119) / 100), rounded to two decimals.

EN 16931CIIUBLBT-117BT-116BT-119
Validate against this rule

BR-CO-18

fatal

An Invoice shall at least have one VAT breakdown group (BG-23).

EN 16931CIIUBLBG-23
Technical test (XPath)
//rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax
Validate against this rule

BR-CO-21

fatal

Each Document level allowance (BG-20) shall contain a Document level allowance reason (BT-97) or a Document level allowance reason code (BT-98), or both.

EN 16931CIIUBLBG-20BT-97BT-98
Technical test (XPath)
(../ram:Reason) or (../ram:ReasonCode)
Validate against this rule

BR-CO-22

fatal

Each Document level charge (BG-21) shall contain a Document level charge reason (BT-104) or a Document level charge reason code (BT-105), or both.

EN 16931CIIUBLBG-21BT-104BT-105
Technical test (XPath)
(../ram:Reason) or (../ram:ReasonCode)
Validate against this rule

BR-CO-25

fatal

In case the Amount due for payment (BT-115) is positive, either the Payment due date (BT-9) or the Payment terms (BT-20) shall be present.

EN 16931CIIUBLBT-115BT-9BT-20
Validate against this rule

EN 16931 — VAT category rules (16)

BR-AE-01

fatal

An Invoice that contains an Invoice line, Document level allowance or Document level charge where the VAT category code is "Reverse charge" shall contain in the VAT Breakdown exactly one VAT category code equal with "VAT reverse charge".

EN 16931CIIUBL
Technical test (XPath)
(count(//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='AE'])=0 and count(//ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='AE'])=0 and count(//ram:CategoryTradeTax[ram:CategoryCode='AE'])=0) or ( count(//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='AE'])=1 and (exists(//ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='AE']) or exists(//ram:CategoryTradeTax[ram:CategoryCode='AE'])))
Validate against this rule

BR-AE-02

fatal

An Invoice that contains an Invoice line where the Invoiced item VAT category code is "Reverse charge" shall contain the Seller VAT Identifier, the Seller Tax registration identifier and/or the Seller tax representative VAT identifier and the Buyer VAT identifier and/or the Buyer legal registration identifier.

EN 16931CIIUBL
Technical test (XPath)
(//ram:SellerTradeParty/ram:SpecifiedTaxRegistration/ram:ID[@schemeID = ('VA', 'FC')] or //ram:SellerTaxRepresentativeTradeParty/ram:SpecifiedTaxRegistration/ram:ID[@schemeID = 'VA']) and (//ram:BuyerTradeParty/ram:SpecifiedTaxRegistration/ram:ID[@schemeID = 'VA'] or //ram:BuyerTradeParty/ram:SpecifiedLegalOrganization/ram:ID)
Validate against this rule

BR-AE-05

fatal

In an Invoice line where the Invoiced item VAT category code is "Reverse charge" the Invoiced item VAT rate shall be 0 (zero).

EN 16931CIIUBL
Technical test (XPath)
ram:RateApplicablePercent = 0
Validate against this rule

BR-AE-09

fatal

The VAT category tax amount in a VAT breakdown where the VAT category code is "Reverse charge" shall be 0 (zero).

EN 16931CIIUBL
Technical test (XPath)
../ram:CalculatedAmount = 0
Validate against this rule

BR-AE-10

fatal

A VAT breakdown with VAT Category code "Reverse charge" shall have a VAT exemption reason code or the VAT exemption reason text "Reverse charge".

EN 16931CIIUBL
Technical test (XPath)
(../ram:ExemptionReason) or (../ram:ExemptionReasonCode)
Validate against this rule

BR-E-01

fatal

An Invoice that contains an Invoice line, Document level allowance or Document level charge where the VAT category code is "Exempt from VAT" shall contain exactly one VAT breakdown with the VAT category code equal to "Exempt from VAT".

EN 16931CIIUBL
Technical test (XPath)
(count(//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='E'])=0 and count(//ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='E'])=0 and count(//ram:CategoryTradeTax[ram:CategoryCode='E'])=0) or ( count(//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='E'])=1 and (exists(//ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='E']) or exists(//ram:CategoryTradeTax[ram:CategoryCode='E'])))
Validate against this rule

BR-E-02

fatal

An Invoice that contains an Invoice line where the Invoiced item VAT category code is "Exempt from VAT" shall contain the Seller VAT Identifier, the Seller tax registration identifier and/or the Seller tax representative VAT identifier.

EN 16931CIIUBL
Technical test (XPath)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedTaxRegistration/ram:ID[@schemeID = ('VA', 'FC')] or /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTaxRepresentativeTradeParty/ram:SpecifiedTaxRegistration/ram:ID[@schemeID = 'VA']
Validate against this rule

BR-G-01

fatal

An Invoice that contains an Invoice line, Document level allowance or Document level charge where the VAT category code is "Export outside the EU" shall contain in the VAT breakdown exactly one VAT category code equal with "Export outside the EU".

EN 16931CIIUBL
Technical test (XPath)
(count(//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='G'])=0 and count(//ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='G'])=0 and count(//ram:CategoryTradeTax[ram:CategoryCode='G'])=0) or ( count(//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='G'])=1 and (exists(//ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='G']) or exists(//ram:CategoryTradeTax[ram:CategoryCode='G'])))
Validate against this rule

BR-G-02

fatal

An Invoice that contains an Invoice line where the Invoiced item VAT category code is "Export outside the EU" shall contain the Seller VAT Identifier or the Seller tax representative VAT identifier.

EN 16931CIIUBL
Technical test (XPath)
(//ram:SellerTradeParty/ram:SpecifiedTaxRegistration/ram:ID[@schemeID = 'VA'] or //ram:SellerTaxRepresentativeTradeParty/ram:SpecifiedTaxRegistration/ram:ID[@schemeID = 'VA'])
Validate against this rule

BR-IC-01

fatal

An Invoice that contains an Invoice line, Document level allowance or Document level charge where the VAT category code is "Intra-community supply" shall contain in the VAT breakdown exactly one VAT category code equal with "Intra-community supply".

EN 16931CIIUBL
Technical test (XPath)
(count(//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='K'])=0 and count(//ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='K'])=0 and count(//ram:CategoryTradeTax[ram:CategoryCode='K'])=0) or ( count(//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='K'])=1 and (exists(//ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='K']) or exists(//ram:CategoryTradeTax[ram:CategoryCode='K'])))
Validate against this rule

BR-IC-02

fatal

An Invoice that contains an Invoice line where the Invoiced item VAT category code is "Intra-community supply" shall contain the Seller VAT Identifier or the Seller tax representative VAT identifier and the Buyer VAT identifier.

EN 16931CIIUBL
Technical test (XPath)
(//ram:SellerTradeParty/ram:SpecifiedTaxRegistration/ram:ID[@schemeID = 'VA'] or //ram:SellerTaxRepresentativeTradeParty/ram:SpecifiedTaxRegistration/ram:ID[@schemeID = 'VA']) and //ram:BuyerTradeParty/ram:SpecifiedTaxRegistration/ram:ID[@schemeID = 'VA']
Validate against this rule

BR-O-01

fatal

An Invoice that contains an Invoice line, Document level allowance or Document level charge where the VAT category code is "Not subject to VAT" shall contain exactly one VAT breakdown group with the VAT category code equal to "Not subject to VAT".

EN 16931CIIUBL
Technical test (XPath)
not(//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='O']) or ( count(//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='O'])=1 and (exists(//ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='O']) or exists(//ram:CategoryTradeTax[ram:CategoryCode='O'])))
Validate against this rule

BR-S-01

fatal

An Invoice that contains an Invoice line, Document level allowance or Document level charge where the VAT category code is "Standard rate" shall contain in the VAT breakdown at least one VAT category code equal with "Standard rate".

EN 16931CIIUBL
Validate against this rule

BR-S-02

fatal

An Invoice that contains an Invoice line where the Invoiced item VAT category code is "Standard rate" shall contain the Seller VAT Identifier, the Seller tax registration identifier and/or the Seller tax representative VAT identifier.

EN 16931CIIUBL
Technical test (XPath)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedTaxRegistration/ram:ID[@schemeID = ('VA', 'FC')] or /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTaxRepresentativeTradeParty/ram:SpecifiedTaxRegistration/ram:ID[@schemeID = 'VA']
Validate against this rule

BR-Z-01

fatal

An Invoice that contains an Invoice line, Document level allowance or Document level charge where the VAT category code is "Zero rated" shall contain in the VAT breakdown exactly one VAT category code equal with "Zero rated".

EN 16931CIIUBL
Technical test (XPath)
(count(//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='Z'])=0 and count(//ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='Z'])=0 and count(//ram:CategoryTradeTax[ram:CategoryCode='Z'])=0) or ( count(//ram:ApplicableHeaderTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='Z'])=1 and (exists(//ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax[ram:CategoryCode='Z']) or exists(//ram:CategoryTradeTax[ram:CategoryCode='Z'])))
Validate against this rule

BR-Z-02

fatal

An Invoice that contains an Invoice line where the Invoiced item VAT category code is "Zero rated" shall contain the Seller VAT Identifier, the Seller tax registration identifier and/or the Seller tax representative VAT identifier.

EN 16931CIIUBL
Technical test (XPath)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedTaxRegistration/ram:ID[@schemeID = ('VA', 'FC')] or /rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTaxRepresentativeTradeParty/ram:SpecifiedTaxRegistration/ram:ID[@schemeID = 'VA']
Validate against this rule

EN 16931 — decimal rules (14)

BR-DEC-01

fatal

The allowed maximum number of decimals for the Document level allowance amount (BT-92) is 2.

EN 16931CIIUBLBT-92
Technical test (XPath)
string-length(substring-after(../ram:ActualAmount,'.'))<=2
Validate against this rule

BR-DEC-02

fatal

The allowed maximum number of decimals for the Document level allowance base amount (BT-93) is 2.

EN 16931CIIUBLBT-93
Technical test (XPath)
string-length(substring-after(../ram:BasisAmount,'.'))<=2
Validate against this rule

BR-DEC-05

fatal

The allowed maximum number of decimals for the Document level charge amount (BT-99) is 2.

EN 16931CIIUBLBT-99
Technical test (XPath)
string-length(substring-after(../ram:ActualAmount,'.'))<=2
Validate against this rule

BR-DEC-06

fatal

The allowed maximum number of decimals for the Document level charge base amount (BT-100) is 2.

EN 16931CIIUBLBT-100
Technical test (XPath)
string-length(substring-after(../ram:BasisAmount,'.'))<=2
Validate against this rule

BR-DEC-09

fatal

The allowed maximum number of decimals for the Sum of Invoice line net amount (BT-106) is 2.

EN 16931CIIUBLBT-106
Technical test (XPath)
string-length(substring-after(ram:LineTotalAmount,'.'))<=2
Validate against this rule

BR-DEC-10

fatal

The allowed maximum number of decimals for the Sum of allowances on document level (BT-107) is 2.

EN 16931CIIUBLBT-107
Technical test (XPath)
string-length(substring-after(ram:AllowanceTotalAmount,'.'))<=2
Validate against this rule

BR-DEC-11

fatal

The allowed maximum number of decimals for the Sum of charges on document level (BT-108) is 2.

EN 16931CIIUBLBT-108
Technical test (XPath)
string-length(substring-after(ram:ChargeTotalAmount,'.'))<=2
Validate against this rule

BR-DEC-12

fatal

The allowed maximum number of decimals for the Invoice total amount without VAT (BT-109) is 2.

EN 16931CIIUBLBT-109
Technical test (XPath)
string-length(substring-after(ram:TaxBasisTotalAmount,'.'))<=2
Validate against this rule

BR-DEC-13

fatal

The allowed maximum number of decimals for the Invoice total VAT amount (BT-110) is 2.

EN 16931CIIUBLBT-110
Technical test (XPath)
not(ram:TaxTotalAmount) or ram:TaxTotalAmount[(@currencyID =/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode and . = round(. * 100) div 100) or not (@currencyID =/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceCurrencyCode)]
Validate against this rule

BR-DEC-14

fatal

The allowed maximum number of decimals for the Invoice total amount with VAT (BT-112) is 2.

EN 16931CIIUBLBT-112
Technical test (XPath)
string-length(substring-after(ram:GrandTotalAmount,'.'))<=2
Validate against this rule

BR-DEC-15

fatal

The allowed maximum number of decimals for the Invoice total VAT amount in accounting currency (BT-111) is 2.

EN 16931CIIUBLBT-111
Technical test (XPath)
not(ram:TaxTotalAmount) or ram:TaxTotalAmount[(@currencyID =/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:TaxCurrencyCode and . = round(. * 100) div 100) or not (/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:TaxCurrencyCode)]
Validate against this rule

BR-DEC-16

fatal

The allowed maximum number of decimals for the Paid amount (BT-113) is 2.

EN 16931CIIUBLBT-113
Technical test (XPath)
string-length(substring-after(ram:TotalPrepaidAmount,'.'))<=2
Validate against this rule

BR-DEC-17

fatal

The allowed maximum number of decimals for the Rounding amount (BT-114) is 2.

EN 16931CIIUBLBT-114
Technical test (XPath)
string-length(substring-after(ram:RoundingAmount,'.'))<=2
Validate against this rule

BR-DEC-18

fatal

The allowed maximum number of decimals for the Amount due for payment (BT-115) is 2.

EN 16931CIIUBLBT-115
Technical test (XPath)
string-length(substring-after(ram:DuePayableAmount,'.'))<=2
Validate against this rule

PEPPOL BIS 3.0 (38)

PEPPOL-COMMON-R042

fatal

Danish organization number (CVR) MUST be stated in the correct format.

PEPPOL BIS 3.0UBL
Technical test (XPath)
(string-length(string()) = 10 and substring(string(), 1, 2) = 'DK' and string-length(translate(substring(string(), 3, 8), '1234567890', '')) = 0) or (string-length(string()) = 8) and (string-length(translate(substring(string(), 1, 8),'1234567890', '')) = 0)
Validate against this rule

PEPPOL-COMMON-R049

fatal

Swedish organization number MUST be stated in the correct format.

PEPPOL BIS 3.0UBL
Technical test (XPath)
string-length(normalize-space()) = 10 and string(number(normalize-space())) != 'NaN' and u:checkSEOrgnr(normalize-space())
Validate against this rule

PEPPOL-EN16931-R004

fatal

Specification identifier MUST have the value 'urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0'.

PEPPOL BIS 3.0UBL
Technical test (XPath)
starts-with(normalize-space(cbc:CustomizationID/text()), 'urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0')
Validate against this rule

PEPPOL-EN16931-R005

fatal

VAT accounting currency code MUST be different from invoice currency code when provided.

PEPPOL BIS 3.0XRechnung 3.xCIIUBL
Technical test (XPath)
not(normalize-space(text()) = normalize-space(../cbc:DocumentCurrencyCode/text()))
Validate against this rule

PEPPOL-EN16931-R043

fatal

Allowance/charge ChargeIndicator value MUST equal 'true' or 'false'.

PEPPOL BIS 3.0XRechnung 3.xUBL
Technical test (XPath)
normalize-space(cbc:ChargeIndicator/text()) = 'true' or normalize-space(cbc:ChargeIndicator/text()) = 'false'
Validate against this rule

PEPPOL-EN16931-R046

fatal

Item net price MUST equal (Gross price - Allowance amount) when gross price is provided.

PEPPOL BIS 3.0XRechnung 3.xCIIUBL
Technical test (XPath)
not(cbc:BaseAmount) or xs:decimal(../cbc:PriceAmount) = xs:decimal(cbc:BaseAmount) - xs:decimal(cbc:Amount)
Validate against this rule

PEPPOL-EN16931-R051

fatal

All currencyID attributes must have the same value as the invoice currency code (BT-5), except for the invoice total VAT amount in accounting currency (BT-111).

PEPPOL BIS 3.0UBLBT-5BT-111
Technical test (XPath)
@currencyID = $documentCurrencyCode
Validate against this rule

PEPPOL-EN16931-R054

fatal

Only one tax total without tax subtotals MUST be provided when tax currency code is provided.

PEPPOL BIS 3.0XRechnung 3.xCIIUBL
Technical test (XPath)
count(cac:TaxTotal[not(cac:TaxSubtotal)]) = (if (cbc:TaxCurrencyCode) then 1 else 0)
Validate against this rule

PEPPOL-EN16931-R055

fatal

Invoice total VAT amount and Invoice total VAT amount in accounting currency MUST have the same operational sign.

PEPPOL BIS 3.0XRechnung 3.xCIIUBL
Technical test (XPath)
not(cbc:TaxCurrencyCode) or (cac:TaxTotal/cbc:TaxAmount[@currencyID=normalize-space(../../cbc:TaxCurrencyCode)] <= 0 and cac:TaxTotal/cbc:TaxAmount[@currencyID=normalize-space(../../cbc:DocumentCurrencyCode)] <= 0) or (cac:TaxTotal/cbc:TaxAmount[@currencyID=normalize-space(../../cbc:TaxCurrencyCode)] >= 0 and cac:TaxTotal/cbc:TaxAmount[@currencyID=normalize-space(../../cbc:DocumentCurrencyCode)] >= 0)
Validate against this rule

PEPPOL-EN16931-R101

fatal

Element Document reference can only be used for Invoice line object.

PEPPOL BIS 3.0XRechnung 3.xCIIUBL
Technical test (XPath)
(not(cac:DocumentReference) or (cac:DocumentReference/cbc:DocumentTypeCode='130'))
Validate against this rule

PEPPOL-EN16931-R120

fatal

Invoice line net amount MUST equal (Invoiced quantity * (Item net price/item price base quantity) + Sum of invoice line charge amount - sum of invoice line allowance amount.

PEPPOL BIS 3.0XRechnung 3.xUBL
Technical test (XPath)
u:slack($lineExtensionAmount, ($quantity * ($priceAmount div $baseQuantity)) + $chargesTotal - $allowancesTotal, 0.02)
Validate against this rule

National CIUS (DK) (13)

DK-R-002

fatal

Danish suppliers MUST provide legal entity (CVR-number).

PEPPOL BIS 3.0UBL
Technical test (XPath)
(normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID/text()) != '')
Validate against this rule

DK-R-003

warning

Danish Suppliers MUST provide legal entity identifier (CVR number) when Item Classification Code is TST.

PEPPOL BIS 3.0UBL
Technical test (XPath)
not((cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode/@listID = 'TST') and not((cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode/@listVersionID = '19.05.01') or (cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode/@listVersionID = '19.0501') or (cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode/@listVersionID = '26.08.01') or (cac:Item/cac:CommodityClassification/cbc:ItemClassificationCode/@listVersionID = '26.0801') ) )
Validate against this rule

DK-R-004

fatal

Danish Suppliers MUST provide reason text when Allowance/Charge reason code is ZZZ.

PEPPOL BIS 3.0UBL
Technical test (XPath)
not((cbc:AllowanceChargeReasonCode = 'ZZZ') and not(((string-length(normalize-space(cbc:AllowanceChargeReason/text())) = 4) and (number(cbc:AllowanceChargeReason) >= 0) and (number(cbc:AllowanceChargeReason) <= 9999)) or (((cbc:AllowanceChargeReason and contains(cbc:AllowanceChargeReason, '#') and not(starts-with(cbc:AllowanceChargeReason, '#')) and not(ends-with(cbc:AllowanceChargeReason, '#')))) ) ) )
Validate against this rule

DK-R-005

fatal

For Danish suppliers the following Payment means codes are allowed: 1, 10, 31, 42, 48, 49, 50, 58, 59, 93 and 97.

PEPPOL BIS 3.0UBL
Technical test (XPath)
contains(' 1 10 31 42 48 49 50 58 59 93 97 ', concat(' ', cbc:PaymentMeansCode, ' '))
Validate against this rule

DK-R-006

fatal

For Danish Suppliers bank account and routing numbers are mandatory for payment by bank transfer.

PEPPOL BIS 3.0UBL
Technical test (XPath)
not(((cbc:PaymentMeansCode = '31') or (cbc:PaymentMeansCode = '42')) and not((normalize-space(cac:PayeeFinancialAccount/cbc:ID/text()) != '') and (normalize-space(cac:PayeeFinancialAccount/cac:FinancialInstitutionBranch/cbc:ID/text()) != '')) )
Validate against this rule

DK-R-007

fatal

For Danish Suppliers PaymentMandate ID and Seller account ID are mandatory for direct debit.

PEPPOL BIS 3.0UBL
Technical test (XPath)
not((cbc:PaymentMeansCode = '49') and not((normalize-space(cac:PaymentMandate/cbc:ID/text()) != '') and (normalize-space(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID/text()) != '')) )
Validate against this rule

DK-R-008

fatal

For Danish Suppliers PaymentCard primary account number is mandatory for payment by card.

PEPPOL BIS 3.0UBL
Technical test (XPath)
not((cbc:PaymentMeansCode = '50') and not(((substring(cbc:PaymentID, 1, 3) = '01#') or (substring(cbc:PaymentID, 1, 3) = '04#') or (substring(cbc:PaymentID, 1, 3) = '15#')) and matches(cac:PayeeFinancialAccount/cbc:ID, '^[0-9]{7,8}$') ) )
Validate against this rule

DK-R-009

fatal

For Danish Suppliers PaymentCard holder name is mandatory for payment by card.

PEPPOL BIS 3.0UBL
Technical test (XPath)
not((cbc:PaymentMeansCode = '50') and ((substring(cbc:PaymentID, 1, 3) = '04#') or (substring(cbc:PaymentID, 1, 3) = '15#')) and not(string-length(cbc:PaymentID) = 19) )
Validate against this rule

DK-R-010

fatal

For Danish Suppliers FinancialInstitutionBranch ID is mandatory for payment type 93.

PEPPOL BIS 3.0UBL
Technical test (XPath)
not((cbc:PaymentMeansCode = '93') and not(((substring(cbc:PaymentID, 1, 3) = '71#') or (substring(cbc:PaymentID, 1, 3) = '73#') or (substring(cbc:PaymentID, 1, 3) = '75#')) and (string-length(cac:PayeeFinancialAccount/cbc:ID/text()) = 8) ) )
Validate against this rule

DK-R-011

fatal

For Danish Suppliers PayeeFinancialAccount ID is mandatory for payment type 93.

PEPPOL BIS 3.0UBL
Technical test (XPath)
not((cbc:PaymentMeansCode = '93') and ((substring(cbc:PaymentID, 1, 3) = '71#') or (substring(cbc:PaymentID, 1, 3) = '75#')) and not((string-length(cbc:PaymentID) = 18) or (string-length(cbc:PaymentID) = 19)) )
Validate against this rule

DK-R-013

fatal

For Danish Suppliers only positive values are allowed for the InvoicedQuantity.

PEPPOL BIS 3.0UBL
Technical test (XPath)
not((boolean(cbc:ID)) and (normalize-space(cbc:ID/@schemeID) = '') )
Validate against this rule

DK-R-014

fatal

For Danish Suppliers DocumentCurrencyCode must match TaxCurrencyCode when provided.

PEPPOL BIS 3.0UBL
Technical test (XPath)
not(((boolean(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID)) and (normalize-space(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID/@schemeID) != '0184')) )
Validate against this rule

DK-R-016

fatal

For Danish Credit Notes with Danish Buyer, a preceding invoice reference must be provided.

PEPPOL BIS 3.0UBL
Technical test (XPath)
not((boolean(/ubl-creditnote:CreditNote) and ($DKCustomerCountry = 'DK')) and (number(cac:LegalMonetaryTotal/cbc:PayableAmount/text()) < 0) )
Validate against this rule

National CIUS (GR) (17)

GR-R-001-2

fatal

When Supplier is Greek, the Invoice ID first segment must be a valid 9 digit Tax ID.

PEPPOL BIS 3.0UBL
Technical test (XPath)
string-length(normalize-space($IdSegments[1])) = 9 and u:TinVerification($IdSegments[1]) and ($IdSegments[1] = /*/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 3, 9) or $IdSegments[1] = /*/cac:TaxRepresentativeParty/cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/substring(cbc:CompanyID, 3, 9) )
Validate against this rule

GR-R-003

fatal

For the Greek Suppliers, the VAT must start with 'EL' and must be a valid TIN number.

PEPPOL BIS 3.0UBL
Technical test (XPath)
substring(.,1,2) = 'EL' and u:TinVerification(substring(.,3))
Validate against this rule

GR-R-004-1

fatal

When Supplier is Greek, there must be one MARK Number.

PEPPOL BIS 3.0UBL
Technical test (XPath)
count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##M.AR.K##'])=1
Validate against this rule

GR-R-006

fatal

For Greek buyers, the invoice MUST contain their VAT number.

PEPPOL BIS 3.0UBL
Technical test (XPath)
count(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID)=1 and substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID,1,2) = 'EL' and u:TinVerification(substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID,3))
Validate against this rule

GR-R-008-2

fatal

When Supplier is Greek, there should be no more than one invoice url.

PEPPOL BIS 3.0UBL
Technical test (XPath)
(count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##INVOICE|URL##']) = 0 ) or (count(cac:AdditionalDocumentReference[cbc:DocumentDescription = '##INVOICE|URL##']) = 1 )
Validate against this rule

GR-R-009

fatal

Greek suppliers that send an invoice through the PEPPOL network must use a correct TIN number as an electronic address.

PEPPOL BIS 3.0UBL
Technical test (XPath)
./@schemeID='9933' and u:TinVerification(.)
Validate against this rule

GR-R-010

fatal

Greek Suppliers that send an invoice through the PEPPOL network to a greek buyer must use a correct TIN number as an electronic address.

PEPPOL BIS 3.0UBL
Technical test (XPath)
./@schemeID='9933' and u:TinVerification(.)
Validate against this rule

National CIUS (IS) (6)

IS-R-002

fatal

If seller is icelandic then it shall contain sellers legal id.

PEPPOL BIS 3.0UBL
Technical test (XPath)
exists(cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID) and cac:AccountingSupplierParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID/@schemeID = '0196'
Validate against this rule

IS-R-003

fatal

If seller is icelandic then it shall contain his address with street name and zip code.

PEPPOL BIS 3.0UBL
Technical test (XPath)
exists(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:StreetName) and exists(cac:AccountingSupplierParty/cac:Party/cac:PostalAddress/cbc:PostalZone)
Validate against this rule

IS-R-004

fatal

If seller and buyer are icelandic then the invoice shall contain the buyers icelandic legal identifier.

PEPPOL BIS 3.0UBL
Technical test (XPath)
exists(cac:Party/cac:PartyLegalEntity/cbc:CompanyID) and cac:Party/cac:PartyLegalEntity/cbc:CompanyID/@schemeID = '0196'
Validate against this rule

IS-R-005

fatal

If seller and buyer are icelandic then the invoice shall contain the buyers address with street name and zip code.

PEPPOL BIS 3.0UBL
Technical test (XPath)
exists(cac:Party/cac:PostalAddress/cbc:StreetName) and exists(cac:Party/cac:PostalAddress/cbc:PostalZone)
Validate against this rule

IS-R-006

fatal

If seller is icelandic and payment means is debit transfer, a valid PayeeFinancialAccount ID must be provided.

PEPPOL BIS 3.0UBL
Technical test (XPath)
exists(cac:PaymentMeans[cbc:PaymentMeansCode = '9']/cac:PayeeFinancialAccount/cbc:ID) and string-length(normalize-space(cac:PaymentMeans[cbc:PaymentMeansCode = '9']/cac:PayeeFinancialAccount/cbc:ID)) = 12 or not(exists(cac:PaymentMeans[cbc:PaymentMeansCode = '9']))
Validate against this rule

IS-R-007

fatal

If seller is icelandic and payment means is bank transfer, a valid PayeeFinancialAccount ID must be provided.

PEPPOL BIS 3.0UBL
Technical test (XPath)
exists(cac:PaymentMeans[cbc:PaymentMeansCode = '42']/cac:PayeeFinancialAccount/cbc:ID) and string-length(normalize-space(cac:PaymentMeans[cbc:PaymentMeansCode = '42']/cac:PayeeFinancialAccount/cbc:ID)) = 12 or not(exists(cac:PaymentMeans[cbc:PaymentMeansCode = '42']))
Validate against this rule

National CIUS (IT) (4)

IT-R-001

fatal

For Italian suppliers BT-32 minimum length 11 and maximum length shall be 16.

PEPPOL BIS 3.0UBLBT-32
Technical test (XPath)
matches(normalize-space(cbc:CompanyID),'^[A-Z0-9]{11,16}$')
Validate against this rule

National CIUS (NL) (9)

NL-R-001

fatal

For suppliers in the Netherlands, if the document is a creditnote, the document MUST contain an invoice reference.

PEPPOL BIS 3.0UBL
Technical test (XPath)
/*/cac:BillingReference/cac:InvoiceDocumentReference/cbc:ID
Validate against this rule

NL-R-002

fatal

For suppliers in the Netherlands the supplier's address MUST contain street name, city and post code.

PEPPOL BIS 3.0UBL
Technical test (XPath)
cbc:StreetName and cbc:CityName and cbc:PostalZone
Validate against this rule

NL-R-003

fatal

For suppliers in the Netherlands, the legal entity identifier MUST be either a KVK or OIN number (schemeID 0106 or 0190).

PEPPOL BIS 3.0UBL
Technical test (XPath)
(contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0106 ') or contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0190 ')) and (normalize-space(.) != '')
Validate against this rule

NL-R-004

fatal

For suppliers in the Netherlands, if the customer is in the Netherlands, the customer address MUST contain the street name, the city and post code.

PEPPOL BIS 3.0UBL
Technical test (XPath)
cbc:StreetName and cbc:CityName and cbc:PostalZone
Validate against this rule

NL-R-005

fatal

For suppliers in the Netherlands, if the customer is in the Netherlands, the customer's legal entity identifier MUST be either a KVK or OIN number.

PEPPOL BIS 3.0UBL
Technical test (XPath)
(contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0106 ') or contains(concat(' ', string-join(@schemeID, ' '), ' '), ' 0190 ')) and (normalize-space(.) != '')
Validate against this rule

NL-R-006

fatal

For suppliers in the Netherlands, if the fiscal representative is in the Netherlands, the representative's address MUST contain street name, city and post code.

PEPPOL BIS 3.0UBL
Technical test (XPath)
cbc:StreetName and cbc:CityName and cbc:PostalZone
Validate against this rule

NL-R-007

fatal

For suppliers in the Netherlands, the supplier MUST provide a means of payment if the payment is from customer to supplier.

PEPPOL BIS 3.0UBL
Technical test (XPath)
(/ubl-invoice:Invoice and xs:decimal(cbc:PayableAmount) <= 0.0) or (/ubl-creditnote:CreditNote and xs:decimal(cbc:PayableAmount) >= 0.0) or (//cac:PaymentMeans)
Validate against this rule

NL-R-008

fatal

For suppliers in the Netherlands, the payment means code should be 30, 48, 49, 57, 58 or 59.

PEPPOL BIS 3.0UBL
Technical test (XPath)
normalize-space(cbc:PaymentMeansCode) = '30' or normalize-space(cbc:PaymentMeansCode) = '48' or normalize-space(cbc:PaymentMeansCode) = '49' or normalize-space(cbc:PaymentMeansCode) = '57' or normalize-space(cbc:PaymentMeansCode) = '58' or normalize-space(cbc:PaymentMeansCode) = '59'
Validate against this rule

NL-R-009

fatal

For suppliers in the Netherlands, if an order line reference is used, there must be an order reference on the document level.

PEPPOL BIS 3.0UBL
Technical test (XPath)
exists(/*/cac:OrderReference/cbc:ID)
Validate against this rule

National CIUS (NO) (2)

NO-R-001

fatal

Norwegian suppliers MUST provide VAT ID in correct format (12 digits + 'MVA').

PEPPOL BIS 3.0UBL
Technical test (XPath)
cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/substring(cbc:CompanyID, 1, 2)='NO' and matches(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/substring(cbc:CompanyID,3), '^[0-9]{9}MVA$') and u:mod11(substring(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/cbc:CompanyID, 3, 9)) or not(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'VAT']/substring(cbc:CompanyID, 1, 2)='NO')
Validate against this rule

NO-R-002

warning

For Norwegian suppliers, most invoice issuers are required to append "Foretaksregisteret" to their registration.

PEPPOL BIS 3.0UBL
Technical test (XPath)
normalize-space(cac:PartyTaxScheme[normalize-space(cac:TaxScheme/cbc:ID) = 'TAX']/cbc:CompanyID) = 'Foretaksregisteret'
Validate against this rule

National CIUS (SE) (13)

SE-R-001

fatal

For Swedish suppliers, Swedish VAT-numbers must consist of 14 characters.

PEPPOL BIS 3.0UBL
Technical test (XPath)
string-length(normalize-space(cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/cbc:CompanyID)) = 14
Validate against this rule

SE-R-002

fatal

For Swedish suppliers, the Swedish VAT-numbers must have the trailing 12 characters in numeric form.

PEPPOL BIS 3.0UBL
Technical test (XPath)
string(number(substring(cac:PartyTaxScheme[cac:TaxScheme/cbc:ID = 'VAT']/cbc:CompanyID, 3, 12))) != 'NaN'
Validate against this rule

SE-R-005

fatal

For Swedish suppliers, when using Seller tax registration identifier, 'Godkand for F-skatt' must be stated.

PEPPOL BIS 3.0UBL
Technical test (XPath)
normalize-space(upper-case(.)) = 'GODKÄND FÖR F-SKATT'
Validate against this rule

SE-R-006

fatal

For Swedish suppliers, only standard VAT rate of 6, 12 or 25 are used.

PEPPOL BIS 3.0UBL
Technical test (XPath)
number(cbc:Percent) = 25 or number(cbc:Percent) = 12 or number(cbc:Percent) = 6
Validate against this rule

SE-R-009

warning

For Swedish suppliers using Bankgiro, the Account ID must have 7-8 characters.

PEPPOL BIS 3.0UBL
Technical test (XPath)
string-length(normalize-space(.)) = 7 or string-length(normalize-space(.)) = 8
Validate against this rule

SE-R-010

warning

For Swedish suppliers using Plusgiro, the Account ID must have 2-8 characters.

PEPPOL BIS 3.0UBL
Technical test (XPath)
string-length(normalize-space(.)) >= 2 and string-length(normalize-space(.)) <= 8
Validate against this rule

SE-R-011

warning

For Swedish suppliers using Swedish Bankgiro or Plusgiro, the proper way to indicate this is to use Code 30 for PaymentMeans and FinancialInstitutionBranch ID with code SE:BANKGIRO or SE:PLUSGIRO.

PEPPOL BIS 3.0UBL
Technical test (XPath)
false()
Validate against this rule

SE-R-012

warning

For domestic transactions between Swedish trading partners, credit transfer should be indicated by PaymentMeansCode="30".

PEPPOL BIS 3.0UBL
Technical test (XPath)
false()
Validate against this rule

SE-R-013

fatal

The last digit of a Swedish organization number must be valid according to the Luhn algorithm.

PEPPOL BIS 3.0UBL
Technical test (XPath)
u:checkSEOrgnr(normalize-space(cbc:CompanyID))
Validate against this rule

Frequently asked questions

What is a PEPPOL / EN 16931 validation rule?

It is a business rule (identified by a code such as BR-CO-13 or PEPPOL-EN16931-R008) that an e-invoice must satisfy to be valid under the EN 16931 European standard or a national CIUS such as PEPPOL BIS 3.0 or XRechnung. Validators run these rules, expressed as schematron, against the invoice XML.

What does a "fatal" rule mean versus a "warning"?

A fatal rule must pass or the invoice is rejected by the receiver. A warning flags a likely mistake but does not block the invoice. Most BR-* and PEPPOL-* rules are fatal; a small number are warnings.

How do I fix a rule violation like BR-CO-13?

Read the rule message — it states exactly which business terms (BT-/BG- codes) must be present or must add up. Correct those fields in your invoice, then re-validate. aiDoks shows the failing rule ID and message for every uploaded invoice.

Which formats use these rules?

EN 16931 is the common core. PEPPOL BIS 3.0, XRechnung, Factur-X/ZUGFeRD and national CIUS profiles (Germany, Denmark, Sweden, Italy, the Netherlands and others) add their own rules on top. This page covers all of them.

What if my rule isn't listed here?

Don't worry — this page highlights the most common rules, but our validator always checks your invoice against the complete rule set (every EN 16931, PEPPOL, XRechnung and Factur-X rule, including the syntax and code-list checks not listed here). Upload your invoice and you'll get every rule that applies, listed on this page or not.

Stop guessing why your invoice failed

Upload your UBL, CII or Factur-X invoice and aiDoks reports every failing rule by ID and message — free, no sign-up required.