Cancel an existing order via the API: endpoint, flow and supplier response.
An order that has already been sent can be cancelled by the buyer via an Order Cancellation. The supplier receives the cancellation and can accept or reject it. Order Cancellations are part of the Peppol Advanced Ordering profile.
POST /api/v1/{partyId}/purchaseOrder/{documentId}/cancel
The {partyId} is the Peppol identifier of the buyer. The {documentId} is the ID of the original order you want to cancel. This is the document ID you received when the order was sent.
Note: A cancellation is a request, not a guarantee. The supplier can reject the cancellation, for example if the order is already in production. The cancellation is only final after receiving an Order Response with status code AP (accepted).
OrderCancellationReceived webhookOrderResponseReceived webhookSet up a webhook on the OrderCancellationReceived topic:
{
"action": "https://jouw-endpoint.nl/order-cancellations",
"topics": ["OrderCancellationReceived"],
"secret": "jouw-geheime-sleutel"
}
Download the cancellation document to review the reason for cancellation:
GET /api/v1/{partyId}/salesOrder/{documentId}/download
OrderCancellationSentOrderCancellationReceivedOrderResponseReceivedOrderResponseSentAs a supplier, you respond to a cancellation via the Order Response endpoint. The relevant status codes are:
Use the document ID of the original order that you received from the PSB when sending (POST .../purchaseOrder/send). The path is POST /api/v1/{partyId}/purchaseOrder/{documentId}/cancel, where {partyId} is the Peppol identifier of the buyer.
No. A cancellation is a request. The supplier can reject it, for example if the order is already being fulfilled. Only when you receive an Order Response with code AP is the cancellation accepted according to the flow.
Order Cancellation is part of Advanced Ordering: the supplier receives OrderCancellationReceived, can download the cancellation document and responds via Order Response with AP (accepted) or RE (rejected). The buyer follows the result via, among others, OrderResponseReceived.
View the full API specification at psb.econnect.eu for the exact request and response structure.
Try it in the API