#
Attachments
#
Introduction
It can sometimes be useful to include "external" attachments when sending documents. Common examples include:
- a visual representation of the main document, e.g. a PDF
- an image of scanned receipts or other objects that acts a base for the document
- detailed time sheets
- an image of a product
Below, we describe the various technical solutions that exist to provide this functionality.
#
Supported file types
The following attachment file types are supported by us:
Please note that it also depends on the receiver, their system capabilities and in some cases; the receiver's service provider as well.
#
Attachment file size
The industry recommendation is 5 MB for each attached file.
#
Multiple attachments
There is no limit in regards to how many attachments you can send; send as many as you'd like!
#
Presentation images
Providing an presentation/image of the electronic document is sometimes useful.
We support this where applicable, but please be aware that it might not always get forwarded to the receiver due to limitations in the target format or in the interoperability agreement between us and the receiver's service provider.
Warning
According to the European standard EN 16931-1:2017 for electronic invoicing, it is not allowed to include a visual representation of an invoice/credit note. Do note, however, that this only applies to invoice and credit notes.
As such, public entities/B2G receivers within EU have grounds to reject invoices which doesn't comply with this requirement.
#
Embedded
In a lot of modern formats, it is possible to include attachments within the actual main document. The only requirement is that they are Base64-encoded as binary objects.
This is the most elegant and failsafe way of including attachments.
More information on Base64 can be found here and here.
#
Examples
<?xml version="1.0" encoding="UTF-8"?>
<Invoice ...>
<!-- Omitted for clarity -->
<cbc:ID>123456789</cbc:ID>
<!-- Omitted for clarity -->
<cac:AdditionalDocumentReference>
<cbc:ID>987654321</cbc:ID>
<cac:Attachment>
<cbc:EmbeddedDocumentBinaryObject
filename="scanned_receipts.pdf"
mimeCode="application/pdf"
>JVBERi0xLjMNCiXi48/TDQolUlNUWFBERjMgUGFyY
...
gMCBSDQo+Pg0Kc3RhcnR4cmVmDQoyNDIzMQ0KJTg==</cbc:EmbeddedDocumentBinaryObject>
</cac:Attachment>
</cac:AdditionalDocumentReference>
<!-- Omitted for clarity -->
</Invoice>
<?xml version="1.0" encoding="UTF-8"?>
<IFSFinvoice Version="2.0"...>
<!-- Omitted for clarity -->
<InvoiceDetails>
<!-- Omitted for clarity -->
<InvoiceNumber>123456789</InvoiceNumber>
</InvoiceDetails>
<InvoiceAttachments>
<FileName>invoice_image.pdf</FileName>
<DocumentType>ATS</DocumentType>
<Attachment>JVBERi0xLjMKJaqrrK0KNCAwIG9iago8PCAvVHlwZSAvSW5mbwovUHJv
MDAwIG4gCjAwMDAwNjcyOTMgMDAwMDAgbiAKMDAwMDA2NzQ0MCAwMDAwMCBuIAowMDAwMDY3OTM0
...
IDAwMDAwIG4gCnRyYWlsZXIKPDwKL1NpemUgMjgKL1Jvb3QgMiAwIFIKL0luZm8gNCAwIFIKPj4K
c3RhcnR4cmVmCjY5NTUwCiUlRU9GCg==
</Attachment>
<MimeType>pdf</MimeType>
<Description>invoice_image_123</Description>
</InvoiceAttachments>
</IFSFinvoice>
#
Batched attachments
Another way of sending attachments is by putting them aside the main document within a structure allowing for main document and attachment to be provided within the same file. One of the most common ways of doing this is by using a compressed folder. The .zip-archive is highly adopted and used.
The structure within the .zip-file should include the main document together with the corresponding attachments.
#
Example
invoice123.zip
\-- invoice123.xml
\-- invoice123_presentation.pdf
\-- invoice123_misc.xsls
It is important that the structure is/remains the same for every document sent.
#
Matched via filename
Attachments can also be matched to their main document via filename syntax.
This works in e.g. FTP/SFTP setups, but not necessarily in HTTPS, AS2 etc. Please see each communication protocol section in order to understand what attachment handling is available for your selected protocol.
#
To Pagero
When sending files to Pagero; we are able to work with any filenaming syntax you´d like. The important part is that the structure stays the same for every document and that the filenames unique so as to avoid duplicate clashes on the filesystem.
#
Example
invoice123.xml
invoice123_presentation.pdf
invoice123_misc.xsls
#
From Pagero
When receiving files from Pagero; we can set up the filenaming convention to suit you and your system requirements.
Please keep in mind that we need to include at least one parameter that is unique in the filenames, in order to avoid the chance of getting write errors due to duplicates on receiving server.