Create Delivery

[Webhook] POST https://{logistics_platform_url}/delivery-jobs

This endpoint should be implemented on the logistics platform. Grubtech will call this endpoint when a delivery job needs to be created.

Request Body Parameters

All parameters are required unless stated otherwise.

Request Parameters - DeliveryJobRequest

Details required to create a new delivery job for the order.

Parameter Type Description
id string Grubtech provided unique id for the relevant delivery job
accountId string The id of the account this job should be billed to
pickups Pickup[] List of information about pickup details
dropOffs DropOff[] List of information about drop-off details
preparedAt string Order prepared time.This should be in date-time format
scheduledAt string Date and time which the schedule order ready to be delivered.This should be in date-time format

Request Parameters - Pickup

Details of the pickup for the specified delivery of the order.

Parameter Type Description
contactName string Name of the contact person at the pickup location
contactPhone string Phone number of person at the pickup location
displayOrderId string The order id that should be displayed to the driver. The driver should ask for the order using this number when they reach the pickup location. This id is not unique and doesn't have a consistent pattern
location Location Detailed description of the location of pickup, including all address lines and coordinates
items Items (optional) Order menu item information related to the delivery

Request Parameters - Location

Location information of the order delivery. Please note that either area or coordinates needs to be mandatory.

Parameter Type Description
address1 string First Address line. Example: 1st Road
address2 string Second Address line. Example: 104G
area string (optional) Area name part of the address.Either area or coordinates needs to be mandatory. Example: Dubai Marina
city string City name part of the address. Example: Dubai Marina
country string Name of the country. Example: Dubai Marina
notes string (optional) Any notes on the delivery location. Example: Delivery instructions
coordinates Coordinates Exact longitude and latitude details of the location

Request Parameters - Coordinates

Exact longitude and latitude details of the location.

Parameter Type Description
latitude string Geographic coordinate that specifies the north–south position of a point on the Earth's surface. Example: 25.049347
longitude string Geographic coordinate that specifies the east–west position of a point on the Earth's surface. Example: 55.231233

Request Parameters - Items

Brief information about Order menu item related to the delivery.

Parameter Type Description
name string Name of the item. Example: Hot Butter Cuttlefish
quantity integer Quantity of the delivery item

Request Parameters - DropOff

Information about drop-off details of the delivery.

Parameter Type Description
contactName string Name of the customer at the drop-off. Example: Mark
contactPhone string Contact number of the customer at the drop-off. Example: 9474323232323
location Location Detailed description of the location of pickup, including all address lines and coordinates
payment Payment Detailed information of the price with amount, currency, and formatted amount

Request Parameters - Payment

Payment information related to an order related to the delivery.

Parameter Type Description
mode string(enum) This is the payment methods for the order. To be used in conjunction with payment status. For example cash on delivery, status should be UNPAID and method should be CASH.
Allowed values:
  • CASH_ON_DELIVERY
  • CARD_ON_DELIVERY
  • PREPAID
money Money Price amount for the order

Request Body Parameters - Money

Detailed information of the price with amount, currency, and formatted amount.

Parameter Type Description
amount integer Specifies the price amount. Amount should always be integer value (never decimals) because the price is set in lowest denomination (e.g., cents for US currency, not dollars).Price should always be set even if price is 0.
currencyCode string These are the three-letter alphabetic codes that represent the various currencies used throughout the world. Example: AED
formattedAmount string Formatted amount. A display-friendly formatted string representation of the price amount including currency code. Example: AED 12.50

Request Body Example

A variety of example menu payloads are provided here: Example Delivery Payloads

Errors & Response Codes

Success Code

  • 202 - Successful response OK

This is the JSON format for the success response.

{
    "referenceId": "12345",
    "status": "DELIVERY_JOB_CREATED"
}

Failure Codes

  • 400 - Bad request
  • 500 - Internal server error

Response Code Formats

This is the JSON format for the failure responses.

{
   "code": "CANCELLATION_REJECTED",
   "message": "string",
   "errors": {
     "additionalProp1": {}
   },
   "timestamp": "string"
}