This webhook is called for every notification event on a text message, email or WhatsApp message attached to a payment request or a subscription: when it is sent, delivered, read, delayed or fails, and when the customer clicks the payment link. The following data format will be POSTED to the provided webhook URL.
On webhook version 4.0 the site and record references are bare ids. Earlier versions send an object carrying the merchant-facing external ids instead, so a site moved onto 4.0 will see this shape change.
The message field is a human-readable sentence rather than a code, and its wording is not part of the API contract. A send reads like "Payment Request sent to customer@example.com", a later status update like "Sms to +15555550100 delivered", and a click like "Customer clicked the text link". Branch your integration on the error boolean and on the record ids, not on the wording.
Each of these events sends its own webhook. The payload does not name the event: error is true for a failed or partly failed delivery and false for every other event, and message describes the event for people to read.
sentfalsedeliveredfalsereadfalsedelayedfalseclickedfalsepartialtruefailedtrue
{
"action": "notification",
"data": {
"site": "6201825a0cf5e23261a08646",
"invoice": "649dc5bb468bd5b5d863c7d2",
"message": "Customer clicked the text link",
"error": false
}
}
{
"action": "notification",
"data": {
"site": "6201825a0cf5e23261a08646",
"invoice": "649dc5bb468bd5b5d863c7d2",
"message": "Text to 18001231245 failed",
"error": true
}
}