What is a webhook, and how do they work?
A webhook works by sending a message from an application. These messages are sent out whenever an action happens in the application. Think of them like notifications you get on your smartphone or the “You’ve got mail” chime you used to hear when an email was sent to you.
You get the mail (The Action). Then the notification is sent to you (The Message). Ding, Hey, check your mail!
Companies are using these all the time. If your bank is notifying you when a payment is received, your credit card company is asking if you made a specific purchase, or if DoorDash is asking how your meal was, it was probably done using webhooks.
Q: If a webhook uses a message sent from an application, then where is it sent to?
A: Well, that’s up to you. Webhooks can be set up with tons of applications, with all of them doing different things. You can have webhooks with your calendar applications, and when it receives the message, you automatically get the calendar appointment created. You can have webhooks with your messaging program, so if a customer pays their invoice, a message is sent requesting a review: How was your experience?
The webhook is the whole process of one application sending a message and another application receiving that message and doing something with it.
Shopmonkey uses webhooks to send messages about actions that happen in your shop.
The Shopmonkey actions that send a message are:
Appointment (Create, Update, Delete)
Payment (Create, Update, Delete)
Customer (Create, Update, Delete)
Vehicle (Create, Update, Delete)
Inventory (Create, Update, Delete)
Order (Create, Update, Delete)
Users (Create, Update, Delete)
Webhooks are sent in 1-minute intervals. To see a list of data sent by each data trigger check out Webhook Event Trigger Data Sent.
How do I use webhooks in Shopmonkey?
To get your webhooks working, you’ll need to first set it up. You can start by going to your Shopmonkey Settings > Integrations > Webhooks page. From there, click New Webhook:
Next, name your webhook. The best practice is to name it based on the application it is connecting to. First, enter the URL of the application receiving the webhook. Then set the event triggers. You can test your webhook by clicking the Send Test button. This will send a webhook with sample information to the URL you entered above. Make sure the enable webhook toggle is switched on, and click Save:
Your webhook now shows in the list. From here, you can add a new webhook or manage your existing ones. To update any settings on an existing webhook, click Manage:
When managing your existing webhooks, you’ll see the same menu you used to set them up. You’ll also notice the Secret field appear which has been provided by the receiving application to ensure it only receives information from Shopmonkey. If the receiving application doesn't provide a secret, you can leave this blank. Make any changes you need and click Save. Webhooks can also be deleted from here:
You can use a tool like RequestBin to test the connectivity and output of your webhook. RequestBin lets you create a webhooks URL and send data to it to see how it's recognized. Go to RequestBin, click Create a RequestBin, then copy the URL it gives you. (URL is https://requestbin.com/)
Thanks for reading! Please let us know if you have any questions.