Webhooks

You can use webhook subscriptions to receive notifications about particular events. After you've subscribed to a webhook topic, your app can execute code immediately after specific events occur in the eWMS, instead of having to make API calls periodically to check their status.

Registering webhooks

To learn more about registering webhooks, visit the webhook setup docs


Available webhook topics

  • Name
    article.created
    Type
    Description

    A new article was created.

  • Name
    article.updated
    Type
    Description

    An existing article was updated.

  • Name
    article.deleted
    Type
    Description

    An article was successfully deleted.

  • Name
    batch.updated
    Type
    Description

    An existing batch was updated.

  • Name
    inbound.created
    Type
    Description

    A new inbound was created.

  • Name
    inbound.updated
    Type
    Description

    An existing inbound was updated.

  • Name
    inbound.completed
    Type
    Description

    An existing inbound was completed.

  • Name
    modification.created
    Type
    Description

    A new modification was created.

  • Name
    modification.updated
    Type
    Description

    An existing modification was updated.

  • Name
    modification.approved
    Type
    Description

    An existing modification was approved.

  • Name
    modification.disapproved
    Type
    Description

    An existing modification was disapproved.

  • Name
    order.created
    Type
    Description

    A new order was created.

  • Name
    order.updated
    Type
    Description

    An existing order was updated.

  • Name
    order.planned
    Type
    Description

    An order was successfully planned.

  • Name
    order.processing
    Type
    Description

    An order is being processed.

  • Name
    order.shipped
    Type
    Description

    An order was successfully shipped.

  • Name
    shipment.created
    Type
    Description

    A new shipment was created.

  • Name
    shipment.updated
    Type
    Description

    An existing shipment was updated.

  • Name
    stock.updated
    Type
    Description

    An existing stock was updated.

  • Name
    variant.created
    Type
    Description

    A new variant was created.

  • Name
    variant.updated
    Type
    Description

    An existing variant was updated.

  • Name
    variant.deleted
    Type
    Description

    A variant was successfully deleted.

Example payload

{
    "body": {
    "id": "f9cc7e9c-7ac2-45df-b4a3-1a19321c144d",
    "ean": "123",
    "sku": "12345",
    "modified_at": "2022-02-11T17:45:01+0000",
    "article_code": "green_jacket",
    "stock_salable": 973,
    "stock_physical": 1000,
    "stock_available": 973,
    "stock_quarantine": 0
},
    "group": "stock",
    "action": "updated",
    "entity": "variant",
    "customer": "be62c27e-2aac-4ac1-902e-f770d64f8dce",
    "entityId": "f9cc7e9c-7ac2-45df-b4a3-1a19321c144d"
}

Webhook headers

Each webhook message has a variety of headers containing extra context. To know for sure that a webhook was, in fact, sent by eWarehousing instead of a malicious actor, you can verify the request signature. Each webhook request contains a header named X-Hmac-Sha256, and you can verify this signature by using your secret webhook key. The signature is an HMAC hash of the request payload hashed using your secret key.

Headers

  • Name
    X-Hmac-Sha256
    Type
    Description

    The webhook signature which can be used to validate the webhook.

    To learn more about the usage and verification of the X-Hmac-Sha256 header, visit the webhook setup docs

  • Name
    X-Webhook-Id
    Type
    Description

    The unique identifier of the webhook which can be used to validate the uniqueness of the webhook.

    Example: dba10ff9-b82f-4601-8d58-1f7b6a8ae721

  • Name
    X-Webhook-Topic
    Type
    Description

    Topic of the webhook, such as order/updated or stock/updated


Webhook limitations

  • Ordering isn't guaranteed between different topics for the same resource. For example, it's possible that an orders/updated webhook might be delivered before an orders/created webhook.
  • The webhooks API provides "at least once" delivery of webhook events. This means that an endpoint might receive the same webhook event more than once. You can detect duplicate webhook events by comparing the X-Webhook-Id header to previous events.
  • Webhook delivery isn't always guaranteed. You should therefore implement reconciliation jobs to fetch data from eWarehousing periodically.