Skip to main content

Overview

If you already have UBL (Universal Business Language) XML files, you can send them directly via e-invoice.be without converting from JSON. This is useful when:
  • You have an ERP system that generates UBL XML
  • You’re migrating from another Peppol Access Point
  • You have existing UBL files to send
  • You want full control over the UBL structure

Prerequisites

Your UBL XML must:
  • Be valid UBL BIS Billing 3.0 format
  • Comply with Peppol specifications
  • Be either an Invoice or Credit Note
Use the /api/validate/ubl endpoint to validate your UBL XML before creating documents.

Workflow

  1. Validate your UBL XML (recommended)
  2. Create document from UBL
  3. Send via Peppol

Step 1: Validate UBL XML

Before creating a document, validate your UBL file. Both /api/validate/ubl and /api/documents/ubl accept multipart/form-data with a file field — not a raw XML body.
Do not use -H "Content-Type: application/xml" --data-binary @invoice.xml — that returns 422 Field required: body.file. See the validation guide for the full request contract and copy-paste examples in Node.js, Python, C#, and PHP.

Validation Response

Valid UBL:
Invalid UBL:

Step 2: Create Document from UBL

Once validation passes, create the document. Same contract: multipart/form-data with a file field.

Response

Step 3: Send via Peppol

Send the document using the document ID:

Response

Peppol ID Routing

By default, sender and receiver Peppol IDs are automatically derived from the company identifiers in your document, regardless of any endpoint IDs specified in the UBL XML:
  • Derived from company tax IDs (vendor_tax_id / customer_tax_id) OR company IDs (vendor_id / customer_id)
  • For Belgian companies: 0208 scheme is always used (Belgian government requirement)
  • Example: Tax ID BE1018265814 → Peppol ID 0208:1018265814
UBL Endpoint IDs are ignored: Even if your UBL document contains specific endpoint IDs (e.g., <cbc:EndpointID schemeID="0088">1234567890123</cbc:EndpointID>), these are not used for routing. The API derives Peppol IDs from the company identifiers in the document metadata instead.
Best Practice: Always explicitly specify sender and receiver Peppol IDs using query parameters to ensure documents are routed to the correct endpoints. This is especially important when sending UBL documents, as endpoint IDs within the UBL XML are ignored.
To route to a specific Peppol endpoint, explicitly provide the Peppol IDs via query parameters:
Available query parameters: Common Peppol schemes:
  • 0208 - Belgian enterprise number (BE)
  • 0088 - Global Location Number (GLN)
  • 0106 - Dutch KVK
Always verify the recipient is registered at the specified Peppol endpoint before sending. Use /api/validate/peppol-id?peppol_id=scheme:identifier to confirm registration and prevent delivery failures.

Example UBL Invoice

Here’s a minimal valid UBL invoice:

Code Examples

Node.js

Python

Retrieving UBL from Created Documents

If you created a document via JSON and want to retrieve the generated UBL:
This returns the UBL XML that was generated from your JSON payload.

Common UBL Validation Errors

Missing Peppol Profile

Error:
Fix: Add the correct profile ID:

Invalid Customization ID

Error:
Fix: Use the correct customization ID:

Missing Endpoint ID

Error:
Fix: Add endpoint IDs for both parties:

Invalid Tax Category

Error:
Fix: Use valid UNCL5305 codes (S, E, Z, etc.):

Best Practices

Use /api/validate/ubl to catch errors early. Both endpoints take multipart/form-data with a file field — use -F (curl) / files= (requests) / FormData (axios), not raw XML bodies.
Ensure all UBL namespaces are correctly declared:
Before sending, verify customer Peppol IDs:
For large UBL files:
  • Use streaming when reading files
  • Consider compressing before transmission
  • Check file size limits in your HTTP client
Keep a copy of the original UBL for audit purposes:

UBL Credit Notes

Credit notes follow the same process but use the CreditNote element:

Resources

Next Steps

Creating from PDF

Learn how to create documents from PDF files

Creating Invoices

Create invoices from JSON

Validation Guide

Test invoice data

API Reference

Explore all endpoints