Webhooks: Setting Up Automatic Notifications

  • What they are: Webhooks are like an alert system that sends automatic notifications from Fiablepay to your system.
  • How they work: Instead of constantly asking Fiablepay for updates, you tell Fiablepay where to send notifications. This address is called the webhook_url.
  • Why they are useful: You get instant updates about changes to your data, without having to manually check.

How to Use Webhooks

  1. Provide a URL: When making certain requests to Fiablepay, you include a webhook_url parameter in the request body.
  2. Fiablepay Notifies You: When the status of the item you’re tracking changes (like a payment status), Fiablepay sends a POST request to your provided webhook_url.
  3. Your System Responds: Your system needs to acknowledge the notification with a standard HTTP code like 200. This confirms that you have received the message.

Important Points:

  • Use HTTPS: Your webhook_url must start with HTTPS. This ensures secure communication. If not, the webhooks will not be triggered.
  • Acknowledge Receipt: Your server must respond with a 2xx HTTP status code to let Fiablepay know you got the message.
  • Retry Policy: If Fiablepay doesn’t get a 2xx response, it will keep trying for 36 hours.
  • Supported Objects: The Checkout object is an example of where you can use a webhook_url.
  • No More Polling: You don’t need to constantly ask Fiablepay for updates. It pushes updates to you.

Think of it this way:

Imagine you have a delivery tracking app. Instead of constantly checking if your package has arrived, the app automatically sends you a notification when there’s a status update. Fiablepay’s webhooks work the same way.

In short: With Fiablepay webhooks, you specify where you want to receive updates, and Fiablepay will keep you automatically informed, so you don’t need to constantly request for the data.