Overview
If your system generates UBL XML files, you can send them through e-invoice.be without a conversion to JSON. Use this method when:- Your ERP system generates UBL XML.
- You migrate from a different Peppol Access Point.
- You have existing UBL files to send.
- You want full control of the UBL structure.
Prerequisites
Your UBL XML must:- Be in the Peppol BIS Billing 3.0 format.
- Be an invoice (
Invoice) or a credit note (CreditNote). - Have your company as the supplier. The send request returns
409if the sender Peppol ID is not one of thepeppol_idsof your company.
- Validate the UBL XML (recommended while you develop).
- Create the document from the UBL file.
- Send the document.
POST /api/validate/ubl and POST /api/documents/ubl accept multipart/form-data with one form field with the name file. A raw XML body (Content-Type: application/xml) gives 422 with the message Field required for body.file.Validate the UBL XML
Validation does not create a document.POST /api/validate/ubl accepts only a file part with the content type application/xml or text/xml.
cURL
201):
201, is_valid is false):
Create the document from UBL
POST /api/documents/ubl validates the file again and creates the document in state DRAFT. If the file has a fatal validation issue, the request returns 415 and no issue list. Thus use POST /api/validate/ubl to find the cause.
201, shortened; the full response also has the line items, the tax details and the attachments):
Send the document
Send the document with theid from the create response. The samples read the ID from the environment variable DOCUMENT_ID.
200, shortened):
Peppol ID routing
When you create a document from UBL, the API stores thecbc:EndpointID values of the supplier and the customer with the document. The send request uses these values if you do not give query parameters.
When you send a document, the API finds the sender and receiver Peppol IDs in this order:
- The query parameters of the send request.
- The Peppol IDs that the API stored with the UBL of the document.
- The identifiers in the document:
vendor_tax_idorvendor_company_idfor the sender, andcustomer_peppol_id,customer_tax_idorcustomer_company_idfor the receiver.
0208 and the enterprise number: the tax ID BE1018265814 gives the Peppol ID 0208:1018265814. For other countries, the derived scheme can be different from the scheme that the receiver registered. Thus the best practice is to give all four query parameters:
cURL
string
Scheme of the sender Peppol ID. Example:
0208.string
Identifier of the sender, without the scheme. Example:
1018265814.string
Scheme of the receiver Peppol ID. Example:
0208.string
Identifier of the receiver, without the scheme. Example:
0848934496.400 if it cannot find a complete sender and receiver Peppol ID. It returns 409 if the sender Peppol ID is not one of the peppol_ids of your company.
Example UBL invoice
This is a minimal invoice in the Peppol BIS Billing 3.0 format. Replace the supplier data with the data of your company.UBL credit notes
A credit note uses the same three steps. The root element isCreditNote, and the type code element is cbc:CreditNoteTypeCode:
Complete example
The example validates a UBL file, creates the document and sends it. It needs only the environment variableE_INVOICE_API_KEY.
Validate, create and send a UBL file (Node.js and Python)
Validate, create and send a UBL file (Node.js and Python)
Get the UBL of a document
GET /api/documents/{document_id}/ubl gives the UBL of a document, also for a document that you created from JSON. The response is JSON with a signed_url for the download of the XML file, not the XML itself.
cURL
Errors and frequent validation issues
Frequent causes of validation issues:
- Profile ID:
cbc:ProfileIDmust beurn:fdc:peppol.eu:2017:poacc:billing:01:1.0. - Customisation ID:
cbc:CustomizationIDmust beurn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0. - Endpoint ID: the supplier party and the customer party each need a
cbc:EndpointIDwith aschemeIDattribute, for example<cbc:EndpointID schemeID="0208">1018265814</cbc:EndpointID>. - Tax category:
cac:TaxCategory/cbc:IDmust be a code from the UNCL5305 list (S,E,Z,AEand others). - Namespaces: the root element must declare the three UBL namespaces that the example shows.
Best practices
- Validate with
POST /api/validate/ublwhile you develop. The create request rejects a file that is not valid, but it does not return the issues. - Give the four Peppol ID query parameters on the send request, and make sure that the receiver is registered before you send. See Look up Peppol participants.
- Develop and test with a sandbox company. See Test mode and sandbox companies.
- Keep a copy of the original UBL file for your audit records.
Resources
Next Steps
Create documents from PDF
Extract the invoice data from a PDF file
Validation during development
Validate JSON and UBL while you develop
Look up Peppol participants
Make sure that the receiver is registered on Peppol
Errors and troubleshooting
Status codes, error formats and retry rules