Allowed document type code

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

The value of ram:TypeCode is not empty and is not included in the code list used by this rule. An empty value explicitly satisfies this rule’s test.

What the rule means

The code list limits the document type to standardized values so that the referenced document type can be interpreted consistently.

Please use an allowed code for the referenced document

The code in ram:TypeCode is not recognized as allowed by this rule. You can check the value against the code list that applies to this field.

What to do
  1. Check the value in ram:TypeCode of the relevant ram:AdditionalReferencedDocument.
  2. Compare the value with the codes allowed for this field.
  3. Generate the invoice again and validate it once more.
Technical details

The test accepts an empty value or a value found in code list 38 in FACTUR-X_EXTENDED_codedb.xml.

Where the rule applies

The rule applies to ram:TypeCode in a document-level ram:AdditionalReferencedDocument whose ram:TypeCode is 916.

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