# 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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api.qvalia.io/qvalia-developer-tools/attachments-to-messages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
