BR-KSA-CL-03: Attachment mimeCode must be one of the allowed types

Explained by Matheel from ZATCA's rule text and the condition SDK 3.4.8 executes · Updated

Error: the invoice is rejectedAll invoicesFields: —

Every cac:AdditionalDocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject must have @mimeCode equal to one of: text/csv, text/plain, application/pdf, image/png, image/jpeg, image/tiff, application/acad, application/dwg, drawing/dwg, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.oasis.opendocument.spreadsheet.

How to fix it

Use a listed value, e.g. <cbc:EmbeddedDocumentBinaryObject mimeCode="text/plain">...</cbc:EmbeddedDocumentBinaryObject> for the PIH and QR attachments.

ZATCA's official text

[BR-KSA-CL-03]-Mime code must be according to subset of IANA code list.
Source: ZATCA SDK 3.4.8 · ZATCA KSA rules

Fails when (the condition ZATCA's SDK runs)

not(((not(contains(normalize-space(@mimeCode), ' ')) and contains(' text/csv text/plain application/pdf image/png image/jpeg image/tiff application/acad application/dwg drawing/dwg application/vnd.openxmlformats-officedocument.spreadsheetml.sheet application/vnd.oasis.opendocument.spreadsheet ', concat(' ', normalize-space(@mimeCode), ' ')))))

Related rules

Validate your invoice against ZATCA's rules

Paste the XML and see every error and warning. It runs in your browser; the invoice goes nowhere.

Validate an invoice or try Matheel