A webhook is a HTTP callback which occurs when something happens. This can be useful to allow you to automate processes based on events coming from the Flipdish platform.
Typical usecases would include
- notify you of an order so that you can automatically enter it into your POS
- notify your delivery fleet platform of an order so they can dispatch a driver
- notify you that a customer signed up so you can add them to your mailing list
- notify you that a customer has changed their marketing preferences so you can remove them from your mailing list
- notify you that your menu was updated so that you can make a corresponding change on your POS system.
Webhooks are configured in the webhooks settings section of the Dashboard. Clicking Add endpoint reveals a form to add a new URL for receiving webhooks.
You can enter any URL you'd like to have events sent to, but this should be a dedicated page on your server. You may add as many URLs as you like.
Webhooks sent to a https endpoint require a valid SSL certificate.
To acknowledge receipt of a webhook your endpoint should return a 2xx HTTP status code. Any other information returned is ignored. All response codes outside this range, including 3xx codes, will indicate to Flipdish that you did not receive the webhook. This means that a URL redirection or a "Not Modified" response will be treated as a failure.
If a webhook is not successfully received, Flipdish will continue trying to send the webhook for 24 hours.
When viewing a webhook information through the Dashboard you can check how many times we've attempted to send an event to an endpoint in Webhook details section. This will show you the latest response we received from your endpoint, along with a list of all attempted webhooks and the respective HTTP status codes we received.
Flipdish will wait a maximum of 10 seconds for a response to a webhook. If your webhook script performs a slow task, such as making a network call, it's possible the webhook would timeout before Flipdish sees its complete execution. For that reason, you may want to have your webhook endpoint immediately acknowledge receipt by returning a 2xx HTTP status code, and then perform the rest of its duties.
Webhook endpoints may occasionally receive the same event more than once. We advise you to guard against duplicated event receipts by making your event processing idempotent. This could be achieved by logging the webhooks you've processed, and then not processing already-logged webhooks.
We also recommend verifying webhook signatures to confirm that received events are being sent from Flipdish.
Create your first webhook today
Check out our creating webhooks article