# Attachments to messages

Often our customers wants to add, or request, attached documents to their messages, e.g. their invoices.

We support all the same attachments as Peppol does: [Peppol media types](https://docs.peppol.eu/poacc/billing/3.0/bis/#media-type)

| SUPPORTED FILE TYPES |                                                                                                                             |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| **Do**cuments        | application/pdf                                                                                                             |
| Images               | image/png image/jpeg                                                                                                        |
| Text                 | text/csv                                                                                                                    |
| Spreadsheet          | <p>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet application/vnd.oasis.opendocument.spreadsheet<br></p> |

### Technical details <a href="#technical-details" id="technical-details"></a>

Any attachment has to be `base64` encoded and added under the `AdditionalDocumentReference` element; <https://docs.peppol.eu/poacc/billing/3.0/syntax/ubl-invoice/cac-AdditionalDocumentReference/cac-Attachment/>

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">JSON</td><td valign="top">XML</td></tr><tr><td valign="top"><pre class="language-json" data-overflow="wrap"><code class="lang-json">{
  "AdditionalDocumentReference": [
    {
      "ID": [
        {
          "_": "InvocieSpecification01"
        }
      ],
      "DocumentType": [
        {
          "_": "Specification"
        }
      ],
      "Attachment": [
        {
          "EmbeddedDocumentBinaryObject": [
            {
              "_": "UjBsR09EbGhjZ0dTQUxNQUFBUUNBRU1tQ1p0dU1GUXhEUzhi",
              "mimeCode": "application/pdf",
              "filename": "InvocieSpecification01.pdf"
            }
          ]
        }
      ]
    }
  ]
}
</code></pre></td><td valign="top"><pre class="language-xml" data-overflow="wrap"><code class="lang-xml">&#x3C;cac:AdditionalDocumentReference>
  &#x3C;cbc:ID>InvocieSpecification01&#x3C;/cbc:ID>
  &#x3C;cac:Attachment>
    &#x3C;cbc:EmbeddedDocumentBinaryObject mimeCode="application/pdf" filename="InvocieSpecification01.pdf">UjBsR09EbGhjZ0dTQUxNQUFBUUNBRU1tQ1p0dU1GUXhEUzhi&#x3C;/cbc:EmbeddedDocumentBinaryObject>
  &#x3C;/cac:Attachment>
&#x3C;/cac:AdditionalDocumentReference>
</code></pre><p><br></p></td></tr></tbody></table>
