Send e-invoices to any customers on behalf your customers via various networks
This guide describes how you can send on behalf of your customers.
You can send documents on behalf of your customers with them created as children (The parent company can have multiple child companies)
This makes it transparent how much a specific child company sends and it will also support the flow for receiving documents.
If you want to manage document sending and reception for more than one company, you should create child companies attached to your Sproom account.
See Child companies for more information.
This section describes how to send e-invoices via the API, either as your own company, or for your own customers with the use of child companies.
First create a webhook for status updates on sent documents using POST /api/webhooks
The type should be: documentStatusChanged (more information here: https://sproom.net/api/documentation/Webhooks.html)
This will allow Sproom to give you updates on your sent document, so you know whether or not the document has been accepted by the recipient.
curl -X 'POST' \
'https://sproom.net/api/webhooks' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"type": "documentReceived",
"url": "https://my.company.com/sproom-webhook"
}'
When you want to send a document, say an invoice, to a given recipient, we recommend you check whether or not the specific recipient number is registered to receiving e-invoices.
That way, you know that the invoice has somewhere to go, and won't be rejected by us due to us not being able to deliver it anywhere.
Check if a company can receive documents using POST /api/recipients/{orgId}
Note: You can check for various countries if you have the country code and the organisation number
E.g. for Denmark we recommend you at least check in the following order 1) GLN -> 2) DK:CVR
curl -X 'GET' \
'https://sproom.net/api/recipients/GLN%3A5790002041488' \
-H 'accept: */*'
That will return a code 200 if the given endpoint is registered in either NemHandel or PEPPOL, meaning that we can deliver the invoice.
Now you have to generate the actual document (OIOUBL or PEPPOL Bis 3) which you want to send (the e-invoice itself)
This will be in XML format.
Ask Sproom Support if you need example files to generate the document.
Upload the XML document by using POST /api/documents
The XML has to be the body of the request in binary form.
curl -X 'POST' \
'https://sproom.net/api/documents' \
-H 'accept: */*' \
-H 'Content-Type: application/octet-stream' \
-d '{}'
This will return a code 201 which includes the header 'X-Sproom-DocumentId'.
This DocumentId will be what we reference when pushing updates via Webhooks.
Error handling: When uploading documents, use the response message, it will contain usable information - especially for validation errors. If you don’t understand why upload fails, please include the error message when contacting Sproom support.
Do you have questions on how to do you integration, contact us now and we will help you as quick as possible
Tlf: +45 88 20 20 40 E-mail: [email protected]