Process status updates from recipients via hooks: acknowledged, accepted, rejected, paid.
When a recipient reports the status of your invoice via an Invoice Response (status message), the PSB sends a notification to your webhook. This way, as a sender, you know whether an invoice has been approved, rejected, or whether the recipient needs additional information. This article describes how to receive and process those notifications.
After sending an invoice, the recipient can send status messages back via the Peppol network. The PSB automatically links each incoming Invoice Response to your original invoice and publishes a webhook event.
The flow:
InvoiceResponseReceived eventRegister a hook on the InvoiceResponseReceived topic:
POST /api/v1/hook
{
"action": "https://mijn-systeem.nl/webhook/responses#mijnSecretKey",
"topics": ["InvoiceResponseReceived"]
}
The webhook payload contains the documentId of the original invoice and the responseDocumentId of the Invoice Response message.
Retrieve the full Invoice Response message via the API:
GET /api/v1/{partyId}/salesInvoice/{documentId}/response/{responseDocumentId}/download HTTP/1.1
Host: psb.econnect.eu
Authorization: Bearer {access_token}
The message contains the status code, any clarification codes and an optional note from the recipient.
The received status code indicates what stage the invoice is at with the recipient:
For the UQ and RE statuses, it is important to read the Reason code and Action code that were sent along. These indicate what is wrong and what action the recipient expects from you. See the article Send an Invoice Response for a full overview of all Reason and Action codes.
To receive Invoice Responses as a sender, your organisation must be registered in the Peppol SMP with the invoiceResponse capability. Without this registration, the recipient's Access Point cannot deliver the response message.
Check and activate the capability:
PUT /api/v1/peppol/config HTTP/1.1
Host: psb.econnect.eu
Authorization: Bearer {access_token}
Content-Type: application/json
{
"invoiceResponse": {
"state": "on"
}
}
Some recommendations for processing Invoice Responses:
documentId from the payload to link the response to the correct invoice in your own records.X-EConnect-DocumentId for this, as it is a new document.Register a hook on the topic InvoiceResponseReceived. The payload contains the documentId of your originally sent invoice and the responseDocumentId of the status message. This allows you to link the response in your system to the correct sales invoice.
Use GET /api/v1/{partyId}/salesInvoice/{documentId}/response/{responseDocumentId}/download with the documentId of the invoice and the responseDocumentId from the webhook. The message contains the status code and any clarification information from the recipient.
With RE (Rejected), you need to correct the invoice and resend it; the Reason and Action codes indicate what is wrong. For the new version, use a new X-EConnect-DocumentId, because it is a new document and idempotency works per documentId.
Invoice Responses are optional in the Peppol network. Not every recipient sends them. But when they are used, they provide valuable insights into the invoicing process.
Try it in the API