Validate Delivery Job

The initial dispatch notification that a new job is available which needs validated as being deliverable

Webhook called to validate if drivers are available and check if it's possible to deliver one or multiple orders. You will receive this request for every order that is placed for delivery.

📘

The validate webhook needs to be standardized i.e. the same URL should be used for every customer install.

▶ See Delivery Job Model

Error codes

If delivery is not possible, one or more of the following error codes are expected to be returned in the response;

▶ See Error Codes

🚧

Delivery address coordinates

In the rare event that the coordinates are not part of the payload, you still need to validate the delivery job, since the delivery address details are always part of it.

{
    "jobId": "627a6f4c2*****3fbc79a",
    "account": "60f15a8***069643633",
    "pickupTime": "2022-05-10T14:12:31.649000Z",
    "transportType": "unknown",
    "driverTip": 500,
    "pickupLocation": {
      "location": "60f15a8e9****ddceb6a7b1",
      "name": "Location 1",
      "remarks": "",
      "street": "Van Slingelandtstraat",
      "streetNumber": "32",
      "postalCode": "1051CH",
      "city": "Amsterdam",
      "latitude": "52.3842918",
      "longitude": "4.8662024"
    },
    "deliveryLocations": [
      {
        "orderId": "627a6f*****5c09221a9837",
        "channelOrderDisplayId": "T191051",
        "deliveryTime": "2022-05-10T14:27:31.649000Z",
        "packageSize": "unknown",
        "orderDescription": "This is a test order",
        "company": "",
        "name": "",
        "street": "4 The Krook",
        "postalCode": "8888KL",
        "city": "Gent",
        "phone": "",
        "phoneAccessCode" : "43121212",
        "latitude": "29.37045479999999",
        "longitude": "47.9787778",
        "deliveryRemarks": "",
        "payment": {
          "orderIsAlreadyPaid": true,
          "amount": 800,
         "paymentType": 0
            }
        }
    ],
    "ageCheck": False
}

Here is an example of a response from your side.

{
  "jobId": "627a6f4c2*****3fbc79a",
  "canDeliver": true,
  "distance":10,
  "pickupTimeETA": "2022-05-10T14:47:31.649000Z",
  "deliveryLocations": [
    {
      "deliveryId": "ABC567",
      "orderId": "627a6f*****5c09221a9837",
      "deliveryTimeETA": "2022-05-10T14:57:31.649000Z"
    }
  ],
  "price": {
    "price": 750,
    "taxRate": 10000
  }
}
{
  "jobId": "",
  "canDeliver": false,
  "errors": [
    {
      "deliveryId": "",
      "orderId": "",
      "channelOrderDisplayId": "",
      "reason": 10,
      "description": "package size too large for delivery type"
    },
    {
      "deliveryId": "",
      "orderId": "",
      "channelOrderDisplayId": "",
      "reason": 20,
      "description": "No drivers available at this time"
    },
    {
      "deliveryId": "",
      "orderId": "",
      "channelOrderDisplayId": "",
      "reason": 30,
      "description": "address outside of delivery area"
    },
    {
      "deliveryId": "",
      "orderId": "",
      "channelOrderDisplayId": "",
      "reason": 40,
      "description": "too many packages for selected transport type"
    }
  ]
}

📘

Required parameters

All parameters shown in the response payload are required. Missing out will result in the create call request not to be triggered.

📘

deliveryId

When validating an order and accepting a job, there is no necessity to provide the deliveryId which will be used if the job is assigned.

This deliveryId be required when responding to the 'Create Delivery Job' webhook.

📘

phoneAccessCode

The parameter is optional and of type string . It will be only sent to dispatch partners in the payload if valid value is received in the order.

📘

"channelOrderDisplayId" on the pre-validation call

The pre-validation call happens before an order has been placed. In that case, the channelOrderDisplayId" will be an empty string until order placement is confirmed.

Language