Use an allowed scheme value for the legal organization ID

Error FX-SCH-A-000721 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 provided for schemeID on ram:ID is not included in the list of values allowed for this legal organization ID. The check also accepts an empty value.

What the rule means

The schemeID value specifies the scheme used to interpret the legal organization ID. A value that is not allowed cannot be reliably associated with an accepted scheme.

Please use an allowed scheme value for the legal organization ID

The schemeID value on ram:ID for the legal organization ID is not allowed. Change it to a value from the list provided for this ID.

What to do
  1. Check the value of the schemeID attribute on ram:ID in ram:SpecifiedLegalOrganization.
  2. Compare it with the values allowed for this scheme.
  3. Regenerate the invoice and validate it again.
Technical details

The value is checked against list 12 in FACTUR-X_EXTENDED_codedb.xml; an empty value also passes the check.

Where the rule applies

The rule applies to the schemeID attribute of ram:ID in ram:SpecifiedLegalOrganization of ram:ProductEndUserTradeParty in the invoice agreement.

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