Invalid schemeID value for the legal organisation

Error FX-SCH-A-000766 Factur-X

Value of '@schemeID' is not allowed.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

The value of schemeID on ram:SpecifiedLegalOrganization/ram:ID is not in the designated code list. This check also accepts an empty code value.

What the rule means

The code list limits the permitted scheme identifiers for the legal organisation’s identifier.

Please use an allowed `schemeID` value for the legal organisation

The schemeID value on the tax representative’s legal organisation identifier is not in the designated code list. Using a value allowed by that list resolves the error.

What to do
  1. Locate ram:ID in the tax representative’s ram:SpecifiedLegalOrganization.
  2. Check the schemeID value against the code list designated for this identifier.
  3. Generate the invoice again and validate it.
Technical details

The test accepts an empty code value or a value present in the code list identified by 12.

Where the rule applies

The rule applies to the schemeID attribute of ram:ID in ram:SpecifiedLegalOrganization for the seller’s tax representative.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ ram:SellerTaxRepresentativeTradeParty/ram:SpecifiedLegalOrganization/ram:ID
Test expression (assert/@test)
string-length($codeValue12)=0 or document('FACTUR-X_EXTENDED_codedb.xml')/codedb/cl[@id=12]/enumeration[@value=$codeValue12]