Validate XML
This endpoint allows customers to validate their XML documents before submitting them via Peppol. It ensures that the document meets the required schema and business rules, helping to prevent errors during transmission. No data is stored during validation, and the service returns detailed feedback on any validation issues encountered.
Endpoint
Section titled “Endpoint”- Method: POST
- Path:
/v3/documents/validate
Full URLs
- Test:
https://apitest.4exchange.app/v3/documents/validate - Production:
https://api.4exchange.app/v3/documents/validate
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 Payload Too Large.
Headers
Section titled “Headers”- Authorization: Bearer token (requires
4Exchange/sendscope) - Content-Type: application/xml
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
{
"transactionId": "dda3af05-ea32-40b2-ba50-zf0210311c9",
"validationResult": "valid",
"validationResults": {
"xmlSyntax": {
"valid": true,
"messages": "No Errors found"
},
"xsdValidation": {
"valid": true,
"xsdFile": "/UBL21/maindoc/….xsd",
"messages": [],
"result": "No Errors found"
},
"schematronValidation": [
{
"xslFile": "/eu.peppol.bis3/….xslt",
"warnings": 0,
"errors": 0,
"messages": [],
"valid": true
},
{
"xslFile": "/eu.peppol.bis3/….xslt",
"warnings": 0,
"errors": 0,
"messages": [],
"valid": true
}
]
}
}
422 Unprocessable Entity
Section titled “422 Unprocessable Entity”- 422 Unprocessable Entity
{
"transactionId": null,
"validationResult": "invalid",
"validationResults": {
"xmlSyntax": {
"valid": true,
"messages": [],
"result": "No Errors found"
},
"xsdValidation": {
"valid": false,
"messages": [
{
"type": "GenericXsdError",
"message": "cvc-complex-type.2.4.a: Invalid content was found starting with element '{\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\":IssueDate}'. One of '{\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\":ProfileExecutionID, \"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\":ID}' is expected."
}
],
"result": "Errors found"
},
"schematronValidation": []
}
}
401 Unauthorized
Section titled “401 Unauthorized”- 401 Unauthorized
{
"message": "Unauthorized"
}
