Receive incoming orders via webhooks, download via the SalesOrder API and process them.
When a customer sends a purchase order to your organisation via Peppol, you receive it as a sales order in the PSB. A webhook notifies you immediately, after which you can download and process the order.
Register a webhook for the OrderReceived topic so the PSB notifies you as soon as an order arrives:
{
"action": "https://jouw-endpoint.nl/orders",
"topics": ["OrderReceived"],
"secret": "jouw-geheime-sleutel"
}
The webhook payload includes the documentId and the senderPartyId, so you know which order arrived from which sender.
Use the documentId from the webhook payload to retrieve the order:
GET /api/v1/{partyId}/salesOrder/{documentId}/download
The response contains the UBL Order XML document. By default, you receive the document in the format it was sent in. Want it in a different format? Use the targetDocumentTypeId query parameter to have the document automatically transformed to the desired format.
Note: Received documents are stored in the PSB for 90 days. After you download the document, it remains available for 7 more days. Download orders promptly and store them in your own system.
After downloading, process the order in your own system. With the Advanced Ordering profile, you are expected to send an Order Response back to the buyer. The possible statuses are:
Send the response via the Order Response endpoint.
In addition to OrderReceived, there are more topics relevant when receiving orders:
OrderReceivedOrderChangeReceivedOrderCancellationReceivedWant to manually delete a received order from the PSB? You can do so via:
DELETE /api/v1/{partyId}/salesOrder/{documentId}
Register a webhook on the OrderReceived topic. The payload contains, among other things, documentId and senderPartyId. Use that documentId to call GET /api/v1/{partyId}/salesOrder/{documentId}/download to retrieve the UBL Order XML and process it in your own system.
With the Advanced Ordering profile, the buyer expects you as a supplier to respond with an Order Response. You use the codes AB (received and readable), AP (accepted), CA (conditionally accepted) or RE (rejected). Without that response, the process is not completed according to the profile.
Received documents are retained in the PSB for 90 days. After download, the document remains available for 7 more days. Therefore, store orders in your own environment promptly and plan your integration accordingly.
View the full API specification at psb.econnect.eu for all parameters and response structures.
Open the API reference