Send
On BIAC Access point, there's two way to send document
Send by API
Request
- URL :
/document/send/
- Method :
POST
- Headers:
- x-api-key:
THE API KEY
- x-api-key:
- Body:
{
“xml” : "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<Invoice xmlns:cac=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\"\r\n xmlns:cbc=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\"\r\n xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\">\r\n
...
</Invoice>"
}
When sending a document with a tool like postman, it is necessary to correctly escape the XML document in order to send it in a JSON object. For that you can use this XML to JSON conversion tool.
Success Response
- Code :
200 OK
If everything is good, it's return the transaction Id and Status.
Content expemple
{
"transactionId": "fe7f3e0b-ce92-4b78-9f07-216cad3ca98a",
"transactionStatus": "Success"
}
transactionId:
The UUID of the transaction, can be use to retreive the full document
transactionStatus:
The transaction status, Success or failed
Code :
200 OK
If there's warning on the document, the document is sent but return a warnings array.
Content exemple with warning
{
"transactionId": "fe7f3e0b-ce92-4b78-9f07-216cad3ca98a",
"transactionStatus": "Success",
"ublValidation": {
"warnings": [
{
"context": "/:Invoice[1]",
"errorMessage": "[UBL-CR-006]-A UBL invoice should not include the IssueTime",
"xpathTest": "not(cbc:IssueTime)"
}
]
}
}
Error Response
- Code:
400 Bad request
The access point cannot deserialize the XML.
Content exemple with XML definition
{
"transactionId": "e7d8b208-003f-4eb6-81d4-896e16fd8e89",
"transactionStatus": "Failed",
"message": "SOME ERROR MESSAGES"
}
- Code:
400 Bad request
Content exemple with json error
The xml document is a valid XML but contains peppol validation error.
{
"transactionId": "e7d8b208-003f-4eb6-81d4-896e16fd8e89",
"transactionStatus": "Failed",
"xmlSchemaErrors": [],
"ublValidation": {
"errors": [
{
"context": "THE CONTEXT ERROR",
"errorMessage": "THE ERROR MESSAGE",
"xpathTest": "MORE INFORMATION",
},
],
"warnings": []
}
}
- Code:
401 Unauthorized
ApiKey incorrectly configured or invalid.
Schemas
ResponseValidationModel
{
"transactionId":"STRING",
"transactionStatus": "STRING",
"message": "STRING",
"xmlSchemaErrors": [
{
"errorMessage": "STRING",
"technicalDetails": "STRING"
}
],
"ublValidation": {
"errors": [
{
"context": "STRING",
"errorMessage": "STRING",
"xpathTest": "STRING"
}
],
"warnings": [
{
"context": "STRING",
"errorMessage": "STRING",
"xpathTest": "STRING"
}
]
}
}
- transactionId
transactionId is the identifiant of the transaction, can be use to retreive the full document.
- transactionStatus
the transaction status, Success or Failed.
- message
message is a string. If there are some errors in the document format or other information missing. Message would be set with theses errors.
- xmlSchemaErrors
xmlSchemaErrors is an array containing all errors about the xml schema.
- ublValidation
errors is an array containing all errors not respecting Peppol BIS 3.0 validation Rules
warnings is an array containing all warning not respecting Peppol BIS 3.0 validation Rules
Send by Email
For customers who do not have the possibility to modify their software in order to contact a Web API, Biac peppol access-point offers the possibility to send ubl document by email.
Prerequisite
During your company enrolment you need to provide an email address who will send your documents.
The email must contain the invoice number in the subject and the UBL file as attachments.
For testing purpose by email you can send your document to our test company by setting correctly this fields on your UBL document If you want a response you can ask to configure a response email
Email sample
- Sender:
your-register@email.adress
- Receiver:
inbound-test@biaclog-peppol.eu
- Subject:
1122334455 (the document id)
- Attachments:
invoice-1122334455.xml
Converter
You can also convert documents from one type to another.
Available converter
- xRechnung CII to BIS Billing UBL
- xRechnung UBL to BIS Billing UBL
Convert by API
To convert from an API call, you must add the convert property with the righ value to the json object.
{
"converter": "XRechnungCiiToUbl",
"xml" : "..."
}
Available converter value
- xRechnung CII to BIS Billing UBL
XRechnungCiiToUbl
- xRechnung UBL to BIS Billing UBL
XRechnungUblToUbl
Convert by EMAIL
When sending an XRechnung cii document by email, the file is automatically converted to BIS Billing UBL.
Adding attachment
When sending an xml by mail, it is possible to add additional attachments. Additional attachments will be added as an attachment to the generated UBL file.
Return Mail
When converting by email, you will receive a response email with the UBL result conversion result.