MIME codes for e-invoice attachments: PDF, PNG, JPEG, CSV, XLSX and ODS
An e-invoice can carry supporting documents as embedded files, e.g. a delivery note or a timesheet. Every embedded file needs a MIME code that states the file format. EN 16931 permits only six media types for this: PDF, PNG, JPEG, CSV, Excel workbook (XLSX) and OpenDocument spreadsheet (ODS).
Other formats such as Word, XML or ZIP make the validation fail.
Check whether your e-invoice uses valid codes, or create an e-invoice in the form and pick the codes from selection lists.
Where does the code belong?
The MIME code is BT-125-1 (Attached document Mime code) and belongs to the embedded attachment (BT-125) in the group additional supporting documents (BG-24), together with the file name (BT-125-2). A reference to an external document by address (BT-124) has no MIME code.
In CII it is the attribute mimeCode on ram:AdditionalReferencedDocument/ram:AttachmentBinaryObject, in UBL the attribute mimeCode on cbc:EmbeddedDocumentBinaryObject.
The code must be written exactly as in the list, in lower case.
Fields in the glossary: BT-125-1
Permitted codes
All codes that EN 16931 permits for this field. Any other code makes the validation fail.
| Code | Meaning | Explanation |
|---|---|---|
application/pdf |
PDF document | For supporting documents such as delivery notes, timesheets or statements. |
image/png |
PNG image | For images such as screenshots or graphics. |
image/jpeg |
JPEG image | For photos and scans. The spelling is image/jpeg, not image/jpg. |
text/csv |
CSV file | A table as text with separators, e.g. a list of individual services. |
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
Excel workbook (XLSX) | For spreadsheets in the .xlsx format. The older .xls format is not permitted. |
application/vnd.oasis.opendocument.spreadsheet |
OpenDocument spreadsheet (ODS) | For spreadsheets in the .ods format, e.g. from LibreOffice Calc. |
Typical errors
-
The MIME code is misspelled, e.g. image/jpg instead of image/jpeg, or in upper case.
Validation rule: BR-CL-24 -
The attachment has a format that is not permitted, e.g. Word, XML or ZIP.
Validation rule: BR-CL-24 -
The file extension was given instead of the MIME code, e.g. pdf.
Validation rule: BR-CL-24
In E-Rechnungsfreund
In the invoice form, expert view, section "Additional documents (BG-24)", choose "Local file" as "Source" and select an entry matching the file format in the field "MIME code (BT-125-1)". The list only contains the permitted media types.
Source and license
Source of the codes: IANA, Media Types. The complete and binding list is available there. EN 16931 permits only part of the codes for e-invoices.
The meanings and explanations of the frequently used codes and the notes on typical errors are editorial texts and not part of the source.
Explanation of the code list, not legal or tax advice.