Automation MCP Server Features Blog Pricing Contact
Validation rule EN 16931 core

BR-CL-24

An e-invoice can carry supporting documents, but not in any format: BR-CL-24 restricts the MIME code of an embedded attachment (BT-125-1) to six types. PDF, two image formats, CSV and two spreadsheet formats pass; everything else, from ZIP to DOCX, fails.

What BR-CL-24 checks

BR-CL-24 is a code list rule for embedded attachments: the MIME code of an attached document (BT-125-1) must come from the small list EN 16931 permits. An additional supporting document (BG-24) can embed its file as a base64 binary; the mimeCode attribute declares what the bytes are, and only application/pdf, image/png, image/jpeg, text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet and application/vnd.oasis.opendocument.spreadsheet are acceptable. The restriction keeps receiver-side processing predictable: every compliant attachment is viewable or tabular, never executable or opaque.

Layer and formats

An en16931 core layer rule for every syntax and profile, from plain UBL and CII through XRechnung and Peppol BIS to the XML inside hybrid PDFs. National overlays add their own attachment rules on top (XRechnung, for instance, additionally requires unique filenames) but none widens the MIME list.

Why it fails in practice

  • ZIP bundles. Several supporting files are zipped into one attachment; application/zip is not on the list.
  • Office documents. Timesheets and acceptance protocols attached as DOCX or XLS (the legacy type) instead of PDF or XLSX.
  • Sloppy or generic codes. The generator writes application/octet-stream for everything, or image/jpg instead of image/jpeg.

How to fix it

Convert the file to an allowed format and declare its true type:

<cac:AdditionalDocumentReference>
  <cbc:ID>TIMESHEET-2026-07</cbc:ID>
  <cac:Attachment>
    <cbc:EmbeddedDocumentBinaryObject mimeCode="application/pdf"
        filename="timesheet-july.pdf">JVBERi0xLjcK...</cbc:EmbeddedDocumentBinaryObject>
  </cac:Attachment>
</cac:AdditionalDocumentReference>

In an InvoiceXML create request each attachment is an entry of invoice.supportingDocuments with an attachmentMimeCode; an off-list code is rejected before any XML is built.

The raw rejection vs the InvoiceXML finding

The raw Schematron verdict names a code list without telling you its contents:

<svrl:failed-assert id="BR-CL-24" flag="fatal"
    location="/*:Invoice[namespace-uri()='...']/cac:AdditionalDocumentReference[1]
      /cac:Attachment[1]/cbc:EmbeddedDocumentBinaryObject[1]/@mimeCode">
  <svrl:text>[BR-CL-24]-For Mime code in attribute use MIMEMediaType.</svrl:text>
</svrl:failed-assert>

The InvoiceXML finding spells the list out and even carries the index of the offending attachment:

{
  "rule": "BR-CL-24",
  "layer": "en16931",
  "line": null,
  "message": "The attached document mime code (BT-125-1) is not allowed. EN 16931 accepts only: application/pdf, image/png, image/jpeg, text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.oasis.opendocument.spreadsheet.",
  "btCodes": ["BT-125-1"],
  "fields": ["supportingDocuments[0].attachmentMimeCode"],
  "raw": "[BR-CL-24] EN16931: For Mime code in attribute use MIMEMediaType."
}

The finding names the exact array entry to fix, index included, so a UI with several attachments highlights the right one. No code list to look up, and clients localize by the stable rule key.

Work with attachments

Validate a document in the UBL validator or the XRechnung validator. To read the other direction, POST /v1/extract/attachments unpacks every embedded document from a received invoice into a ZIP, the natural companion to this rule. Attach files at creation time via supportingDocuments on POST /v1/create/ubl or POST /v1/create/facturx.

Frequently asked questions

Which MIME types does EN 16931 allow for attachments?

Exactly six: application/pdf, image/png, image/jpeg, text/csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet (XLSX), and application/vnd.oasis.opendocument.spreadsheet (ODS). The list is closed; there is no profile that extends it.

How do I attach a Word document or a ZIP archive?

Convert it. Timesheets and reports become PDF; data dumps become CSV or XLSX. If a receiver genuinely needs the original format, reference it externally via BT-124 (external document location) instead of embedding it, since the MIME restriction applies to the embedded binary (BT-125).

Does the code have to match the actual bytes?

BR-CL-24 checks only the declared code against the list, but receivers routinely sniff the payload, and a PDF declared as image/png will fail downstream even though validation passed. Declare the type the bytes really are.

How do I get the attachments out of an invoice I received?

POST the invoice to /v1/extract/attachments and you get the embedded documents back as a ZIP, decoded and named. It pairs with /v1/extract/json for the structured data and /v1/parse/json for documents with no structured XML at all.