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.

Request parameters

ParameterMeaningType
jobIdDeliverect delivery job ID.string
pickupTimeExpected pick up time.string
pickupLocationOrder pick up location.object
deliveryLocationsArray of delivery locations.array (object)
deliveryLocations.orderIdDeliverect order ID.string
deliveryLocations.channelOrderDisplayIdChannel order ID.string
deliveryLocations.deliveryTimeExpected delivery time.string
deliveryLocations.packageSizePackage size (not provided for all channel orders)string
deliveryLocations.phoneAccessCodePhoneAccessCode if available from channel, field will be present only if value is not None.string
deliveryLocations.payment.orderIsAlreadyPaidIndicates if order has been paid already.bool
deliveryLocations.payment.amountPayment amount.integer
deliveryLocations.payment.paymentTypePayment type.integer
deliveryLocations.payment.paysWithCustomer pays with specified amount of money. Can be used to calculate change.integer

Response parameters

ParameterMeaningType
jobIdDeliverect delivery job ID.string
canDeliverIndicates if delivery partner able complete delivery job.bool
distanceIndicates the distance for the deliveryint
pickupTimeETAEstimated pick up time.string
priceThis is the cost charged for delivery.object
price.priceDelivery cost (1000 stands for 10.00).integer
price.taxRateTax rate for delivery - 10000 stands for 10.00% (if not applicable send 0)integer
courierIdThis is the unique identifier of the rider.string
externalJobIdJob id in delivery partner system.string
deliveryLocations.deliveryIdId of the delivery generated by delivery partner.string
deliveryLocations.orderIdDeliverect order ID.string
deliveryLocations.deliveryTimeETAEstimated delivery up time.string

Transport types

The following transport types are supported by deliverect.

Transport Type NameString Value
UNKNOWNunknown
BICYCLEbicycle
CARGOBIKEcargobike
MOTORBIKEmotorbike
MOTORBIKE XLmotorbikexl
CARcar

Package sizes

📘

Package size support is limited

Not all channels will provide the below variations on package size

The following package sizes are supported by deliverect.

Package Size NameString ValueDimensionsDescription
UNKNOWNunknownunknownunknown
SMALLsmall22 x 42 x 45 cmStandard delivery with a Courier on a bicycle or scooter.
LARGElarge30 x 124 x 80 cmDelivery which will require to be delivered via car
EXTRA LARGEextraLargeLarger than 30 x 124 x 80 cmFor large catering orders with many different trays to be delivered requiring a van

Payment info

Along with delivery location info, we send payment information. This contains if the order is paid for, the amount of payment, and the payment type. See the table below for payment types currently supported by Deliverect.

Payment Type NameInteger Value
Credit card online0
Cash1
On Delivery2
Online3
Credit Card at Door4
PIN at Door5
Voucher at Door6
Cheque7
Ban Contact8
Other9

Error codes

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

Deliverect error tagDescriptionInteger Value
UNKNOWNUnknown error occurred.0
INTERNAL ERRORInternal error occurred.5
PACKAGE SIZE TOO LARGEPackage is too big to be delivered.10
INVALID PACKAGE SIZEProvided package size is invalid.15
NO DRIVERS AVAILABLENo drivers available.20
INVALID DELIVERY DATAProvided data is not valid.25
OUTSIDE DELIVERY AREAPickup or drop off location is outside delivery zone.30
TOO MANY PACKAGESToo many packages within a delivery job.40
DELIVERY ADDRESS NOT RECOGNIZEDDelivery address is not recognized.50
PICKUP ADDRESS NOT RECOGNIZEDPickup address is not recognized.60
UNKNOWN DELIVERY JOBJob with provided ID not found of doesn't exist.70
CONTACT DATA INVALIDInvalid contact person data.80
INVALID COORDINATESProvided coordinates is not valid.90
TIME NOT ALLOWEDPickup or delivery time is not allowed.100
PAYMENT DECLINEDPayment declined.110
DUPLICATE JOBDelivery job already exists.120
CANNOT TRAVEL TO DELIVERYDrop off locations is not reachable.130
CANNOT CANCELCancel is not possible.140
DATE FORMAT ERRORInvalid date format.150
CONFIGURATION ERRORDelivery system settings misconfigured160
PARTNER_UNAVAILABLECommunication with partner not established170
{
    "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.

Language