2 Get document
Retrieves a processed document by ID and returns its metadata plus a files array of downloadable resources, each file object includes purpose (e.g., document, image, attachment), file name, MIME type, and a pre-signed downloadUrl for direct download of the XML, PDFs, or attachments.
Note: GETs are tracked, if a document is retrieved more than 10 times without being completed (EXPORTED or ERROR), subsequent requests will return 409 Conflict.
Endpoint
Section titled “Endpoint”- Method: GET
- Path:
/v4/documents/export/{documentId}
Full URLs
- Test:
https://apitest.4exchange.app/v4/documents/export/{documentId} - Production:
https://api.4exchange.app/v4/documents/export/{documentId}
Request
Section titled “Request”Path parameters
Section titled “Path parameters”documentId(string, required): One of the IDs returned by the list endpoint.
Example: GET /v4/documents/export/8e6e870e-854b-46ef-a4d5-dfe5a5799cf8
Headers
Section titled “Headers”- Authorization: Bearer token (requires
4Exchange/receivescope)
Request body
Section titled “Request body”none
Responses
Section titled “Responses”200 OK (Invoice)
Section titled “200 OK (Invoice)”- 200 OK
{
"documentId": "8e6e870e-854b-46ef-a4d5-dfe5a5799cf8",
"status": "READY",
"importDate": "2025-10-20T10:30:00Z",
"timestamp": "2025-10-20T10:35:00Z",
"documentType": "invoice",
"channel": "peppol",
"senderIdentifier": "0106:09135999",
"receiverIdentifier": "0106:34236560",
"files": [
{
"purpose": "document",
"fileName": "invoice_12345.xml",
"mimeType": "application/xml",
"downloadUrl": "https://s3.amazonaws.com/bucket/presigned-url"
},
{
"purpose": "image",
"fileName": "invoice_12345.pdf",
"mimeType": "application/pdf",
"downloadUrl": "https://s3.amazonaws.com/bucket/presigned-url"
},
{
"purpose": "attachment",
"fileName": "invoice_12345.png",
"mimeType": "image/png",
"downloadUrl": "https://s3.amazonaws.com/bucket/presigned-url"
}
]
}
200 OK (Application Response)
Section titled “200 OK (Application Response)”- 200 OK
{
"documentId": "f1a2b3c4-5678-90ab-cdef-1234567890ab",
"status": "READY",
"importDate": "2025-10-20T11:00:00Z",
"timestamp": "2025-10-20T11:05:00Z",
"documentType": "applicationresponse",
"channel": "peppol",
"senderIdentifier": "0106:09135999",
"receiverIdentifier": "0106:34236560",
"applicationResponse": {
"referenceDocumentNumber": "INV-2025-12345",
"referenceDocumentId": "8e6e870e-854b-46ef-a4d5-dfe5a5799cf8",
"responseCode": "RE",
"responseMessage": "Rejected due to invalid VAT number"
},
"files": [
{
"purpose": "document",
"fileName": "appresponse_123.xml",
"mimeType": "application/xml",
"downloadUrl": "https://s3.amazonaws.com/bucket/presigned-url"
}
]
}
401 Unauthorized
Section titled “401 Unauthorized”- 401 Unauthorized
{
"message": "Unauthorized"
}
404 Not Found
Section titled “404 Not Found”- 404 Not Found
Example: GET /v4/documents/export/8e6e870e-854b-46ef-a4d5-dfe5a5799c
{
"Error": "Document not found"
}
Note: Documents are retained by default for 90 days. If a document is older than 90 days it may have been removed and the endpoint will return a 404 Not Found response.
409 Conflict
Section titled “409 Conflict”- 409 Conflict
Occurs when getCount >= 10 (i.e., the 11th retrieval attempt).
{
"message": "Document retrieved more than 10 times without being completed (exported or failed)"
}
400 Bad Request
Section titled “400 Bad Request”- 400 Bad Request
{
"message": "Document is not waiting to be exported"
}
Field Reference
Section titled “Field Reference”Common Fields
Section titled “Common Fields”| Field | Type | Description |
|---|---|---|
documentId |
string | Unique identifier for the processed document |
status |
string | Processing status: READY, DELIVERED, or ERROR |
importDate |
string | ISO 8601 timestamp when document was first imported |
timestamp |
string | ISO 8601 timestamp when webhook was generated |
documentType |
string | Type of document: invoice, applicationresponse, ereport |
channel |
string | Source channel: email, peppol, api, pagero |
senderIdentifier |
string | Identifier of the message sender (typically a Peppol participant code like 0106:12345678). |
receiverIdentifier |
string | Identifier of the message receiver (typically a Peppol participant code like 0106:87654321). |
Application Response Object
Section titled “Application Response Object”| Field | Type | Description |
|---|---|---|
applicationResponse.referenceDocumentNumber |
string | The referenced document number (e.g., invoice number). |
applicationResponse.referenceDocumentId |
string | The unique identifier of the document this application response refers to, if sent via 4CEE Exchange. |
applicationResponse.responseCode |
string | Short response code: AP = Accepted, RE = Rejected, etc. |
applicationResponse.responseMessage |
string | Human-readable response message or reason for rejection. |
File Object
Section titled “File Object”| Field | Type | Description |
|---|---|---|
purpose |
string | File purpose: document, image, attachment, response |
fileName |
string | Original filename |
mimeType |
string | MIME type of the file |
downloadUrl |
string | Pre-signed URL for file download (expires in 10 minutes). No authentication required. |
messageType |
string | (Optional) Message type for response files: MDN, VALIDATION |
File Purposes
Section titled “File Purposes”document: Main processed document (e.g., invoice XML)image: Image representation of the documentattachment: Additional files (e.g., original XML, receipts)response: System-generated response files (validation reports, delivery notifications)

