# Tutorial: Receiving an "Invoice Response" from the buyer
Once the sales invoice is successfully delivered to the receiver access point you can expect to get a hook with topic InvoiceResponseReceived. The InvoiceResponseReceived event message will contain the status of the document on the buyers behalf.
# Prerequisite
- An invoice is successfully delivered, an
InvoiceSenttopic is provided. - The buyer supports the "Invoice Response".
# Step 1: Register hook
Register a hook for the topic InvoiceResponseReceived.
Webhook example:
{
"id": "1",
"name": "webhook",
"action": "https://webhook.site/a81a0be5-8aad-4110-a40c-aa41a2c6e9ac#secureKey",
"topics": [
"InvoiceResponseReceived"
],
"isActive": true
}
# Step 2: Register capability in Peppol
You have to register the InvoiceResponse as a capability in the SMP if you want to receive status messages via Peppol.
We advise to update your default Peppol configuration using PUT /api/v1/peppol/config by putting the state of the invoiceResponse capability to "on".
For example:
{
"capabilities": {
"invoiceResponse": {
"state": "on",
"description": "IMR v3"
}
}
}
It is also possible to do this per partyId using the PUT /api/v1/peppol/config/party/{partyId} endpoint.
Read more about the the Peppol SMP.
# Step 3: Wait till the event arrives
Once the invoice response message is received a hook with topic InvoiceResponseReceived will be sent.
Some useful fields of the received invoice response are:
| Field | Description |
|---|---|
| documentId | Id that uniquely identifies the received Invoice response |
| refToDocumentId | Id that identifies sent Invoice |
| message | Summarize message |
| details | Invoice response object |
The hook contains all necessary information to process the response. However you could also download the received InvoiceResponse using GET /api/v1-beta/{partyId}/generic/{documentId}/download.