Doorhub delivery webhooks

As a client of doorhub, you can get the updates of your orders once their status changed. Doorhub provides provides some webhooks that you can setup from your dashboard. Once they are setup you can get the information of the order.

Here is the different payload of the webhooks events

We will send you the defined timezone according to the store with UTC offset

Get stores pickup estimations

For every stores Doorhub can send a pickup estimations of all the stores that you have. Doorhub sent this informations in every 5 minutes.

curl -X PUT -G "webhook url" 
    -H "Authorization: Bearer {api-key}" 
    -H "Content-Type: application/json"

{success} Example payload

{
    "message": "Stores pickup estimations",
    "data": {
        "zoneEta": [
            {
                "zone": {
                    "name": "copenhagen-1",
                    "givenName": "Amager"
                },
                "etaPickup": "40",
                "storeIds": ["1231", "2133"]
            },
            {
                "zone": {
                    "name": "copenhagen-2",
                    "givenName": "Nørrebro"
                },
                "etaPickup": "30",
                "storeIds": ["5023", "4143"]
            }                  
        ],
        "timeStamp": "20200921T15:30:28+00:00"
    }
}

Driver is assigned

curl -X PUT -G "webhook url" 
    -H "Authorization: Bearer {api-key}" 
    -H "Content-Type: application/json"

{success} Example payload

{
    "message": "Driver is assigned to order 123asdads",
    "data": {
        "orderRef": "ABC1234-1212",
        "ownerRef": "123asdads",
        "driver": {
            "name": "First Last",
            "phone": "+4598273663",
            "etaAtPickup": "20200921T15:30:28+00:00",
            "etaAtDelivery": "20200921T15:45:28+00:00",
            "location": {
                "latitude": "51.51641",
                "longitude": "-0.103198"
            },
            "transport": {
                "name": "car",
                "vehicle": {
                    "type": "Micro van",
                    "capacity": "20",
                    "speed": "120"
                }
            }
        },
        "event": "driver-is-assigned",
        "timeStamp": "20200921T15:30:28+00:00"
    }
}

Get order best-guess estimations

For every order after a driver is assigned to the order and the order is in handle-now mode, Doorhub sends the pickup and delivery estimations based on the drivers position and other parameters. Doorhub sent this informations in every 2 minutes.

curl -X PUT -G "webhook url" 
    -H "Authorization: Bearer {api-key}" 
    -H "Content-Type: application/json"

{success} Example payload

{
    "message": "Orders pickup and delivery estimations",
    "data": [
      {
        "orderRef": "ABC1234-1215",
        "ownerRef": "123asdads",
        "etaAtPickup": "20200921T15:30:28+00:00",
        "etaAtDelivery": "20200921T15:45:28+00:00",
        "timeStamp": "20200921T15:30:28+00:00"
      },
      {
          "orderRef": "ABC1234-1212",
          "ownerRef": "123asdads1",
          "etaAtPickup": "20200921T15:30:28+00:00",
          "etaAtDelivery": "20200921T15:45:28+00:00",
          "timeStamp": "20200921T15:30:28+00:00"
      }
    ]
}

Once the order is collected, we will exclude the 'etaAtPickup'

Prepare the order

Doorhub can send the partner to let the stores know to prepare the order. This we can send if We have the store order preparation time. You can send this through the checkout api, or can setup while saving the store information to Doorhub. Doorhub default think 10 minutes as order preparation time for the stores.

curl -X PUT -G "webhook url" 
    -H "Authorization: Bearer {api-key}" 
    -H "Content-Type: application/json"

{success} Example payload

{
    "message": "Prepare the order ABC1234-1212",
    "data": {
        "orderRef": "ABC1234-1212",
        "ownerRef": "123asdads",
        "etaAtPickup": "20200921T15:30:28+00:00",
        "etaAtDelivery": "20200921T15:45:28+00:00",
        "event": "prepare-order",
        "timeStamp": "20200921T15:30:28+00:00"
    }
}

Order is ready to pickup

If any store said that the order is ready to pickup, Doorhub wants to get this informations, Once a store said order is ready, Doorhub will notify the driver immediately.

curl -X PUT -G "https://doorhub.io/api/platform/v1/order/ready" 
    -H "Authorization: Bearer {api-key}" 
    -H "Content-Type: application/json"

Doorhub expects UTC timestamp

{success} Example payload

{
    "orderRef": "ABC1234-1212",
    "ownerRef": "123412121",
    "timeStamp": "2020-09-21T15:30:28+00:00"  
}


Body Parameters
Parameters Type Status Description
orderRef string required if ownerRef is not provided what is the orderRef that the order is ready to pickup
ownerRef string required if orderRef is not provided what is the orderRef that the order is ready to pickup
timeStamp string optional when the order is ready, if not present we will use current time

Driver is at pickup location

curl -X PUT -G "webhook url" 
    -H "Authorization: Bearer {api-key}" 
    -H "Content-Type: application/json"

{success} Example payload

{
    "message": "Driver is at pickup location of order 123asdads",
    "data": {
        "orderRef": "ABC1234-1212",
        "ownerRef": "123asdads",
        "etaAtPickup": "20200921T15:30:28+00:00",
        "etaAtDelivery": "20200921T15:45:28+00:00",
        "event": "Driver-is-at-pickup-location",
        "timeStamp": "20200921T15:30:28+00:00"
    }
}

Order is collected

curl -X PUT -G "webhook url" 
    -H "Authorization: Bearer {api-key}" 
    -H "Content-Type: application/json"

{success} Example payload

{
    "message": "order 123asdads is collected",
    "data": {
        "orderRef": "ABC1234-1212",
        "ownerRef": "123asdads",
        "etaAtDelivery": "20200921T15:45:28+00:00",
        "event": "order-is-collected",
        "timeStamp": "20200921T15:30:28+00:00"
    }
}

Driver arrived to the drop off address

curl -X PUT -G "webhook url" 
    -H "Authorization: Bearer {api-key}" 
    -H "Content-Type: application/json"

{success} Example payload

{
    "message": "Driver is at delivery location of order 123asdads",
    "data": {
        "orderRef": "ABC1234-1212",
        "ownerRef": "123asdads",
        "etaAtDelivery": "20200921T15:45:28+00:00",
        "event": "driver-is-at-delivery-location",
        "timeStamp": "20200921T15:30:28+00:00"
    }
}

Order is delivered

curl -X PUT -G "webhook url" 
    -H "Authorization: Bearer {api-key}" 
    -H "Content-Type: application/json"

{success} Example payload

{
    "message": "order 123asdads is delivered",
    "data": {
        "orderRef": "ABC1234-1212",
        "ownerRef": "123asdads",
        "event": "order-is-delivered",
        "timeStamp": "20200921T15:30:28+00:00"
    }
}