ChannelEngine: webhooks
About this article
This article describes the webhooks feature on ChannelEngine, how to add them, and how to configure them.
Table of contents
Introduction
A webhook is a method that enables real-time communication between two systems. Using a webhook, one system notifies the other each time a certain event occurs. E.g.: ChannelEngine sends a notification to your order management system each time a new order is created.
Webhooks differ from APIs in the sense that APIs actively request information or perform actions. On the other hand, webhooks passively 'listen' for notifications related to certain events.
ChannelEngine's webhooks allow you to subscribe to the events, such as when a new order is created or a shipment is changed.
Add a webhook
Via the ChannelEngine web application
To add a webhook via the ChannelEngine web application, do the following:
- Go to Settings, Webhooks.
- Click the Add button.
- Add a Name to easily identify your webhook.
- Add a URL. The URL you need to provide is simple, all required parameters are added automatically by ChannelEngine. Below you can find examples of the required input and of the resulting URL:
- Example of input - https://test-store.com/callback
- Example of result - https://test-store.com/callback?type=orders&tenant=test-company&updatedSince=1640172185
- Select the kind of event that the webhook should handle. The possible events are described below:
- Orders create - triggered when orders are created.
- Products change - triggered when there is a change in the product feed.
- Returns change - triggered when returns are created or updated.
- Shipments change - triggered when a shipment is created and when a cancelation is created.
- Notifications create - triggered when ChannelEngine pushes a new notification.
- Product bundles change - triggered when product bundles are created or updated.
-
Orders change - triggered when the order is updated on any other field other than the status.
- To apply a security layer to your webhooks, select an Authentication type. There are two types available: header; and query string parameters.
- Add the Authentication key parameter and the Authentication value parameter.
- When you are done, set the webhook to active at the top of the page and click Save.
Via the ChannelEngine API
ChannelEngine's Merchant API exposes four webhook-related endpoints. To add a webhook via the API, submit a request using the POST /v2/webhooks
endpoint as follows:
{ "Name": "string", "Url": "string", "IsActive": true, "Events": [ "ORDERS_CREATE" ] }
The GET, PUT, and DELETE endpoints are also available and can be used to, respectively: retrieve all existing endpoints; update an existing endpoint; and delete an existing endpoint.
For more information on ChannelEngine's webhook-related endpoints, check out ChannelEngine's API reference.
Delete a webhook
To delete a previously added webhook, make sure to deactivate it before deleting it.
Comments
0 comments
Article is closed for comments.