Use an allowed type code for the document

Error FX-SCH-A-000565 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 contains a value that is not in the code list used by this rule, the value is not allowed. An empty value is also accepted by this test.

What the rule means

The code list defines which type codes are accepted for the embedded document reference. This classifies the reference using a defined value.

Please use an allowed type code for the embedded document

The supplied ram:TypeCode value is not in the code list allowed by this rule. Use a value from that list or leave the value empty.

What to do
  1. Check the value of ram:TypeCode in the relevant ram:AdditionalReferencedDocument.
  2. Use a value listed in code list 20 or leave the value empty.
  3. Generate the invoice again and validate it once more.
Technical details

The test accepts an empty code value or a value listed in code list 20.

Where the rule applies

The rule checks the value of ram:TypeCode in an ram:AdditionalReferencedDocument for the embedded document.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ ram:AdditionalReferencedDocument[ram:TypeCode="916"]/ram:TypeCode
Test expression (assert/@test)
string-length($codeValue20)=0 or document('FACTUR-X_EN16931_codedb.xml')/codedb/cl[@id=20]/enumeration[@value=$codeValue20]