Webhooks

As a shipment is processed by Wuunder, there are more actions relate to a shipment after booking than the API can respond with at the moment of booking.

Information that is useful to know can be communicated back to you, for this Wuunder uses webhooks.

Wuunder will send specific milestones or important information via webhooks when actions have taken place.

Using webhooks

Webhooks can be setup on an individual shipment with each API request. The field webhook_url on a shipment can be used to specify the URL you want Wuunder to communicate to. This URL is entirely up to you to decide. Wuunder will then send POST calls towards the specified URL with JSON payloads.

If you would set the webhook URL on a shipment like this:

// POST create order
{
  "order": {
    "receiver": { ... },
    "reference": "TEST-ORDER-1",
    "sender": { ... },
    "shipments": [
      {
        "currency": "EUR",
        "description": "Test shipment no 1",
        "external_id": "ID-1",
        "type": "package",
        "webhook_url": "https://my.application.com/api/callbacks/ID-1",
        ...
      }
    ]
  }
}

The URL will be used for all webhooks. The webhooks define the actions that are triggered in the payload with information regarding the shipment that it was triggered for.

You can setup an individual URL for each shipment, or a single URL for all shipments and detect the shipment by ID or content of the shipment that is returned in the payload.

Which webhooks

Webhooks are sent when the shipment is booked, when a draft is deleted (irrelevant for the orders API), when a label is printed and when the status of the shipment changes (optional).

On this page