Unallowed identification scheme code for the legal organization

Error FX-SCH-A-000661 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

If @schemeID contains a value, that value must be included in the specified code list for identification schemes. A value not listed there is not allowed.

What the rule means

The identification scheme indicates the system used to interpret the legal organization’s identifier.

Please choose an allowed identification scheme for the legal organization

The legal organization’s identification scheme is not included in the specified code list. Choosing a scheme from that list will resolve the issue.

What to do
  1. Locate ram:SpecifiedLegalOrganization under the buyer agent.
  2. Check the value of @schemeID on ram:ID against the specified code list.
  3. Regenerate the invoice and validate it again.
Technical details

The test allows an empty value. A non-empty value must occur as an enumeration in the code list with cl ID 12.

Where the rule applies

The checked attribute is @schemeID on ram:ID in ram:SpecifiedLegalOrganization of the buyer agent.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ ram:BuyerAgentTradeParty/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]