Webhooks are a great way for your system to receive near real-time updates from Centz without the need to constantly polling. When enabled, your system will be notified as soon as an event is trigger within Centz .
Webhooks can be enabled on a per site or per invoice basis by assigning a webhook URL when calling the associated endpoints. Here is an example of the json data required to enable webhooks for each endpoint.
{
"externalId": "12345678",
"webhook": {
"active": true,
"url": "https://mysoftware.com/webhook"
}
}
{
"externalId": "39772921",
"webhookUrl": "https://mysoftware.com/webhook/{invoice_id}"
}
When a webhook URL is configured, the following messages will be sent.
The webhook URL must return a successful HTTP response code (200) within 10 seconds or it will be considered to have failed to receive it. If this happens, all webhook messages will be re-sent using the following schedule.
Il y a au plus trois tentatives de renvoi. Si la troisième échoue également, le message n'est pas renvoyé de nouveau, donc la dernière tentative a lieu environ deux heures après le webhook initial.