Attestwire › Rule reference › BR-CL-24
BR-CL-24 An attachment must use one of the MIME types EN 16931 allows
noun · EN 16931 · fatal · BT-125
For a sample invoice, the library reports: The attachment on supporting document 1 declares the mime code "application/zip" (BT-125-1), which EN 16931 does not admit.
- Business term
BT-125- Severity
fatal
The fix
Set supportingDocuments[].attachment.mimeCode to one of the six admitted values — "application/pdf" is the safe default, and converting to PDF is usually easier than arguing with a receiving portal. Use externalUri (BT-124) to point at a document you cannot embed in an accepted format.
A passing value
"attachment": { "filename": "timesheet.pdf", "mimeCode": "application/pdf", "content": "JVBERi0xLjQK" }What the library returns
The full error returned by @attestwire/en16931. It includes the rule ID,
affected field and suggested correction. Developers can use this object in their application:
{
"rule": "BR-CL-24",
"field": "BT-125",
"severity": "fatal",
"message": "The attachment on supporting document 1 declares the mime code \"application/zip\" (BT-125-1), which EN 16931 does not admit. The list has exactly 6 entries — \"application/pdf\", \"image/png\", \"image/jpeg\", \"text/csv\", \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\" and \"application/vnd.oasis.opendocument.spreadsheet\" — and the shortness is the point: an invoice attachment has to be openable by a receiver, without the sender's software, ten years from now, and without executing anything. That rules out archives (which can hide anything), word-processor formats with macro capability, and vector formats that carry script. A perfectly legitimate ZIP of evidence still fails.",
"fix": "Set supportingDocuments[].attachment.mimeCode to one of the six admitted values — \"application/pdf\" is the safe default, and converting to PDF is usually easier than arguing with a receiving portal. Use externalUri (BT-124) to point at a document you cannot embed in an accepted format.",
"example": "\"attachment\": { \"filename\": \"timesheet.pdf\", \"mimeCode\": \"application/pdf\", \"content\": \"JVBERi0xLjQK\" }",
"xpath": "/ubl:Invoice/cac:AdditionalDocumentReference[1]/cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@mimeCode",
"docsUrl": "https://attestwire.com/rules/BR-CL-24"
}
xpath is always a UBL path. On a CII invoice, look for the
matching CII field instead.