Webhooks

Create, update and delete webhooks. Webhooks are used to receive notifications about resource events.

The webhook model

Properties

  • Name
    id
    Type
    string
    Readonly
    readonly
    Description
  • Name
    url
    Type
    string
    Description

    Destination URI to which the webhook subscription should send the POST request when an event occurs. Must be a https secured endpoint.

  • Name
    group
    Type
    string
    Description

    The group that the webhook will be triggered for.

  • Name
    action
    Type
    string
    Description

    The action that the webhook will be triggered by.

  • Name
    topic
    Type
    string
    Readonly
    readonly
    Description

    Event that triggers the webhook. All available topics

  • Name
    created_at
    Type
    datetime
    Readonly
    readonly
    Description
  • Name
    modified_at
    Type
    datetime
    Readonly
    readonly
    Description

GET/webhooks/

List all webhooks

Retrieves a collection of webhooks

Optional attributes

  • Name
    limit
    Type
    integer
    Description
    Limits the amount of results.
  • Name
    page
    Type
    integer
    Description
    Only works in combination with the limit attribute.
  • Name
    from
    Type
    date
    Description
    Accepts date format %Y-%m-%d. IE: 2022-10-22
  • Name
    to
    Type
    date
    Description
    Accepts date format %Y-%m-%d. IE: 2022-10-22
  • Name
    direction
    Type
    string
    Description
    Sort direction. Options: asc | desc

Request

GET
/webhooks/
curl https://eu-dev.middleware.ewarehousing-solutions.com/webhooks/

Response

{
    "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"
        }
    ]
}

POST/webhooks/

Create a webhook

This endpoint allows you to add a new webhook

Required attributes

  • Name
    url
    Type
    string
    Description

    A https secure url.

  • Name
    group
    Type
    string
    Description

    The group that the webhook will be triggered for.

  • Name
    action
    Type
    string
    Description

    The action that the webhook will be triggered by.

  • Name
    hash_secret
    Type
    string
    Description

    The secret which will be used to create the webhook signature with. Learn more about verifying the webhook

Request

POST
/webhooks/
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

{
    "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"
}

PATCH/webhooks/:id/

Update a webhook

This endpoint allows you to perform an update on a webhook.

Request

PUT
/webhooks/:id/
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

{
    "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/webhooks/:id/

Delete a webhook

This endpoint allows you to delete a webhook.

Request

DELETE
/webhooks/:id/
curl -X DELETE https://eu-dev.middleware.ewarehousing-solutions.com/webhooks/33a59408-c708-4da4-9f1f-50e87c968928/