Webhooks
Webhooks are a powerful tool that enables you to trigger notifications when certain events happen such as when your customer pays you.
Why use webhooks?
When developing an integration with us, you may need to keep in sync with events that happen with your Dibsy payments. Historically this was usually done by repeatedly polling an endpoint that returns a list, sorted by some date. The main downsides to this approach are:
- Delays - You're not hearing about events as soon as they happen, and instead have to wait until the next time your service polls to fetch new information.
- Overhead - There will be large periods of time where no changes might happen on the account, but polling requests are sent anyway. This causes unnecessary overhead for both the client and the server.
Webhooks solve this issue by sending you data as and when events happen. You can subscribe to certain actions in Dibsy, for example when a payment is made, and we'll let your application know when that action is triggered.
Example
'connection': 'close',
'content-length': '51',
'content-type': 'application/json',
'accept': 'application/json, text/plain, */*',
'host': 'example.com',
'user-agent': 'ReactorNetty/1.0.11',
'accept-encoding': 'gzip'
{
"resource": "payment",
"id": "pt_FIzTpUfFFJCyYv6Vuv"
}
Payments Webhook
If an endpoint supports webhooks, you can specify the webhook URL you want to receive status changes on by providing the parameter webhookUrl
. Below is a list of all endpoints that support webhooks.
Retry schema
In response to Dibsy calling your webhook, you only have to return the HTTP status 200 OK
. Dibsy then knows your system correctly processed the request. In case you return a different status – we will retry delivery 9 times with the delays increasing by two-fold. It follows with the delay: 1 minute, 2 minutes, 4 minutes, 8 minutes, 16 minutes, 32 minutes, 1 hour 4 minutes, 2 hours 8 minutes, 4 hours 16 minutes. This is giving the target URL a total of 8 hours and 31 minutes to respond (plus any processing time). After this, the hook will be marked as dead and unsubscribed from Dibsy.
What IP addresses will webhook requests come from?
Webhook requests will originate from IP address 54.254.52.196. However, we do not recommend restricting processing payments based on selective IP's.