Webhooks are HTTP callbacks that allow you to push real-time information to other applications in case of certain events e.g. when an order is placed or when a user registers on the site. A Webhook delivers the data immediately as it happens.
Unlike REST APIs where you need to poll very frequently in order to get near real-time data, webhooks provides a much more efficient way to receive real-time data from your store.
APIs and Webhooks are two major ways to integrate third-party applications with the StoreHippo platform.
You can manage webhooks in the Advanced Settings > Webhooks section of the StoreHippo Admin Panel.
Setting up Webhooks
Click on the Add New button to create webhooks. Clicking on the Add new will open the following form:
Action
Select the events for which the webhooks are sent from the drop-down.
URL
Provide the URL on which the request is placed.
Headers
Mention the key and value for the headers. For example,
Key: Content-Type
Value: application/JSON
Consuming Webhooks
The URL that you specify in the webhook should be able to receive the data from the webhook. The data that is posted will be in the same structure as defined in the corresponding API. For example, a webhook for placing an order will receive the JSON data of the Order in the format defined in the API docs.
Events
StoreHippo supports 12 events for the webhooks currently:
- Customer Creation: A webhook will be sent every time a new customer is created.
- Customer Update: A webhook will be sent every time a customer record is updated.
- Customer Delete: A webhook will be sent every time a customer record is deleted.
- Order Creation: A webhook will be sent every time an order is created.
- Order Update: A webhook will be sent every time an order has been updated.
- Order Delete: A webhook will be sent every time an order has been deleted.
- Product Creation: A webhook will be sent every time a product has been created.
- Product Update: A webhook will be sent every time a product has been updated.
- Product Delete: A webhook will be sent every time a product has been deleted.
- Product Enquiry: A webhook will be sent every time a product enquiry has been placed.
- Marketing user list: A webhook will be sent every time the mailing list (user list) is synced.
- Customer Enquiry: A webhook will be sent every time when a customer places an enquiry.
- Wallet Transaction Add: A webhook will be sent every time a wallet transaction is added.
Request
The request sent by StoreHippo would also include some headers:-
- x-ms-store: The store name for which the request is made.
- x-ms-entity: The entity on which for which the request is made.
- x-ms-filebaseurl: The base URL that should be prefixed to all file paths in the webhook data to create the full URL.
- x-ms-command: The operation performed on the entity.
- x-ms-recordid: The id of the record on which the operation is performed (Only in case of Edit and Delete).