The /api/validate/json endpoint is essential for development. It validates your invoice JSON and ensures it can be converted to valid UBL BIS Billing 3.0 format before you create any documents.
You cannot create documents with invalid JSON. The API will reject invoices that don’t meet UBL BIS Billing 3.0 standards. Always validate during development to catch errors early.
The example above will fail validation! This is intentional - it demonstrates why validation is critical. See below for the errors and how to fix them.
When validation fails, you’ll receive detailed UBL compliance errors. Here’s what the example above returns:
{ "id": "b55354b0-5c69-489b-a8f7-44be7d5bdd6b", "file_name": "b55354b0-5c69-489b-a8f7-44be7d5bdd6b.xml", "is_valid": false, "issues": [ { "message": "Belgian enterprise number MUST be stated in the correct format.", "type": "error", "rule_id": "PEPPOL-COMMON-R043", "flag": "fatal" }, { "message": "[BR-S-08]-For each different value of VAT category rate (BT-119) where the VAT category code (BT-118) is \"Standard rated\", the VAT category taxable amount (BT-116) in a VAT breakdown (BG-23) shall equal the sum of Invoice line net amounts (BT-131)...", "type": "error", "rule_id": "BR-S-08", "flag": "fatal" }, { "message": "Invoice line net amount MUST equal (Invoiced quantity * (Item net price/item price base quantity) + Sum of invoice line charge amount - sum of invoice line allowance amount", "type": "error", "rule_id": "PEPPOL-EN16931-R120", "flag": "fatal" } ]}
This is exactly why the validation endpoint exists! These UBL BIS Billing 3.0 compliance errors would prevent your invoice from being sent. Let’s fix them.
ubl_document: The generated UBL BIS Billing 3.0 XML (truncated above for readability)
Success means:
Your JSON is valid and UBL-compliant
You can see the exact UBL XML that will be generated
You’re ready to create the document using POST /api/documents/ with the same JSON payload
The ubl_document field shows you exactly what XML will be sent via Peppol. This is useful for debugging or understanding how your JSON maps to UBL BIS Billing 3.0.
Use POST /api/validate/ubl to validate an existing UBL BIS Billing 3.0 XML file.
This endpoint expects multipart/form-data with a single file field — NOT a raw XML body. The most common integration mistake is sending the XML as the request body with Content-Type: application/xml, which returns a 422 with {"detail":[{"type":"missing","loc":["body","file"],"msg":"Field required"}]}. See common mistake below.
using System.Net.Http;using System.Net.Http.Headers;using var http = new HttpClient();http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("E_INVOICE_API_KEY"));using var form = new MultipartFormDataContent();var fileBytes = await File.ReadAllBytesAsync("invoice.xml");var fileContent = new ByteArrayContent(fileBytes);fileContent.Headers.ContentType = new MediaTypeHeaderValue("application/xml");// IMPORTANT: the form field MUST be named "file"form.Add(fileContent, "file", "invoice.xml");var response = await http.PostAsync( "https://api-dev.e-invoice.be/api/validate/ubl", form);Console.WriteLine(await response.Content.ReadAsStringAsync());
Have existing UBL XML files to verify before sending (e.g. generated by your ERP)
Are migrating from another Peppol Access Point with pre-generated UBL documents
Need to validate UBL files from external sources before posting them to /api/documents/ubl
Want to double-check the XML produced by /api/validate/json (the ubl_document field in that response)
If you’re creating invoices from JSON, prefer /api/validate/json — it validates the same UBL rules and returns the generated UBL alongside, so you don’t need a separate UBL validation call.