Webhook called to validate if drivers are available and check if it's possible to deliver one or multiple orders.

Request parameters

Parameter

Meaning

Type

jobId

Deliverect delivery job ID.

string

pickupTime

Expected pick up time.

string

pickupLocation

Order pick up location.

object

deliveryLocations

Array of delivery locations.

array (object)

deliveryLocations.orderId

Deliverect order ID.

string

deliveryLocations.channelOrderDisplayId

Channel order ID.

string

deliveryLocations.deliveryTime

Expected delivery time.

string

deliveryLocations.packageSize

Package size (not provided for all channel orders)

string

deliveryLocations.payment.orderIsAlreadyPaid

Indicates if order has been paid already.

bool

deliveryLocations.payment.amount

Payment amount.

integer

deliveryLocations.payment.paymentType

Payment type.

integer

deliveryLocations.payment.paysWith

Customer pays with specified amount of money. Can be used to calculate change.

integer

Response parameters

Parameter

Meaning

Type

jobId

Deliverect delivery job ID.

string

canDeliver

Indicates if delivery partner able complete delivery job.

bool

pickupTimeETA

Estimated pick up time.

string

price

This is the cost charged for delivery.

object

price.price

Delivery cost (1000 stands for 10.00).

integer

price.taxRate

Tax rate for delivery - 10000 stands for 10.00% (if not applicable send 0)

integer

courierId

This is the unique identifier of the rider.

string

externalJobId

Job id in delivery partner system.

integer

deliveryLocations.deliveryId

Id of the delivery generated by delivery partner.

string

deliveryLocations.orderId

Deliverect order ID.

string

deliveryLocations.deliveryTimeETA

Estimated delivery up time.

string

Transport types

The following transport types are supported by deliverect.

Transport Type Name

String Value

UNKNOWN

unknown

BICYCLE

bicycle

CARGOBIKE

cargobike

MOTORBIKE

motorbike

MOTORBIKE XL

motorbikexl

CAR

car

Package sizes

The following package sizes are supported by deliverect.

Package Size Name

String Value

UNKNOWN

unknown

SMALL

small

MEDIUM

medium

LARGE

large

EXTRA LARGE

extraLarge

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 Name

Integer Value

Credit card online

0

Cash

1

On Delivery

2

Online

3

Credit Card at Door

4

PIN at Door

5

Voucher at Door

6

Cheque

7

Ban Contact

8

Other

9

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 tag

Description

Integer Value

UNKNOWN

Unknown error occurred.

0

INTERNAL ERROR

Internal error occurred.

5

PACKAGE SIZE TOO LARGE

Package is too big to be delivered.

10

INVALID PACKAGE SIZE

Provided package size is invalid.

15

NO DRIVERS AVAILABLE

No drivers available.

20

INVALID DELIVERY DATA

Provided data is not valid.

25

OUTSIDE DELIVERY AREA

Pickup or drop off location is outside delivery zone.

30

TOO MANY PACKAGES

Too many packages within a delivery job.

40

DELIVERY ADDRESS NOT RECOGNIZED

Delivery address is not recognized.

50

PICKUP ADDRESS NOT RECOGNIZED

Pickup address is not recognized.

60

UNKNOWN DELIVERY JOB

Job with provided ID not found of doesn't exist.

70

CONTACT DATA INVALID

Invalid contact person data.

80

INVALID COORDINATES

Provided coordinates is not valid.

90

TIME NOT ALLOWED

Pickup or delivery time is not allowed.

100

PAYMENT DECLINED

Payment declined.

110

DUPLICATE JOB

Delivery job already exists.

120

CANNOT TRAVEL TO DELIVERY

Drop off locations is not reachable.

130

CANNOT CANCEL

Cancel is not possible.

140

DATE FORMAT ERROR

Invalid date format.

150

CONFIGURATION ERROR

Delivery system settings misconfigured

160

PARTNER_UNAVAILABLE

Communication with partner not established

170

{
    "jobId": "",
    "account": "",
    "pickupTime": "2019-02-20T16:40:42.000000Z",
    "transportType": "bicycle",
    "pickupLocation": {
        "location": "",
        "name": "",
        "remarks": "",
        "street": "",
        "streetNumber": "",
        "postalCode": "",
        "city": "",
        "latitude": "",
        "longitude": ""
    },
    "deliveryLocations": [
        {
            "orderId":"",
            "channelOrderDisplayId": "",
            "deliveryTime": "2019-02-20T16:40:42.000000Z",
            "orderSize": "small",
            "orderDescription": "hot food",
            "company": "",
            "name": "",
            "street": "",
            "streetNumber": "",
            "postalCode": "",
            "city": "",
            "phone": "",
            "latitude": "",
            "longitude": "",
            "deliveryRemarks": "",
            "payment": {
                "orderIsAlreadyPaid": false,
                "amount": 1000,
                "paymentType": 2,
                "paysWith": null
            }
        }
    ]
}
{
  "jobId": "609***72e",
  "canDeliver": true,
  "pickupTimeETA": "2021-05-13T13:42:00Z",
  "deliveryLocations": [
    {
      "deliveryId": "ABC567",
      "orderId": "5f47a223280a29046404e2af",
      "deliveryTimeETA": "2021-05-13T13:59:00Z"
    }
  ],
  "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"
    }
  ]
}

📘

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.