Developer documentation
Webhooks
Use the Webhooks API to create, retrieve, update, and delete webhooks. Webhooks notify your app about resource events.
Create, update and delete webhooks. Webhooks are used to receive notifications about resource events.
To learn more about setting up webhooks, or learn how to verify the webhooks, visit the webhook setup page.
Response models
These response models describe the objects returned by this resource.
The webhook model
| Field | Description |
|---|---|
idstringOptional | Read-only. |
urlstringOptional | Destination URI to which the webhook subscription should send the POST request when an event occurs. Must be a https secured endpoint. |
groupstringOptional | The group that the webhook will be triggered for. |
actionstringOptional | The action that the webhook will be triggered by. |
topicstringOptional | Read-only. Event that triggers the webhook. [All available topics](/webhooks#available-webhook-topics) |
List all webhooks
GET
/webhooks/Retrieves a collection of webhooks
Request attributes
| Field | Description |
|---|---|
limitintegerOptional | Limit the number of results. Default is 50. |
pageintegerOptional | The page number to retrieve. |
directionstringOptional | Sort direction. Options: `asc` or `desc`. |
sortstringOptional | Sorting field used for the webhook collection. |
Request examplecURL
curl https://eu-dev.middleware.ewarehousing-solutions.com/webhooks/Response exampleJSON
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": "6caeff6d-cd72-4fde-9d02-0704514ad917",
"url": "https://webhook.site/d8cfed29-d64c-41e6-82fe-f4919992b7a8",
"group": "stock",
"action": "updated",
"customer": "be62c27e-2aac-4ac1-902e-f770d64f8dce"
},
{
"id": "ac954ac8-4182-4dc5-b951-f570dc145fe4",
"url": "https://webhook.site/d8cfed29-d64c-41e6-82fe-f4919992b7a8",
"group": "order",
"action": "updated",
"customer": "be62c27e-2aac-4ac1-902e-f770d64f8dce"
}
]
}Create a webhook
POST
/webhooks/This endpoint allows you to add a new webhook
Request attributes
| Field | Description | Example value |
|---|---|---|
urlstringRequired | A https secure url. | |
groupstringRequired | The group that the webhook will be triggered for. | |
actionstringRequired | The action that the webhook will be triggered by. | |
hash_secretstringRequired | Secret used to generate the webhook signature. [Learn more about verifying the webhook](/webhook-setup#4-verify-the-webhook) |
Request examplecURL
curl -X POST 'https://eu-dev.middleware.ewarehousing-solutions.com/webhooks/' \
-H 'Content-Type: application/json' \
--data-raw '{
"url": "https://webhook.site/d8cfed29-d64c-41e6-82fe-f4919992b7a8",
"group": "stock",
"action": "updated",
"hash_secret": "ABC12345"
}'Response exampleJSON
{
"id": "2f1a2b53-b499-40a5-b440-e5c30e37c97c",
"url": "https://webhook.site/d8cfed29-d64c-41e6-82fe-f4919992b7a8",
"group": "stock",
"action": "updated",
"customer": "be62c27e-2aac-4ac1-902e-f770d64f8dce",
"hash_secret": "ABC12345"
}Update a webhook
PATCH
/webhooks/:id/This endpoint allows you to perform an update on a webhook.
Request examplecURL
curl -X PUT
https://eu-dev.middleware.ewarehousing-solutions.com/webhooks/774bf6ee-90cf-11e9-b36d-0242ac120005/ \
--data-raw '{
"url": "https://webhook.site/5c2bba38-7515-478d-95c9-cc263f38e23f",
"group": "order",
"action": "created"
}'Response exampleJSON
{
"id": "2f1a2b53-b499-40a5-b440-e5c30e37c97c",
"url": "https://webhook.site/5c2bba38-7515-478d-95c9-cc263f38e23f",
"group": "order",
"action": "created",
"customer": "be62c27e-2aac-4ac1-902e-f770d64f8dce"
}Delete a webhook
DELETE
/webhooks/:id/This endpoint allows you to delete a webhook.
Request examplecURL
curl -X DELETE https://eu-dev.middleware.ewarehousing-solutions.com/webhooks/33a59408-c708-4da4-9f1f-50e87c968928/