# Delivery order

# API-3.3.1 Create order

POST /order/takeaway/create

API type Request API
Usage Create delivery order. Order creation is allowed when user locates inside delivery area only.

# Request

Name Type Mandatory Default Description Remarks
client_merchant_id string Y - Store ID in client system - Ref to [FAQ - What is client merchant id? Do I need to send store address when create order?]
client_order_id string(128) Y - Order ID in client system - This is the order ID generated in client system.
- The following rule applies:
1. When merchant_order_id is empty or not passed to Zeek platform, client_order_id must be numerical string. Zeek platform will use the last 4 digit of the client_order_id as the pickup code.
2. When merchant_order_id contains the 4 digits, client_order_id can be in non-numerical format.
merchant_order_id string(64) N - Pickup code - Notice: It must be a 4 digit number
- When merchant_order_id is empty, the last 4 digits of client_order_id will be extracted and applied to pickup code. Btw, we strongly recommend developer to input merchant_order_id.
Another usage is: When the merchant (ie. restaurant) has the order ID other than the client_order_id, please input here.
- Ref to FAQ - What is pickup code
order_time int Y - Order creation time in client system Timestamp in second
delivery_type string N - Delivery or pickup mode - This is not available in ZeekSolutions openapi.
is_appoint int N 0 Is it a scheduled order? - 0 : Not scheduled
- 2 : Scheduled by delivery time. The time should be after 60 mins from current time and within 7 days.
appoint_time string N* - Scheduled time - It is mandatory when is_appoint is not equal to 0.
- is_appoint = 2 : Please input the requested delivery time. System will publish the order by its own calculation.
- Example: 2018-07-24 18:54:07
remark string(1024) N "" Delivery order remarks - Special instruction to partner. For example: "Please dial the customer when arrive reception"
- Display in OneFleet App.
merchant_remark string(1024) N "" Merchant remarks - Instruction for merchant internal use.
- It is not displayed in OneFleet App.
cod_type int Y - Payment type 1 : Cash on delivery.
2 : Online Paid.
Depends on the accepted payment method of the specifc delivery party.
receive obj Y - Receiver info Please refer to receiver data format
order_detail obj Y - Order details Please refer to order_detail data format

receive data format

Name Type Mandatory Default Description Remarks
user_name string(64) Y - User name
user_phone string(32) Y - User phone number Not include country code, example: "91234567"
user_phone_country_code string(5) N See remarks User phone country code - For example: "852"
- Default country code value is assigned according to the region value in "Global parameters".
For instance, if region is "SG", then default country code will be "65".
user_address_id string N * "" User address ID - This is not available in ZeekSolutions openapi.
user_address string(255) Y - User address Please refer to [How to pass user address and location]
user_location string Y * "" User location coordinates Please refer to [How to pass user address and location]

order_detail data format

Name Type Mandatory Default Description Remarks
total_price int Y - Order total price - Unit: cents (1 dollar = 100 cents)
- Please input the order amount of products, excluding discount, tax and delivery fee.

Example:

{
    "auth": {
        // Authentication
    },
    "data": {
        "meta": {
            // Language and region settings
        },
        "client_merchant_id": "STORE-123",
        "client_order_id": "201806121528793155",
        "merchant_order_id": "1234",
        "is_appoint": 2,
        "appoint_time": "2018-07-24 18:54:07",
        "order_time": 1528793155,
        "remark": "Please dial the customer when arrive reception",
        "merchant_remark": "",
        "cod_type": 2,
        "receive": {
            "user_name": "Guiying Yao",
            "user_phone": "63632752",
            "user_phone_country_code": "65",
            "user_location": "22.3902837102,114.0042115195",
            "user_address": "#12-456, Woodlands, Singapore, 730779"
        },
        "order_detail": {
            "total_price": 200
        }
    }
}

# Response

Name Type Description Remarks
order_id string Order ID in Zeek Platform
client_order_id string Order ID in client system
order_url string Order URL - ZeekSolutions standard order tracker
direct_distance int Direct distance from merchant to customer - Unit : meter
travel_distance int Travel distance from merchant to customer - Unit : meter
predicted_accept_time int Predicted accept time - Unit : minute
- This is not available in ZeekSolutions openapi
predicted_accept_time_range string Predicted accept time range - Example:"30-40"
- This is not available in ZeekSolutions openapi
predicted_showup_time int Predicted showup time - Unit : minute
- This is not available in ZeekSolutions openapi
predicted_showup_time_range string Predicted showup time range - Example:"30-40"
- This is not available in ZeekSolutions openapi
predicted_delivery_time int Predicted delivery time - Unit : minute
- This is not available in ZeekSolutions openapi
predicted_delivery_time_range string Predicted delivery time range - Example:"30-40"
- This is not available in ZeekSolutions openapi
requested_pickup_time int Requested pickup time Timestamp in second
requested_delivery_time int Requested delivery time Timestamp in second

Example:

{
    "error": 0,
    "data": {
        "order_id": "FD20180615080181522",
        "client_order_id": "15104092022333",
        "order_url": "https://ap1-track.zeek.one/FD20180615080181522",
        "direct_distance": 500,
        "travel_distance": 650,
        "predicted_accept_time": 5,
        "predicted_accept_time_range": "5-10",
        "predicted_showup_time": 20,
        "predicted_showup_time_range": "20-30",
        "predicted_delivery_time": 40,
        "predicted_delivery_time_range": "40-60"
        "requested_pickup_time": 1655189860,
        "requested_delivery_time": 1655189860
    }
}

# API-3.3.2 Cancel order

POST /order/takeaway/cancel

API type Request API
Usage - Cancel delivery order
- Developer can cancel order before the order is completed.
- Different order status will be given if you cancel order before or after partner arrived store. Please refer to Order status code

# Request

Name Type Mandatory Default Description Remarks
order_id string(128) Y - Order ID in Zeek platform
client_merchant_id string Y - Store ID in client system
cancel_reason string(255) N "" Cancel reason
user_code string(4) N "0000" Staff number 4 digits format, example: "1234"

Example:

{
    "auth": {
        // Authentication
    },
    "data": {
        "meta": {
            // Language and region settings
        },
        "order_id": "FD20180615080181522",
        "client_merchant_id": "STORE-123",
        "cancel_reason": "Requested by customer",
        "user_code": "1223"
    }
}

# Response

Name Type Description Remarks
order_id string Order ID in Zeek Platform
client_order_id string Order ID in client system

Example:

{
    "error": 0,
    "data": {
        "order_id": "FD20180615080181522",
        "client_order_id": "14570817752333"
    }
}

# API-3.4.1 Get order details

POST /order/takeaway/info

API type Request API
Usage Get delivery order details

# Request

Name Type Mandatory Default Description Remarks
order_id string(128) Y - Order ID in Zeek platform
client_merchant_id string Y - Store ID in client system

Example:

{
    "auth": {
        // Authentication
    },
    "data": {
        "meta": {
            // Language and region settings
        },
        "order_id": "FD20180615080181522",
        "client_merchant_id": "STORE-123"
    }
}

# Response

Name Type Description Remarks
order_id string Order ID in Zeek Platform
client_order_id string Order ID in client system
order_url string Order URL ZeekSolutions standard order tracker
delivery_type string Delivery or pickup mode This is not available in ZeekSolutions openapi.
brand_id int Brand ID
brand_key string Brand Key
merchant_location string Merchant location
user_location string User location
direct_distance int Direct distance from merchant to customer - Unit : meter
travel_distance int Travel distance from merchant to customer - Unit : meter
addtime int Order creation time Timestamp in second
appointment_time int Scheduled time Timestamp in second
name string Order name
remark_text string Remarks
merchant_remark string erchant remarks
partner_name string Partner name - OneHub: Subject to 3PL response
partner_phone string Partner phone number - OneHub: Subject to 3PL response
partner_carno string Partner vehicle number - OneHub: Subject to 3PL response
order_status int Order status
cancel_code string Order cancel code Ref Order cancel code
cancel_user string Staff number who cancel order
cancel_type string Cancel order type
cancel_reason string Cancel order reason
cancel_time string Order cancel time Timestamp in second
actual_done_time int Order complete time Timestamp in second
requested_pickup_time int Requested pickup time Timestamp in second
requested_delivery_time int Requested delivery time Timestamp in second
lastmodify int Lastmodify time Timestamp in second

Example:

{
    "error": 0,
    "data": {
        "order_id": "FD2019010484047222",
        "client_order_id": "201901041133245454",
        "order_url": "https://ap1-track.zeek.one/FD2019010484047222",
        "delivery_type": "ZEEK_DELIVERY",
        "brand_id": 22,
        "brand_key": "abc-brand",
        "merchant_location": "22.3902837102,114.0042115195",
        "user_location": "22.3902837102,114.0042115195",
        "direct_distance": 500,
        "travel_distance": 650,
        "addtime": 1510733606,
        "appointment_time": 1510733606,
        "name": "ABC restaurant delivery",
        "remark_text": "Please dial the customer when arrive reception",
        "merchant_remark": "",
        "partner_name": "Zhihao Shi",
        "partner_phone": "62988967",
        "partner_carno": "AB1234",
        "order_status": 9025,
        "cancel_code": "7002",
        "cancel_user": "Peter Cheung",
        "cancel_type": "Other",
        "cancel_reason": "Requested by customer",
        "cancel_time": "1510733606",
        "actual_done_time": 1510733606,
        "requested_pickup_time": 1655189860,
        "requested_delivery_time": 1655189860,
        "lastmodify": 1510733606
    }
}

# API-3.9.1 Order status update callback

POST The endpoint is provided by developer

API type Callback API
Usage When delivery order status updates, Zeek platform will send latest status code to the callback API.

# Request failure handling

When Zeek platform cannot receive a successful response from callback API, it will be regarded as failure. Then the platform will retry. The retry frequency is 15/15/30/180/1800/1800/1800/1800/3600 in seconds.

# API Authentication

Zeek platform will pass signature to developer's callback API. The signature is generated according to Authentication. Therefore, please verify the signature by the same way.

# Request

Name Type Description Remarks
order_id string(128) Order ID in Zeek platform
client_order_id string Order ID in client system
timestamp int Actual timestamp when the status is triggered
order_status int Order status Please refer to [Order status code]
status_desc string Order status description
partner.partner_name string Partner name - OneHub: Subject to 3PL response
partner.partner_phone string Partner phone number - OneHub: Subject to 3PL response
partner.partner_location string Partner location coordinates - OneHub: Subject to 3PL response
cancel.cancel_reason string Cancel order reason
cancel.code string Order cancel code Ref [Order cancel code]
cancel.cancel_user string The user who cancelled the order
cancel.time string Cancellation time
predicted_accept_time int Predicted accept time - Unit:minute
- If partner have accepted order, Zeek Platform will send null.
- This is not available in ZeekSolutions openapi
predicted_accept_time_range string Predicted accept time range - Example:"30-40"
- If partner have accepted order, Zeek Platform will send null.
- This is not available in ZeekSolutions openapi
predicted_showup_time int Predicted showup time - Unit:minute
- If partner have arrived store, Zeek Platform will send null.
- This is not available in ZeekSolutions openapi
predicted_showup_time_range string Predicted showup time range - Example:"30-40"
- If partner have arrived store,Zeek Platform will send null.
- This is not available in ZeekSolutions openapi
predicted_delivery_time int Predicted delivery time - Unit:minute
- If the order is delivered, Zeek Platform will send null.
- This is not available in ZeekSolutions openapi
predicted_delivery_time_range string Predicted delivery time range - Example:"30-40"
- If the order is delivered, Zeek Platform will send null.
- This is not available in ZeekSolutions openapi
tasks array Partner’s service fee related Will be return with OneFleet customized package (Addition charges might be applied) .
Only returns with order status code 9021、9025、9026
tasks.[].id string Task ID Example:"2022072745382469"
tasks.[].partner object Partner-related
tasks.[].partner.id string Partner id Example:"7984"
tasks.[].partner.position string Partner type Example:"M"
tasks.[].partner.role string Partner role Example:"ZFL"
tasks.[].distance object Order distance-related
tasks.[].distance.direct int Order linear distance - Unit: Meter
-Example: 200
tasks.[].distance.travel int Order travel distance - Unit: Meter
-Example: 200
tasks.[].fee string Partner service fee Example:"฿ 30.00"

Example:

{
    "auth": {
        // Authentication
    },
    "data": {
        "meta": {
            // Language and region settings
        },
        "order_id": "FD20180615080181522",
        "client_order_id": "201808076580818698",
        "timestamp": 1533609085,
        "order_status": 9015,
        "status_desc": "Delivery in progress",
        "partner": {
            "partner_name": "Zhihao Shi",
            "partner_phone": "62988967",
            "partner_location": "22.3902837102,114.0042115195"
        },
        "cancel": {
            "cancel_reason": "Requested by customer",
            "code": "7002",
            "cancel_user": "0000",
            "cancel_time": "1625572417"
        },
        "tasks": [
            {
                "id": "2022072745382469",
                "partner": {
                    "id": "7894",
                    "position": "M",
                    "role": "ZFL"
                },
                "distance": {
                    "direct": 200,
                    "travel": 500
                },
                "fee": "฿ 30.00"
            }
        ],
        "predicted_accept_time": 5,
        "predicted_accept_time_range": "5-10",
        "predicted_showup_time": 10,
        "predicted_showup_time_range": "10-20",
        "predicted_delivery_time": 30,
        "predicted_delivery_time_range": "30-50"
    
    }
}

# Response

Please return the API response in callback API, according to the format below.

Name Type Description Remarks
error int Error code Return 0 when API request is successful.
err_msg string Error message
{
    "error": 0,
    "err_msg": ""
}

# API-3.5.1 Partner location

POST /tasker/takeaway/position_latest

API type Request API
Usage Get the current partner location of a delivery order

# Request

Name Type Mandatory Default Description Remarks
order_id string(128) Y - Order ID in Zeek platform
client_merchant_id string Y - Store ID in client system

Example:

{
    "auth": {
        // Authentication
    },
    "data": {
        "meta": {
            // Language and region settings
        },
        "order_id": "FD20180615080181522",
        "client_merchant_id": "STORE-123"
    }
}

# Response

Name Type Description Remarks
order_id string Order ID in Zeek Platform
client_order_id string Order ID in client system
partner_name string Partner name - OneHub: Subject to 3PL response
partner_location string Partner location - OneHub: Subject to 3PL response
upload_time int Lastmodify time Timestamp in second
predicted_delivery_time int Predicted delivery time - Unit : Minute
- It returns -1 after the order is completed.
- This is not available in ZeekSolutions openapi
predicted_delivery_time_range string Predicted delivery time range - Example: "30-40"
- This is not available in ZeekSolutions openapi

Example:

{
    "error": 0,
    "data": {
        "order_id": "FD20180615080181522",
        "client_order_id": "14570817752333",
        "partner_name": "Zhihao Shi",
        "partner_location": "22.3902837102,114.0042115195",
        "upload_time": 1510733606,
        "predicted_delivery_time": 30,
        "predicted_delivery_time_range": "30-60"
    }
}