Upload XML
Uploads a document using raw XML in the request body. Please embed the image as a Base64-encoded element in the XML, or allow 4CEE Exchange to generate an image automatically based on the content of the XML.
Endpoint
Section titled “Endpoint”- Method: POST
- Path:
/v3/documents/{documentType}/{direction}/xml
Full URLs
- Test:
https://apitest.4exchange.app/v3/documents/{documentType}/{direction}/xml - Production:
https://api.4exchange.app/v3/documents/{documentType}/{direction}/xml
Request
Section titled “Request”Request size limit
The maximum request size is 6 MB (after Base64 encoding and headers). Requests over this limit are rejected with 413 - Request Entity Too Large response.
Encoding requirement
Please ensure that the XML document is UTF-8 encoded for correct handling.
Path parameters
Section titled “Path parameters”documentType(string, required): Type of document, allowed values are:invoice,applicationresponse,ereportdirection(string, required): Direction of document, allowed values are:sendorreceive
Example: POST /v3/documents/invoice/send/xml
Headers
Section titled “Headers”- Authorization: Bearer token (requires
4Exchange/sendscope) - Content-Type: application/xml
- documentId (string, optional): Client-provided identifier for tracking. Any non-empty string; does not need to be a UUID. If omitted, the system generates one.
Request body
Section titled “Request body”<?xml version="1.0" encoding="utf-8"?>
<Invoice>
<cbc:ID>123</cbc:ID>
<cbc:IssueDate>2025-02-28</cbc:IssueDate>
.......
<cac:LegalMonetaryTotal>
<cbc:LineExtensionAmount currencyID="EUR">100.00</cbc:LineExtensionAmount>
<cbc:TaxExclusiveAmount currencyID="EUR">100.00</cbc:TaxExclusiveAmount>
<cbc:TaxInclusiveAmount currencyID="EUR">121.00</cbc:TaxInclusiveAmount>
<cbc:PayableAmount currencyID="EUR">121.00</cbc:PayableAmount>
</cac:LegalMonetaryTotal>
</Invoice>
Responses
Section titled “Responses”200 OK
Section titled “200 OK”- 200 OK
{
"message": "Successfully received the document",
"documentId": "8e6e870e-854b-46ef-a4d5-dfe5a5799cf8"
}
401 Unauthorized
Section titled “401 Unauthorized”- 401 Unauthorized
{
"message": "Unauthorized"
}
400 Bad request
Section titled “400 Bad request”- 400 Bas request
{
"Error": "body is invalid"
}
413 Request Entity Too Large
Section titled “413 Request Entity Too Large”- 413 Request Entity Too Large
{
"message": "Request Too Long"
}
