InvoiceValidator.eu

UBL-CR-665

warningEN 16931syntax binding ruleUBL

A UBL invoice should not include the AdditionalDocumentReference ID schemeID unless the DocumentTypeCode equals '130'

Why it fails

A schemeID attribute sits on an AdditionalDocumentReference/ID whose DocumentTypeCode is not '130' (or is missing). In UBL, code 130 marks the supporting reference that carries the Invoiced object identifier (BT-18), and that is the only document reference EN 16931 lets you qualify with a scheme. On any other supporting document the identifier is a plain string, so a schemeID has nothing to mean.

How to fix it

Either drop the schemeID attribute from that cbc:ID, or — if you really are pointing at an invoiced object such as a subscription, meter or contract line — set the sibling cbc:DocumentTypeCode to 130 and keep the scheme. Do not blanket-remove every schemeID: the one on the DocumentTypeCode 130 reference is required to say which identifier scheme BT-18 uses.

What the validator checks

UBL — context /ubl:Invoice | /cn:CreditNote

not(//cac:AdditionalDocumentReference[cbc:DocumentTypeCode != '130' or not(cbc:DocumentTypeCode)]/cbc:ID/@schemeID)

Related rules

Part of UBL-CR — UBL restrictions.

Check your own invoice against UBL-CR-665

…or paste the XML instead

Nothing is stored, and the whole invoice is checked, not just this rule. A PDF only works if it is Factur-X / ZUGFeRD — a PDF with the invoice XML inside it.