What is a Webhook?

Webhook is a way of connecting two systems, so that one system (your company's, for example) can receive information from the other (Fabank, for example) as soon as a certain action occurs, in real time, without the need to actively seek updates regularly.

How does a webhook work?

The client registers a webhook informing the URL configured in their own system to receive notifications (callbacks) about a specific service.

Monitor in real time the payment or cancellation events of a charge, a debit or credit to an account, payment confirmation and much more!

How important are webhooks?

The main benefit of using webhooks is real-time updating, without the need to actively perform frequent queries, which represents a saving of time and resources.

And setting up a webhook for the Fabank APIs is very simple and quick.

Operation

You can create webhook subscriptions to receive events whenever a new log is created. We send the event by making a POST request to your endpoint URL. The event will be delivered with a digital signature (headers["signature"]), which can be verified using the Fabank public key. This key is recoverable by a GET request to /api/v1/public-key.
If your endpoint URL does not return a 200 status, the webhook service will try again at most three times. The interval in Sandbox between each attempt is 1 min, 3 min and finally 5 min. In case the event cannot be delivered after those three attempts, we will stop trying to deliver the message.

The event sent to the endpoint URL has the structure shown to the right, where the content of the log sent will depend on the event subscription.

📘

NOTE: Even if you use Webhook, we strongly recommend that you create a daily task to get all undelivered events and set them as delivered. It's important to add redundancy and resilience to your system, preventing you from having outdated information just in case your system is temporarily unable to receive our Webhook events.