Allowed TypeCode value

Error FX-SCH-A-001025 Factur-X

Value of 'ram:TypeCode' 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 ram:TypeCode has a value, it must be listed in the value list used by this rule. A value not listed there is not allowed; an empty value also satisfies this check.

What the rule means

The code identifies the type of referenced document. The value list ensures that this information is represented consistently using defined values.

Please use an allowed value for TypeCode

The specified document type code is not included in the value list used by this rule. Use a value listed there or leave the element value empty.

What to do
  1. Check the value of ram:TypeCode.
  2. Replace a value not listed in the value list used by this rule with a listed value, or leave the element value empty.
  3. Generate the invoice again and validate it.
What it looks like
✓ Correct
<ram:TypeCode/>
Technical details

The test accepts an empty element value or a value present in enumeration 18 of the referenced code list.

Where the rule applies

The rule checks the value of ram:TypeCode on the referenced document on the agreement level of an invoice line.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:SpecifiedLineTradeAgreement/ram:AdditionalReferencedDocument/ram:TypeCode
Test expression (assert/@test)
string-length($codeValue18)=0 or document('FACTUR-X_EXTENDED_codedb.xml')/codedb/cl[@id=18]/enumeration[@value=$codeValue18]