Skip to content

The DHB Delivery API.

Book, price, track and cancel DHB deliveries from your own website, app, ERP or POS. Secure OAuth 2.0 keys, live order statuses and webhooks.

Quick start

Your first API call in four steps.

  1. Get your keys

    You need a DHB business account with API access switched on. Log in at app.dhbahrain.bh and open API OAuth2 Keys to copy your Client ID and Client Secret. Keep the secret on your server only.

  2. Get an access token

    Exchange your keys for an access token. The response also gives your Customer ID, used in most requests.

    curl -X POST https://api.dhbahrain.bh/api/v1/customer/auth/access-token \
      -H "Content-Type: application/json" \
      -d '{"clientId": "YOUR_CLIENT_ID", "clientSecret": "YOUR_CLIENT_SECRET"}'
    {
      "code": 0,
      "data": {
        "customerId": "YOUR_CUSTOMER_ID",
        "accessToken": "eyJhbGciOi…",
        "expiresIn": 3600
      }
    }
  3. Call the API

    Send the token as a Bearer header. Tokens expire after expiresIn seconds; request a new one when they do.

    curl "https://api.dhbahrain.bh/api/v1/customer/service?customerId=YOUR_CUSTOMER_ID" \
      -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
      -H "Accept-Language: en"
  4. Or use Postman

    Import the DHB collection into Postman, fill in clientId and clientSecret in the collection variables, then run Auth › Token Exchange. The token and Customer ID are saved for every other request automatically.

    Download collection (.json)Base URL: https://api.dhbahrain.bh

Common errors

403 · InvalidRefreshTokenThe Client ID or Client Secret is wrong. Copy both again from API OAuth2 Keys of the same account.
401 · UnauthorizedThe access token is missing or expired. Request a new one with Token Exchange.
ENOTFOUNDWrong server address. Use api.dhbahrain.bh.
429 · Too Many RequestsSlow down and retry after the time in the Retry-After header.
Reference

Order statuses

On-Demand Order Type Workflow

Status Description
Unassigned Order is unassigned.
Pending Order is pending. Normally, it's being dispatched or waiting for driver confirmation.
Assigned Order assigned to a driver.
Started The driver has started the order.
Arrived The driver has arrived at the pickup location.
PickedUp The driver has picked up the order.
Done Order is done.
SupportCanceled Order canceled by support.
CustomerCanceled Order canceled by customer.
DriverCanceled Order canceled by driver.

P&D Order Type Workflow

Status Description
Draft Order created but not confirmed yet. Customer can confirm to proceed.
Confirmed Order confirmed by customer.
PickupRouted Order assigned to a route, but no driver assigned yet.
ReadyForPickup Route assigned to a driver and shown on driver’s app.
PickedUp Driver scanned and picked up the order.
AtWarehouse Order arrived at the warehouse and scanned by dispatch.
DeliveryRouted Order sorted for delivery and assigned to a route, but no driver assigned yet.
ReadyForDelivery Route assigned to a driver and shown on driver’s app.
OutForDelivery Driver started the route, order is out for delivery.
Delivered Order delivered to the dropoff location.
NotDelivered Order not delivered with a reason. Can be reattempted or returned to sender.
ForReturn Order to be returned to the sender.
Returned Order successfully returned to the sender.
CustomerCanceled Customer canceled the order before pickup.
PickupFailed Driver canceled the order before pickup with a reason.
SupportCanceled Support team canceled the order.
Lost Order lost.

Auth

To get the access token, you need to use the Token Exchange API call. You need to use the provided clientId and clientSecret.

Token Exchange

POSThttps://api.dhbahrain.bh/api/v1/customer/auth/access-token

Request body

{
    "clientId": "YOUR_CLIENT_ID",
    "clientSecret": "YOUR_CLIENT_SECRET"
}

Example responses

200Successful - with clientId and clientSecret
{
    "code": 0,
    "message": "",
    "data": {
        "customerId": "ckwyjium80uiygno84w29f1j0",
        "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNrd3lqaXVtODB1aXlnbm84NHcyOWYxajAiLCJzb3VyY2UiOiJidXNpbmVzcyIsImlhdCI6MTY4NjI1NzcxMiwiZXhwIjoxNjg2MjYxMzEyfQ.rFb-GQQAxyYQdimlBQGKNfUfYSdsXVEkfMC7F151QVI",
        "expiresIn": 3600
    },
    "metadata": []
}
403InvalidRefreshToken
{
    "code": -8,
    "message": "InvalidRefreshToken",
    "data": [],
    "meta": {
        "stack": "InvalidRefreshToken: InvalidRefreshToken\n    at AuthService.accessTokenExchange (/Users/mohssen-22/QCompany/fast00/rest/dist/components/auth/customer/business/services/auth.js:35:19)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)\n    at async ExpressCustomerAuthController.accessTokenExchange (/Users/mohssen-22/QCompany/fast00/rest/dist/controllers/express/customer/auth.js:28:26)",
        "url": "/api/v1/customer/auth/access-token",
        "method": "POST"
    }
}

Login

POSThttps://api.dhbahrain.bh/api/v1/customer/business/auth/login

Request body

{
    "username": "test_b",
    "password": "123123"
}

Example responses

200Successful
{
    "code": 0,
    "message": "",
    "data": {
        "customerId": "cki1xic53003iv2o8fchq8yku",
        "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNraTF4aWM1MzAwM2l2Mm84ZmNocTh5a3UiLCJzb3VyY2UiOiJidXNpbmVzcyIsImlhdCI6MTczMjQ1MzE4OCwiZXhwIjoxNzMyNDU2Nzg4fQ.f_OzpdbkUP0hC-PB6a-SQpzMiKn_2Ct2jYa0kAOxYQQ",
        "refreshToken": "3ddbf30c9015ba4d73f4c69cf61ca3185dd47739a814adfb455391f7c62fabd8"
    },
    "metadata": []
}
400CustomerNotRegistered
{
    "code": -3,
    "message": "You are not signed up. Please sign up first",
    "data": [],
    "meta": {
        "stack": "CustomerNotRegistered: You are not signed up. Please sign up first\n    at AuthService.login (/usr/src/app/rest/dist/components/auth/customer/business/services/auth.js:50:19)\n    at async ExpressBusinessAuthController.login (/usr/src/app/rest/dist/controllers/express/business/auth.js:64:26)",
        "url": "/api/v1/customer/business/auth/login",
        "method": "POST"
    }
}

Services

Services List

GEThttps://api.dhbahrain.bh/api/v1/customer/serviceBearer token

Query parameters

customerId

Example responses

200Successful
{
    "code": 0,
    "message": "",
    "data": [
        {
            "id": "cktn18cyk08i01co820pnaaxt",
            "title": "1 Bag",
            "description": "Collection, storage and delivery of one bag.",
            "icon": "https://app.dhbahrain.bh/static/services/uaGIa1vXO3RkfoV45OmMAOVM.png",
            "setting": {
                "enablePod": true,
                "enableCustomerPhoto": false,
                "enableDriverPhoto": false,
                "enableReceiverCash": true,
                "isSurchargeActive": true,
                "isDriverPhotoRequired": false,
                "isPodDescriptionRequired": true,
                "isPodPhotoRequired": false,
                "isPodSignatureRequired": false,
                "isAddressDetailsActive": true,
                "isCashBySenderActive": true,
                "driverAssignmentModel": "automatic",
                "isVehicleTypeSelectionActive": false,
                "isCODActive": true,
                "dispatchPriority": 1,
                "dispatchThreshold": 5,
                "isDropoffAddressEmailActive": true,
                "isDropoffAddressEmailRequired": false,
                "isDropoffAddressNameActive": true,
                "isDropoffAddressNameRequired": false,
                "isDropoffAddressPhoneActive": true,
                "isDropoffAddressPhoneRequired": false,
                "isDropoffAddressRoomFloorBlockActive": true,
                "isPickupAddressEmailActive": true,
                "isPickupAddressEmailRequired": false,
                "isPickupAddressNameActive": true,
                "isPickupAddressNameRequired": false,
                "isPickupAddressPhoneActive": true,
                "isPickupAddressPhoneRequired": false,
                "isPickupAddressRoomFloorBlockActive": true,
                "maxCODLimit": 1000,
                "isReferenceIdActive": true,
                "isPOPActive": true,
                "isPOPNoteRequired": false,
                "isPOPPhotoRequired": false,
                "isPOPSignatureRequired": false,
                "isPOPBarcodeScanRequired": false,
                "isPodBarcodeScanRequired": false
            },
            "options": [
                {
                    "id": "ckff4p9pi00a3vzo85quu846l",
                    "title": "fragile",
                    "type": "boolean"
                }
            ],
            "scheduleSetting": {
                "isActive": true,
                "isPickupNowActive": false,
                "scheduleDateRangeAfter": 1800000,
                "scheduleDateRangeBefore": 172800000,
                "scheduleDateStep": 1800000,
                "hasDropoffScheduling": true,
                "guidelines": "0"
            },
            "deliveryMethods": [
                {
                    "id": "67fa4c258bf6893d25544cbd",
                    "title": "Document",
                    "description": "",
                    "pickupLocationType": "address",
                    "dropoffLocationType": "address",
                    "setting": {
                        "enablePod": true,
                        "enableReceiverCash": true,
                        "isPodSignatureRequired": false,
                        "isPodPhotoRequired": false,
                        "isPodDescriptionRequired": true,
                        "isDriverPhotoRequired": false,
                        "isAddressDetailsActive": true,
                        "isCashBySenderActive": true,
                        "isCODActive": true,
                        "isPickupAddressNameActive": true,
                        "isPickupAddressPhoneActive": true,
                        "isPickupAddressEmailActive": true,
                        "isPickupAddressRoomFloorBlockActive": true,
                        "isPickupAddressNameRequired": false,
                        "isPickupAddressPhoneRequired": false,
                        "isPickupAddressEmailRequired": false,
                        "isDropoffAddressNameActive": true,
                        "isDropoffAddressPhoneActive": true,
                        "isDropoffAddressEmailActive": true,
                        "isDropoffAddressRoomFloorBlockActive": true,
                        "isDropoffAddressNameRequired": false,
                        "isDropoffAddressPhoneRequired": false,
                        "isDropoffAddressEmailRequired": false,
                        "maxCODLimit": 1000,
                        "isPOPActive": true,
                        "isPOPSignatureRequired": false,
                        "isPOPPhotoRequired": false,
                        "isPOPNoteRequired": false,
                        "isPOPBarcodeScanRequired": false,
                        "isPodBarcodeScanRequired": false
                    },
                    "scheduleSetting": {
                        "isActive": true,
                        "isPickupNowActive": false,
                        "scheduleDate
…
401JWTAuthenticationError
{
    "code": -9,
    "message": "JWTAuthenticationError,jwt malformed",
    "data": [],
    "meta": {
        "stack": "JWTAuthenticationError: JWTAuthenticationError,jwt malformed\n    at ExpressCustomerAuthMiddleware.authenticate (/Users/mohssen-22/QCompany/fast00/rest/dist/core/express/middlewares/auth.js:154:22)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)",
        "url": "/api/v1/customer/service",
        "method": "GET"
    }
}

Vehicle types list

GEThttps://api.dhbahrain.bh/api/v1/customer/service/vehicle-typeBearer token

Example responses

200Successful
{
    "code": 0,
    "message": "",
    "data": [
        {
            "id": "ckff5r5ex00csvzo8gbdwbidb",
            "title": "Bike VIP",
            "icon": "https://app.dhbahrain.bh/static/vehicletypes/cG4-e7FpdAKhfiILxSLaBV_E.png",
            "options": [
                {
                    "id": "zILEakmlhVUHdqe4O_BZ5",
                    "data": [
                        {
                            "id": "2IeJq2j8FWuJfgCoVl8JL",
                            "title": "t"
                        }
                    ],
                    "type": "list",
                    "title": "test",
                    "isRequired": false
                },
                {
                    "id": "vjqcxdFtRUkRM9hWOO6a-",
                    "type": "boolean",
                    "title": "tb"
                }
            ],
            "description": "Bike"
        },
        {
            "id": "clakjkbhf1cuybgo84fvc02qq",
            "title": "Bike",
            "icon": "https://app.dhbahrain.bh/static/vehicletypes/p1Grezta5mTf9DwOmiveYx-P.png",
            "options": [
                {
                    "id": "ldgRhnIA2q4YHm0LvcDmn",
                    "data": [
                        {
                            "id": "f0XOwHcRnJCPwaj8hVIXQ",
                            "title": "Delivery Basket"
                        },
                        {
                            "id": "ns4rTg2KQxQIhbHHl4PkG",
                            "title": "Waterproof Cover"
                        },
                        {
                            "id": "4h86hUH2De1_iw6PGupd7",
                            "title": "Safety Helmet"
                        }
                    ],
                    "type": "list",
                    "title": "Available Equipment",
                    "isRequired": true
                },
                {
                    "id": "W93vIRbS7WrPFMrMEOS4i",
                    "type": "boolean",
                    "title": "Need helper"
                }
            ],
            "description": "Bike"
        },
        {
            "id": "IVF9tE1hu8G-05RzTWzgH",
            "title": "Truck",
            "icon": "https://app.dhbahrain.bh/static/vehicletypes/fBLBiHpok6f1Jugwd17AaLdp.png",
            "options": [],
            "description": "Truck"
        },
        {
            "id": "15lNKiRkQ53N4JI8SQo-y",
            "title": "All Test",
            "icon": "https://app.dhbahrain.bh/static/vehicletypes/lL0i6RwQmAiA48yzrz08XcTg.png",
            "options": [],
            "description": "GGG"
        },
        {
            "id": "mkuf3ZSdrPs6i9_BG-Vyl",
            "title": "Car",
            "icon": "https://app.dhbahrain.bh/static/vehicletypes/y9LwNEaE3Xakbez-IWwTOiEs.png",
            "options": [],
            "description": "Car"
        },
        {
            "id": "ckff6ageq00envzo8brky5cqt",
            "title": "Mini Van",
            "icon": "https://app.dhbahrain.bh/static/vehicletypes/aQIOM7Gmcjq0Q4vD8zrF1fmp.png",
            "options": [
                {
                    "id": "vkQCZDuIymGJJcm20-niO",
                    "data": [
                        {
                            "id": "kfifrMHekrpKBMjYjwDyG",
                            "title": "1 Dollar"
                        }
                    ],
                    "type": "list",
                    "title": "Hurry?",
                    "isRequired": true
                },
                {
                    "id": "JZ3DuhMtjasvf9EOEoSaq",
                    "type": "boolean",
                    "title": "Cooler"
                }
            ],
            "description": "Mini Van"
        }
    ],
    "metadata": []
}
400InputValidationError
{
    "code": -1,
    "message": "\"serviceId\" is required (serviceId),\"customerId\" is required (customerId)",
    "data": [],
    "meta": {
        "stack": "",
        "url": "/api/v1/customer/service/vehicle-type",
        "method": "GET"
    }
}

Orders

Shipment Label

POSThttps://api.dhbahrain.bh/api/v1/customer/order/shipment-label/export-pdfBearer token

Request body

{
    "ids": [
        "i2McN4L6vL1_rbkAgcOqJ",
        "Q4E0FPz2emZNDol0ltL4U",
        "0D3C8ZzJovhINShz1vM1c"
    ],
    "customerId": "YOUR_CUSTOMER_ID"
}

Example responses

401JWTAuthenticationError
{
    "code": -9,
    "message": "JWTAuthenticationError,jwt malformed",
    "data": [],
    "meta": {
        "stack": "JWTAuthenticationError: JWTAuthenticationError,jwt malformed\n    at ExpressCustomerAuthMiddleware.authenticate (/usr/src/app/rest/dist/core/express/middlewares/auth.js:188:22)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
        "url": "/api/v1/customer/order/shipment-label/export-pdf",
        "method": "POST"
    }
}
400InputValidationError
{
    "code": -1,
    "message": "\"ids\" is required (ids),\"customerId\" is required (customerId)",
    "data": [],
    "meta": {
        "stack": "InputValidationError: \"ids\" is required (ids),\"customerId\" is required (customerId)\n    at validate (/usr/src/app/rest/dist/core/express/middlewares/validator.js:37:15)\n    at /usr/src/app/rest/dist/core/express/middlewares/validator.js:8:51\n    at Layer.handle [as handle_request] (/usr/src/app/rest/node_modules/express/lib/router/layer.js:95:5)\n    at next (/usr/src/app/rest/node_modules/express/lib/router/route.js:149:13)\n    at ExpressCustomerAuthMiddleware.authenticate (/usr/src/app/rest/dist/core/express/middlewares/auth.js:164:17)\n    at Layer.handle [as handle_request] (/usr/src/app/rest/node_modules/express/lib/router/layer.js:95:5)\n    at next (/usr/src/app/rest/node_modules/express/lib/router/route.js:149:13)\n    at Route.dispatch (/usr/src/app/rest/node_modules/express/lib/router/route.js:119:3)\n    at Layer.handle [as handle_request] (/usr/src/app/rest/node_modules/express/lib/router/layer.js:95:5)\n    at /usr/src/app/rest/node_modules/express/lib/router/index.js:284:15\n    at Function.process_params (/usr/src/app/rest/node_modules/express/lib/router/index.js:346:12)\n    at next (/usr/src/app/rest/node_modules/express/lib/router/index.js:280:10)\n    at Function.handle (/usr/src/app/rest/node_modules/express/lib/router/index.js:175:3)\n    at router (/usr/src/app/rest/node_modules/express/lib/router/index.js:47:12)\n    at Layer.handle [as handle_request] (/usr/src/app/rest/node_modules/express/lib/router/layer.js:95:5)\n    at trim_prefix (/usr/src/app/rest/node_modules/express/lib/router/index.js:328:13)",
        "url": "/api/v1/customer/order/shipment-label/export-pdf",
        "method": "POST"
    }
}

Track Driver

POSThttps://api.dhbahrain.bh/api/v1/customer/order/track-driverBearer token

Request body

{
    "customerId": "YOUR_CUSTOMER_ID",
    "orderId": "m1SpEhQoKsIZkpgiACsqB"
}

Example responses

200Successful
{
    "code": 0,
    "message": "",
    "data": {
        "location": [
            25.289048770165103,
            54.71036568073705
        ],
        "avatarPhoto": "https://app.dhbahrain.bh/static/drivers/p7Es-Kv7y-nvXoXtjUxajF1C.png",
        "name": "Matthew Delphi",
        "statusDescription": "On the way",
        "phone": "+37058493026",
        "status": "Started",
        "realETA": 0
    },
    "metadata": []
}
403Successful - no driver
{
    "code": 0,
    "message": "",
    "data": {
        "location": [
            0,
            0
        ],
        "avatarPhoto": "",
        "name": "",
        "statusDescription": "Order received",
        "phone": "",
        "status": "Pending"
    },
    "metadata": []
}

Orders List

GEThttps://api.dhbahrain.bh/api/v1/customer/orderBearer token

Possible Statuses : ['Pending', 'Assigned', 'Started', 'PickedUp', 'Arrived' ]

Query parameters

customerId

Example responses

200Successful - Ondemand
{
    "code": 0,
    "message": "",
    "data": [
        {
            "id": "ihlm7YyyvzpMHXcvgLxc_",
            "createdAt": 1718865252700,
            "status": "Pending",
            "type": "Ondemand",
            "dropoffs": [
                {
                    "address": "Dubai Tower 1 - Ras Al Khor - Dubai Creek Harbour - Dubai - United Arab Emirates"
                }
            ],
            "service": {
                "icon": "https://app.dhbahrain.bh/static/services/BvDfbbDUvdezJutqmRvriaNP.png",
                "title": "Box"
            },
            "pickup": {
                "address": "6934+2WJ - Ras Al Khor - Dubai Creek Harbour - Dubai - United Arab Emirates",
                "schedulePickupNow": false,
                "scheduleDateAfter": 0,
                "scheduleDateBefore": 0
            },
            "statusDescription": "Order received",
            "vehicleType": {
                "title": "Car",
                "icon": "https://app.dhbahrain.bh/static/vehicletypes/5AOU2IHmlVmhyQ6Tnu8N9ccr.png"
            },
            "isScheduled": false,
            "dropoff": null,
            "statusUpdatedAt": 1718865252700
        }
    ],
    "metadata": []
}
200Successful - PickupDelivery
{
    "code": 0,
    "message": "",
    "data": [
        {
            "id": "rGxLNMnsUkT2WhewoAZFO",
            "createdAt": 1730296248769,
            "status": "Draft",
            "type": "PickupDelivery",
            "service": {
                "icon": "https://app.dhbahrain.bh/static/services/-qqkgW2arcpmqjHtRJAEbs-s.png",
                "title": "Box"
            },
            "pickup": {
                "address": "F4JX+P3V Santo Domingo Este",
                "schedulePickupNow": false,
                "scheduleDateAfter": 0,
                "scheduleDateBefore": 0,
                "completeAfter": 0,
                "completeBefore": 0
            },
            "delivery": {
                "address": "WH7Q+VVP Bonao, República Dominicana",
                "scheduleDateAfter": 0,
                "scheduleDateBefore": 0,
                "completeAfter": 0,
                "completeBefore": 0
            },
            "statusDescription": "Draft",
            "dropoff": {
                "address": "WH7Q+VVP Bonao, República Dominicana",
                "scheduleDateAfter": 0,
                "scheduleDateBefore": 0
            },
            "dropoffs": [],
            "isScheduled": false,
            "vehicleType": null,
            "statusUpdatedAt": 1730296248769
        },
        {
            "id": "-o5jjxJR9n4Q_rbYXOYXS",
            "createdAt": 1730296248109,
            "status": "Draft",
            "type": "PickupDelivery",
            "service": {
                "icon": "https://app.dhbahrain.bh/static/services/-qqkgW2arcpmqjHtRJAEbs-s.png",
                "title": "Box"
            },
            "pickup": {
                "address": "F4JX+P3V Santo Domingo Este",
                "schedulePickupNow": false,
                "scheduleDateAfter": 0,
                "scheduleDateBefore": 0,
                "completeAfter": 0,
                "completeBefore": 0
            },
            "delivery": {
                "address": "WHQR+MRX Bonao, República Dominicana",
                "scheduleDateAfter": 0,
                "scheduleDateBefore": 0,
                "completeAfter": 0,
                "completeBefore": 0
            },
            "statusDescription": "Draft",
            "dropoff": {
                "address": "WHQR+MRX Bonao, República Dominicana",
                "scheduleDateAfter": 0,
                "scheduleDateBefore": 0
            },
            "dropoffs": [],
            "isScheduled": false,
            "vehicleType": null,
            "statusUpdatedAt": 1730296248109
        },
        {
            "id": "sKmvoqGcTx4iuu1oImCho",
            "createdAt": 1730296247505,
            "status": "Draft",
            "type": "PickupDelivery",
            "service": {
                "icon": "https://app.dhbahrain.bh/static/services/-qqkgW2arcpmqjHtRJAEbs-s.png",
                "title": "Box"
            },
            "pickup": {
                "address": "F4JX+P3V Santo Domingo Este",
                "schedulePickupNow": false,
                "scheduleDateAfter": 0,
                "scheduleDateBefore": 0,
                "completeAfter": 0,
                "completeBefore": 0
            },
            "delivery": {
                "address": "WHRQ+P5P Bonao, República Dominicana",
                "scheduleDateAfter": 0,
                "scheduleDateBefore": 0,
                "completeAfter": 0,
                "completeBefore": 0
            },
            "statusDescription": "Draft",
            "dropoff": {
                "address": "WHRQ+P5P Bonao, República Dominicana",
                "scheduleDateAfter": 0,
                "scheduleDateBefore": 0
            },
            "dropoffs": [],
            "isScheduled": false,
            "vehicleType": null,
            "statusUpdatedAt": 1730296247505
        },
        {
            "id": "MElInlr99yrf5zAUiamgS",
            "createdAt": 1730296246554,
            "status": "Draft",
            "type": "PickupDelivery",
            "service": {
                "icon": "https://app.dhbahrain.bh/static/services/-qqkgW2arcpmqjHtRJAEbs-s.png",
                "title": "Box"
            },
            "pickup": {
                "address": "F4JX+P3V Santo Domingo Este",
                "schedulePickupNow": false,
                "scheduleDateAfter": 0,
                "scheduleDateBefore": 0,
                "completeAfter": 0,
                "completeBefore": 0
            },
            "delivery": {
                "address": "WHCV+P52 Bonao, República Dominicana",
                "scheduleDateAfter": 0,
                "scheduleDateBefore": 0,
                "completeAfter": 0,
                "completeBefore": 0
            },
            "statusDescription": "Draft",
            "dropoff": {
                "address": "WHCV+P52 Bonao, República Dominicana",
                "scheduleDateAfter": 0,
                "scheduleDateBefore": 0
            },
            "dropoffs": [],
     
…

Events

GEThttps://api.dhbahrain.bh/api/v1/customer/order/eventBearer token

Possible Statuses : ['Pending', 'Assigned', 'Started', 'PickedUp', 'Arrived' ]

Query parameters

orderId
customerId

Example responses

200Successful
{
    "code": 0,
    "message": "",
    "data": [
        {
            "title": "Created",
            "description": "Created",
            "createdAt": 1628926441212
        },
        {
            "title": "Started",
            "description": "Started",
            "createdAt": 1628926496704
        },
        {
            "title": "Assigned",
            "description": "Driver Assigned",
            "createdAt": 1628926460728
        },
        {
            "title": "DriverCanceled",
            "description": "Driver Canceled",
            "createdAt": 1628926501972
        },
        {
            "title": "Updated",
            "description": "Change Order Status To Assigned",
            "createdAt": 1687101261514
        },
        {
            "title": "Support Canceled",
            "description": "Support Canceled The Order",
            "createdAt": 1689079530141
        },
        {
            "title": "Order Done",
            "description": "Order Done",
            "createdAt": 1707233336775
        },
        {
            "title": "Customer Canceled",
            "description": "Order canceled by customer",
            "createdAt": 1723881993403
        },
        {
            "title": "Customer Canceled",
            "description": "Order canceled by customer",
            "createdAt": 1740831095527
        },
        {
            "title": "Customer Canceled",
            "description": "Order canceled by customer",
            "createdAt": 1740831143995
        },
        {
            "title": "Customer Canceled",
            "description": "Order canceled by customer",
            "createdAt": 1740831216415
        },
        {
            "title": "Updated",
            "description": "Change Order Status To Assigned",
            "createdAt": 1759037398025
        },
        {
            "title": "Driver Canceled",
            "description": "Driver Canceled The Order",
            "createdAt": 1759058944207
        },
        {
            "title": "Driver Canceled",
            "description": "Driver Canceled The Order",
            "createdAt": 1760734808830
        },
        {
            "title": "Updated",
            "description": "Change Order Status To Arrived",
            "createdAt": 1760734821328
        },
        {
            "title": "Updated",
            "description": "Change Order Status To Arrived",
            "createdAt": 1760734867340
        },
        {
            "title": "Support Canceled",
            "description": "Order canceled by support",
            "createdAt": 1760763615695
        }
    ],
    "metadata": []
}
403Order not found
{
    "code": -21,
    "message": "Order not found",
    "data": [],
    "meta": {
        "stack": "",
        "url": "/api/v1/customer/order/event?customerId=ckrhmfo3gnz2yylo836sh15pw&orderId=cksbgqu1oc1o5o6o8hh8u4us",
        "method": "GET"
    }
}

P&D Orders

Update Address

POSThttps://api.dhbahrain.bh/api/v1/customer/order/pickup-delivery/addressBearer token

Updates the pickup and delivery addresses for a P&D order. The response follows the Order Info API response shape.

Required: orderId, customerId, pickup, and delivery. Each address object requires addressDetail, email, completeAfter, and completeBefore (use 0 when unscheduled).

Optional/useful: placeId (use "" when unavailable), address, coordinates as [longitude, latitude], phone, fullName, servicePointId, and customFields (non-empty object or null).

Request body

{
    "orderId": "TF4qBRmyWpRLmOV8yG3cJ",
    "customerId": "YOUR_CUSTOMER_ID",
    "pickup": {
        "placeId": "",
        "address": "Perlojos g. 23B, 45313, Kauno miesto, Kauno miesto savivaldybė, Kauno apskritis, LTU",
        "addressDetail": "Apartment or building details",
        "coordinates": [
            23.96437173010254,
            54.86803460688516
        ],
        "phone": "+676222111",
        "fullName": "John Due",
        "email": "pickup@example.com",
        "completeAfter": 0,
        "completeBefore": 0,
        "customFields": null
        // "servicePointId": "", // omit if "locationType": "address"
    },
    "delivery": {
        "placeId": "",
        "address": "Europos prospektas, 46242, Kaunas, Kauno apskritis, LTU",
        "addressDetail": "Block A2",
        "coordinates": [
            23.92059807897949,
                54.87810937009431
        ],
        "phone": "Alexander Due",
        "fullName": "Delivery contact",
        "email": "delivery@example.com",
        "completeAfter": 1789346447602,
        "completeBefore": 1789349447602,
        "customFields": null
        // "servicePointId": "", // omit if "locationType": "address"
    }
}

Example responses

200Successful
{
    "code": 0,
    "message": "",
    "data": {
        "id": "TF4qBRmyWpRLmOV8yG3cJ",
        "status": "Confirmed",
        "type": "PickupDelivery",
        "statusMessage": "",
        "price": 10,
        "code": "4737926",
        "statusDescription": "Confirmed",
        "paymentMethod": "Wallet",
        "paymentSide": "Sender",
        "currencyCode": "USD",
        "promoCode": "",
        "promoAmount": 0,
        "promoPercentage": 0,
        "trackOrder": "https://track.dhbahrain.bh/ojFn2UolyW",
        "trackOrderMessage": "On the Way",
        "paymentProvider": null,
        "paymentMethodId": null,
        "cardInfo": null,
        "customerRate": null,
        "customerRateText": null,
        "hasFeedbackPageSeen": null,
        "customerReceiptUrl": "https://app.dhbahrain.bh/admin/order/customer/receipt/714531f5a75982715b6dae67fa5290bc",
        "pickupOrderTrackUrl": "https://track.dhbahrain.bh/ojFn2UolyW",
        "deliveryOrderTrackUrl": "https://track.dhbahrain.bh/ojFn2UolyW",
        "cardChargeDescription": null,
        "isCardCharged": null,
        "shipmentLabelUrl": "https://app.dhbahrain.bh/admin/order/shipment-label/714531f5a75982715b6dae67fa5290bc",
        "codAmount": 0,
        "service": {
            "id": "-HKM6VbknPwAHOjgngmn7",
            "title": "Document",
            "icon": "https://app.dhbahrain.bh/static/services/GbSLZa0BL6EShMe8Qb4keAay.png",
            "setting": {
                "enableReceiverCash": true,
                "isCashBySenderActive": true,
                "enableCustomerPhoto": false,
                "isCODActive": false,
                "enablePod": true,
                "enableDriverPhoto": false,
                "isReferenceIdActive": true,
                "isAddressDetailsActive": true,
                "isPOPActive": true
            },
            "options": [],
            "scheduleSetting": {
                "isActive": true,
                "isPickupNowActive": true,
                "scheduleDateRangeAfter": 1800000,
                "scheduleDateRangeBefore": 2628000000,
                "scheduleDateStep": 300000,
                "hasDropoffScheduling": true,
                "guidelines": "Help"
            }
        },
        "createdAt": 1788980787184,
        "estimatedDistanceInMeters": 5501.552922616504,
        "estimatedDuration": 528.5828020975127,
        "note": "",
        "referenceId": "",
        "stage": "Pickup",
        "statusUpdatedAt": 1788980787184,
        "pickup": {
            "address": "Perlojos g. 23B, 45313, Kauno miesto, Kauno miesto savivaldybė, Kauno apskritis, LTU",
            "addressDetail": "Apartment or building details",
            "coordinates": [
                23.96437173010254,
                54.86803460688516
            ],
            "placeId": "",
            "fullName": "John Due",
            "phone": "+676222111",
            "email": "pickup@example.com",
            "popPhoto": "",
            "popSignature": "",
            "popNote": "",
            "completeAfter": 0,
            "completeBefore": 0,
            "customFields": null,
            "customFieldDefinitions": null,
            "failedReason": null,
            "buildingBlock": "",
            "floor": "",
            "room": "",
            "scheduleDateAfter": 0,
            "scheduleDateBefore": 0,
            "customerDescription": "",
            "driverDescription": "",
            "proofs": [],
            "locationType": "address",
            "servicePoint": null
        },
        "dropoff": {
            "address": "Europos prospektas, 46242, Kaunas, Kauno apskritis, LTU",
            "coordinates": [
                23.92059807897949,
                54.87810937009431
            ],
            "placeId": "",
            "fullName": "Delivery contact",
            "phone": "+Alexander Due",
            "email": "delivery@example.com",
            "podPhoto": "",
            "podSignature": "",
            "buildingBlock": "",
            "floor": "",
            "room": "",
            "scheduleDateAfter": 1789346447602,
            "scheduleDateBefore": 1789349447602,
            "customerDescription": "",
            "driverDescription": "",
            "customFields": null,
            "customFieldDefinitions": null
        },
        "delivery": {
            "address": "Europos prospektas, 46242, Kaunas, Kauno apskritis, LTU",
            "addressDetail": "Block A2",
            "coordinates": [
                23.92059807897949,
                54.87810937009431
            ],
            "placeId": "",
            "fullName": "Delivery contact",
            "phone": "+Alexander Due",
            "email": "delivery@example.com",
            "podPhoto": "",
            "podSignature": "",
            "podNote": "",
            "completeAfter": 1789346447602,
            "completeBefore": 1789349447602,
            "lastAttemptReason": null,
            "proofs": [],
            "locationType": "
…
400Invalid Zone
{
    "code": -400,
    "message": "Not a valid zone selected",
    "data": [],
    "meta": {
        "stack": "",
        "url": "/api/v1/customer/order/pickup-delivery/address",
        "method": "POST"
    }
}

Update Custom Fields

POSThttps://api.dhbahrain.bh/api/v1/customer/order/pickup-delivery/custom-fieldBearer token

Updates the pickup and delivery custom fields for a P&D order. The response follows the Order Info API response shape.

Required: orderId and customerId.

Optional/useful: customFields (non-empty object or null) for updating custom fields associated with the P&D order, referenceId (use null when unavailable), and note (use "" when no note is provided).

Request body

{
    "orderId": "TF4qBRmyWpRLmOV8yG3cJ",
    "customerId": "YOUR_CUSTOMER_ID",
    "customFields": {
        "delivery_instructions": "Leave the package at the front door",
        "is_priority": true
    },
    "referenceId": "123456",
    "note": "Please call the customer before delivery."
}

Example responses

200Successful
{
    "code": 0,
    "message": "",
    "data": {
        "id": "TF4qBRmyWpRLmOV8yG3cJ",
        "status": "Confirmed",
        "type": "PickupDelivery",
        "statusMessage": "",
        "price": 10,
        "code": "4737926",
        "statusDescription": "Confirmed",
        "paymentMethod": "Wallet",
        "paymentSide": "Sender",
        "currencyCode": "USD",
        "promoCode": "",
        "promoAmount": 0,
        "promoPercentage": 0,
        "trackOrder": "https://track.dhbahrain.bh/ojFn2UolyW",
        "trackOrderMessage": "On the Way",
        "paymentProvider": null,
        "paymentMethodId": null,
        "cardInfo": null,
        "customerRate": null,
        "customerRateText": null,
        "hasFeedbackPageSeen": null,
        "customerReceiptUrl": "https://app.dhbahrain.bh/admin/order/customer/receipt/714531f5a75982715b6dae67fa5290bc",
        "pickupOrderTrackUrl": "https://track.dhbahrain.bh/ojFn2UolyW",
        "deliveryOrderTrackUrl": "https://track.dhbahrain.bh/ojFn2UolyW",
        "cardChargeDescription": null,
        "isCardCharged": null,
        "shipmentLabelUrl": "https://app.dhbahrain.bh/admin/order/shipment-label/714531f5a75982715b6dae67fa5290bc",
        "codAmount": 0,
        "service": {
            "id": "-HKM6VbknPwAHOjgngmn7",
            "title": "Document",
            "icon": "https://app.dhbahrain.bh/static/services/GbSLZa0BL6EShMe8Qb4keAay.png",
            "setting": {
                "enableReceiverCash": true,
                "isCashBySenderActive": true,
                "enableCustomerPhoto": false,
                "isCODActive": false,
                "enablePod": true,
                "enableDriverPhoto": false,
                "isReferenceIdActive": true,
                "isAddressDetailsActive": true,
                "isPOPActive": true
            },
            "options": [],
            "scheduleSetting": {
                "isActive": true,
                "isPickupNowActive": true,
                "scheduleDateRangeAfter": 1800000,
                "scheduleDateRangeBefore": 2628000000,
                "scheduleDateStep": 300000,
                "hasDropoffScheduling": true,
                "guidelines": "Help"
            }
        },
        "createdAt": 1788980787184,
        "estimatedDistanceInMeters": 5501.552922616504,
        "estimatedDuration": 528.5828020975127,
        "note": "Please call the customer before delivery.",
        "referenceId": "123456",
        "stage": "Pickup",
        "statusUpdatedAt": 1788980787184,
        "pickup": {
            "address": "Perlojos g. 23B, 45313, Kauno miesto, Kauno miesto savivaldybė, Kauno apskritis, LTU",
            "addressDetail": "Apartment or building details",
            "coordinates": [
                23.96437173010254,
                54.86803460688516
            ],
            "placeId": "",
            "fullName": "John Due",
            "phone": "+676222111",
            "email": "pickup@example.com",
            "popPhoto": "",
            "popSignature": "",
            "popNote": "",
            "completeAfter": 0,
            "completeBefore": 0,
            "customFields": null,
            "customFieldDefinitions": null,
            "failedReason": null,
            "buildingBlock": "",
            "floor": "",
            "room": "",
            "scheduleDateAfter": 0,
            "scheduleDateBefore": 0,
            "customerDescription": "",
            "driverDescription": "",
            "proofs": [],
            "locationType": "address",
            "servicePoint": null
        },
        "dropoff": {
            "address": "Europos prospektas, 46242, Kaunas, Kauno apskritis, LTU",
            "coordinates": [
                23.92059807897949,
                54.87810937009431
            ],
            "placeId": "",
            "fullName": "Delivery contact",
            "phone": "+Alexander Due",
            "email": "delivery@example.com",
            "podPhoto": "",
            "podSignature": "",
            "buildingBlock": "",
            "floor": "",
            "room": "",
            "scheduleDateAfter": 1789346447602,
            "scheduleDateBefore": 1789349447602,
            "customerDescription": "",
            "driverDescription": "",
            "customFields": null,
            "customFieldDefinitions": null
        },
        "delivery": {
            "address": "Europos prospektas, 46242, Kaunas, Kauno apskritis, LTU",
            "addressDetail": "Block A2",
            "coordinates": [
                23.92059807897949,
                54.87810937009431
            ],
            "placeId": "",
            "fullName": "Delivery contact",
            "phone": "+Alexander Due",
            "email": "delivery@example.com",
            "podPhoto": "",
            "podSignature": "",
            "podNote": "",
            "completeAfter": 1789346447602,
            "completeBefore": 1789349447602,
            "lastAttemptReason": null,
        
…
400InputValidationError
{
    "code": -1,
    "message": "\"orderId\" is required (orderId),\"customerId\" is required (customerId),\"customFields\" must have at least 1 key (customFields)",
    "data": [],
    "meta": {
        "stack": "",
        "url": "/api/v1/customer/order/pickup-delivery/address",
        "method": "POST"
    }
}

Create Order

POSThttps://api.dhbahrain.bh/api/v1/customer/order/pickup-deliveryBearer token
Field Description
customerId Unique identifier for the customer.
pickup Pickup location object. Object
pickup.address Pickup address.
pickup.addressDetail - Optional Additional details about the pickup address (e.g., apartment number, building name).
pickup.completeAfter The earliest time for the pickup to be completed. Set 0 if it's not scheduled. timestamp in ms
pickup.completeBefore The latest time for the pickup to be completed. Set 0 if it's not scheduled. timestamp in ms
pickup.coordinates Latitude and longitude of the pickup location. [long, lat]
Note: It's NOT [lat, long], it's vice versa.
pickup.fullName - Optional Additional details about the pickup address (e.g., apartment number, building name).
pickup.phone - Optional Contact phone number for the pickup location.
pickup.email - Optional Contact email for the pickup location.
pickup.placeId - Optional Place ID from a map service for the pickup location. You should set "" for this field.
delivery Delivery location object.
delivery.address Delivery address. Object
delivery.addressDetail - Optional It's the same as pickup.
delivery.completeAfter It's the same as pickup.
delivery.completeBefore It's the same as pickup.
delivery.fullName - Optional It's the same as pickup.
delivery.phone - Optional It's the same as pickup.
delivery.email - Optional It's the same as pickup.
delivery.placeId - Optional It's the same as pickup.
service Details about the service being requested.
service.id Unique identifier for the service.
service.options List of service type options. If there is no option selected, [] should be set. Array Of Objects
service.options.id Unique identifier for the service option.
service.options.dataId (Data ID for list or boolean service type options.
service.options.inputValue Input value for input service type options.
paymentMethod Method of payment. Cash Wallet
paymentSide Indicates who will make the payment. Sender Receiver
draft Indicates if the order is a draft. true false. If it's false, the order status will be Confirmed.
codAmount - Optional Cash on delivery amount. If there is no COD, 0 should be set.
uid - Optional Client unique identifier for preventing duplications. If there is no mechanism, set "" for this field.
note - Optional Additional notes or instructions. "" if there is no note.
referenceId - Optional Reference identifier for the order.

Request body

{
    "customerId": "YOUR_CUSTOMER_ID",
    "pickup": {
        "address": "Cumberland Gate, London W2 2UH, UK",
        "addressDetail": "",
        "completeAfter": 1717869467474,
        "completeBefore": 1717869467474,
        "coordinates": [
            -0.15869881563038823,
            51.51268479847148
        ],
        "fullName": "samuel",
        "phone": "611522",
        "email": "abcd@pickup.org",
        "placeId": "" // map service place id
    },
    "delivery": {
        "address": "62 Albemarle St, London W1S 4BD, UK",
        "addressDetail": "block A2",
        "completeAfter": 1717873067474,
        "completeBefore": 1717876667474,
        "coordinates": [
            -0.1405885408344662,
            51.50785039521855
        ],
        "fullName": "mosi pann",
        "phone": "1154123",
        "email": "abcd@delivery.org",
        "placeId": "" // map service place id
    },
    "service": {
        "id": "c7tLEt1KOkkgcG-6Exadx",
        "options": [
            {
                // type=list servicetype option
                "id": "XYezIwmkhXXyKKOwVqMbL",
                "dataId": "QQNWe9WRid2y0mOA0bmt_"
            },
            {
                // type=input servicetype option
                "id": "JlI_Ez5wyNuXMHq4FCm_m",
                "inputValue": "20 lbs"
            },
            {
                // type=boolean servicetype option
                "id": "ElGWocOJaKXTcjW782jbr",
                "dataId": ""
            }
        ]
    },
    "paymentMethod": "Cash", // Cash, Wallet
    "paymentSide": "Sender", // Sender, Receiver
    "draft": true,
    "codAmount": 0, // optional
    "uid": "115", // optional
    "note": "note", // optional
    "referenceId": "ref#112" // optional
}

Example responses

200Successful - pickup/delivery address
{
    "code": 0,
    "data": {
        "orderId": "vqmFtLPvcazNZDsKcP-Ii"
    },
    "metadata": []
}
200Successful - pickup/delivery service point
{
    "code": 0,
    "data": {
        "orderId": "vqmFtLPvcazNZDsKcP-Ii"
    },
    "metadata": []
}

Order Info

GEThttps://api.dhbahrain.bh/api/v1/customer/order/TF4qBRmyWpRLmOV8yG3cJBearer token

Possible Statuses : ['Pending', 'Assigned', 'Started', 'PickedUp', 'Arrived' ]

Query parameters

customerId

Example responses

200Successful
{
    "code": 0,
    "message": "",
    "data": {
        "id": "TF4qBRmyWpRLmOV8yG3cJ",
        "status": "Confirmed",
        "type": "PickupDelivery",
        "statusMessage": "",
        "price": 10,
        "code": "4737926",
        "statusDescription": "Confirmed",
        "paymentMethod": "Wallet",
        "paymentSide": "Sender",
        "currencyCode": "USD",
        "promoCode": "",
        "promoAmount": 0,
        "promoPercentage": 0,
        "trackOrder": "https://track.dhbahrain.bh/ojFn2UolyW",
        "trackOrderMessage": "On the Way",
        "paymentProvider": null,
        "paymentMethodId": null,
        "cardInfo": null,
        "customerRate": null,
        "customerRateText": null,
        "hasFeedbackPageSeen": null,
        "customerReceiptUrl": "https://app.dhbahrain.bh/admin/order/customer/receipt/714531f5a75982715b6dae67fa5290bc",
        "pickupOrderTrackUrl": "https://track.dhbahrain.bh/ojFn2UolyW",
        "deliveryOrderTrackUrl": "https://track.dhbahrain.bh/ojFn2UolyW",
        "cardChargeDescription": null,
        "isCardCharged": null,
        "shipmentLabelUrl": "https://app.dhbahrain.bh/admin/order/shipment-label/714531f5a75982715b6dae67fa5290bc",
        "codAmount": 0,
        "service": {
            "id": "-HKM6VbknPwAHOjgngmn7",
            "title": "Document",
            "icon": "https://app.dhbahrain.bh/static/services/GbSLZa0BL6EShMe8Qb4keAay.png",
            "setting": {
                "enableReceiverCash": true,
                "isCashBySenderActive": true,
                "enableCustomerPhoto": false,
                "isCODActive": false,
                "enablePod": true,
                "enableDriverPhoto": false,
                "isReferenceIdActive": true,
                "isAddressDetailsActive": true,
                "isPOPActive": true
            },
            "options": [],
            "scheduleSetting": {
                "isActive": true,
                "isPickupNowActive": true,
                "scheduleDateRangeAfter": 1800000,
                "scheduleDateRangeBefore": 2628000000,
                "scheduleDateStep": 300000,
                "hasDropoffScheduling": true,
                "guidelines": "Help"
            }
        },
        "createdAt": 1788980787184,
        "estimatedDistanceInMeters": 5501.552922616504,
        "estimatedDuration": 528.5828020975127,
        "note": "",
        "referenceId": "",
        "stage": "Pickup",
        "statusUpdatedAt": 1788980787184,
        "pickup": {
            "address": "Perlojos g. 23B, 45313, Kauno miesto, Kauno miesto savivaldybė, Kauno apskritis, LTU",
            "addressDetail": "",
            "coordinates": [
                23.96437173010254,
                54.86803460688516
            ],
            "placeId": "",
            "fullName": "John Due",
            "phone": "+676222111",
            "email": "",
            "popPhoto": "",
            "popSignature": "",
            "popNote": "",
            "completeAfter": 0,
            "completeBefore": 0,
            "customFields": null,
            "customFieldDefinitions": null,
            "failedReason": null,
            "buildingBlock": "",
            "floor": "",
            "room": "",
            "scheduleDateAfter": 0,
            "scheduleDateBefore": 0,
            "customerDescription": "",
            "driverDescription": "",
            "proofs": [],
            "locationType": "address",
            "servicePoint": null
        },
        "dropoff": {
            "address": "Europos prospektas, 46242, Kaunas, Kauno apskritis, LTU",
            "coordinates": [
                23.92059807897949,
                54.87810937009431
            ],
            "placeId": "",
            "fullName": "",
            "phone": "",
            "email": "",
            "podPhoto": "",
            "podSignature": "",
            "buildingBlock": "",
            "floor": "",
            "room": "",
            "scheduleDateAfter": 0,
            "scheduleDateBefore": 0,
            "customerDescription": "",
            "driverDescription": "",
            "customFields": null,
            "customFieldDefinitions": null
        },
        "delivery": {
            "address": "Europos prospektas, 46242, Kaunas, Kauno apskritis, LTU",
            "addressDetail": "",
            "coordinates": [
                23.92059807897949,
                54.87810937009431
            ],
            "placeId": "",
            "fullName": "",
            "phone": "",
            "email": "",
            "podPhoto": "",
            "podSignature": "",
            "podNote": "",
            "completeAfter": 0,
            "completeBefore": 0,
            "lastAttemptReason": null,
            "proofs": [],
            "locationType": "address",
            "customFields": null,
            "customFieldDefinitions": null,
            "servicePoint": null
        },
        "customerPhoto": "",
        "isScheduled": false,
        "del
…
400BadRequest: Order not found
{
    "code": -400,
    "message": "Order not found",
    "data": [],
    "meta": {
        "stack": "BadRequest: Order not found\n    at OrderCrudService.getOrderInfo (/usr/src/app/rest/dist/components/order/crud/customer/services/crud.js:82:19)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async ExpressCustomerOrderController.getOrderInfo (/usr/src/app/rest/dist/controllers/express/customer/order.js:184:27)",
        "url": "/api/v1/customer/order/e7LMNBN_kA4H_GkHlxlUe?customerId=ckfezc72o01f1xxo81la4bvl",
        "method": "GET"
    }
}

Calculate Cost

POSThttps://api.dhbahrain.bh/api/v1/customer/order/pickup-delivery/calculate-priceBearer token

Request body

{
    "customerId": "YOUR_CUSTOMER_ID",
    "pickup": {
        "coordinates": [
            -0.15869881563038823,
            51.51268479847148
        ],
        "completeAfter": 0,
        "completeBefore": 0
    },
    "delivery": {
        "coordinates": [
            -0.1405885408344662,
            51.50785039521855
        ],
        "completeAfter": 0,
        "completeBefore": 0
    },
    "service": {
        "id": "c7tLEt1KOkkgcG-6Exadx",
        "options": [
            {
                // type=list servicetype option
                "id": "XYezIwmkhXXyKKOwVqMbL",
                "dataId": "QQNWe9WRid2y0mOA0bmt_"
            },
            {
                // type=input servicetype option
                "id": "JlI_Ez5wyNuXMHq4FCm_m",
                "inputValue": "20 lbs"
            },
            {
                // type=boolean servicetype option
                "id": "ElGWocOJaKXTcjW782jbr",
                "dataId": ""
            }
        ]
    }
}

Example responses

200Successful
{
    "code": 0,
    "message": "",
    "data": {
        "price": 120,
        "currencyCode": "GBP"
    },
    "metadata": []
}
400BadRequest: Service unavailable
{
    "code": -400,
    "message": "Service unavailable",
    "data": [],
    "meta": {
        "stack": "BadRequest: Service unavailable\n    at PricingService.calculatePickupDelivery (/usr/src/app/rest/dist/components/pricing/common/services/pricing.js:364:19)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async ExpressCustomerOrderController.calculatePickupDelivery (/usr/src/app/rest/dist/controllers/express/customer/order.js:569:45)",
        "url": "/api/v1/customer/order/pickup-delivery/calculate-price",
        "method": "POST"
    }
}

Confirm Order

POSThttps://api.dhbahrain.bh/api/v1/customer/order/pickup-delivery/confirmBearer token

Request body

{
    "orderId": "e7LMNBN_kA4H_GkHlxlUe",
    "customerId": "YOUR_CUSTOMER_ID"
}

Example responses

200Successful
{
    "code": 0,
    "message": "",
    "data": {
        "id": "e7LMNBN_kA4H_GkHlxlUe",
        "status": "Confirmed",
        "type": "PickupDelivery",
        "statusMessage": "",
        "price": 0,
        "code": "#ZNV5X033H",
        "statusDescription": "Confirmed",
        "paymentMethod": "Cash",
        "paymentSide": "Sender",
        "currencyCode": "GBP",
        "promoCode": "",
        "promoAmount": 0,
        "promoPercentage": 0,
        "trackOrder": "https://track.dhbahrain.bh/cgc4oQeifb",
        "trackOrderMessage": "",
        "paymentProvider": null,
        "paymentMethodId": null,
        "cardInfo": null,
        "customerRate": null,
        "customerRateText": null,
        "hasFeedbackPageSeen": null,
        "customerReceiptUrl": "https://app.dhbahrain.bh/admin/order/customer/receipt/4e5d074fde4affcc876937fbbde34bd2",
        "pickupOrderTrackUrl": "https://track.dhbahrain.bh/cgc4oQeifb",
        "deliveryOrderTrackUrl": "https://track.dhbahrain.bh/cgc4oQeifb",
        "cardChargeDescription": null,
        "isCardCharged": null,
        "shipmentLabelUrl": "https://app.dhbahrain.bh/admin/order/shipment-label/4e5d074fde4affcc876937fbbde34bd2",
        "codAmount": 0,
        "service": {
            "id": "c7tLEt1KOkkgcG-6Exadx",
            "title": "Box",
            "icon": "https://app.dhbahrain.bh/static/services/qiaINAKxULnu8Z6m7sWrd0i4.png",
            "setting": {
                "enableReceiverCash": true,
                "isCashBySenderActive": true,
                "enableCustomerPhoto": false,
                "isCODActive": true,
                "enablePod": true,
                "enableDriverPhoto": false,
                "isAddressDetailsActive": true
            },
            "options": [
                {
                    "id": "XYezIwmkhXXyKKOwVqMbL",
                    "title": "Box weight",
                    "type": "list",
                    "dataId": "QQNWe9WRid2y0mOA0bmt_",
                    "dataTitle": "50 kilograms",
                    "inputValue": null,
                    "inputType": null,
                    "isRequired": false
                },
                {
                    "id": "JlI_Ez5wyNuXMHq4FCm_m",
                    "title": "Exact weight",
                    "type": "input",
                    "dataId": null,
                    "dataTitle": "",
                    "inputValue": "20 lbs",
                    "inputType": "text",
                    "isRequired": false
                },
                {
                    "id": "ElGWocOJaKXTcjW782jbr",
                    "title": "Important document",
                    "type": "boolean",
                    "dataId": null,
                    "dataTitle": "",
                    "inputValue": null,
                    "inputType": null,
                    "isRequired": null
                }
            ],
            "scheduleSetting": {
                "isActive": true,
                "isPickupNowActive": false,
                "scheduleDateRangeAfter": 600000,
                "scheduleDateRangeBefore": 1200000000,
                "scheduleDateStep": 600000,
                "hasDropoffScheduling": true,
                "guidelines": "1. select your Pickup time 2. Select your Dropoff time 3. Place your order."
            }
        },
        "createdAt": 1717870565503,
        "estimatedDistanceInMeters": 2405,
        "estimatedDuration": 510,
        "note": "note",
        "referenceId": "ref#112",
        "stage": "Pickup",
        "statusUpdatedAt": 1717871344301,
        "pickup": {
            "address": "Cumberland Gate, London W2 2UH, UK",
            "addressDetail": "",
            "coordinates": [
                -0.15869881563038823,
                51.51268479847148
            ],
            "placeId": "",
            "fullName": "samuel",
            "phone": "00611522",
            "email": "abcd@pickup.org",
            "podPhoto": "",
            "podSignature": "",
            "podNote": "",
            "completeAfter": 1717869467474,
            "completeBefore": 1717869467474,
            "buildingBlock": "",
            "floor": "",
            "room": "",
            "scheduleDateAfter": 1717869467474,
            "scheduleDateBefore": 1717869467474,
            "customerDescription": "note",
            "driverDescription": ""
        },
        "dropoff": {
            "address": "Cumberland Gate, London W2 2UH, UK",
            "coordinates": [
                -0.15869881563038823,
                51.51268479847148
            ],
            "placeId": "",
            "fullName": "samuel",
            "phone": "00611522",
            "email": "abcd@pickup.org",
            "podPhoto": "",
            "podSignature": "",
            "buildingBlock": "",
            "floor": "",
            "room": "",
            "scheduleDateAfter": 1717869467474,
            "scheduleDateBefore": 1717869467474,
            "customerDescription"
…
400InputValidationError
{
    "code": -1,
    "message": "\"orderId\" is required (orderId),\"customerId\" is required (customerId)",
    "data": [],
    "meta": {
        "stack": "InputValidationError: \"orderId\" is required (orderId),\"customerId\" is required (customerId)\n    at validate (/usr/src/app/rest/dist/core/express/middlewares/validator.js:37:15)\n    at /usr/src/app/rest/dist/core/express/middlewares/validator.js:8:51\n    at Layer.handle [as handle_request] (/usr/src/app/rest/node_modules/express/lib/router/layer.js:95:5)\n    at next (/usr/src/app/rest/node_modules/express/lib/router/route.js:149:13)\n    at Route.dispatch (/usr/src/app/rest/node_modules/express/lib/router/route.js:119:3)\n    at Layer.handle [as handle_request] (/usr/src/app/rest/node_modules/express/lib/router/layer.js:95:5)\n    at /usr/src/app/rest/node_modules/express/lib/router/index.js:284:15\n    at Function.process_params (/usr/src/app/rest/node_modules/express/lib/router/index.js:346:12)\n    at next (/usr/src/app/rest/node_modules/express/lib/router/index.js:280:10)\n    at Function.handle (/usr/src/app/rest/node_modules/express/lib/router/index.js:175:3)\n    at router (/usr/src/app/rest/node_modules/express/lib/router/index.js:47:12)\n    at Layer.handle [as handle_request] (/usr/src/app/rest/node_modules/express/lib/router/layer.js:95:5)\n    at trim_prefix (/usr/src/app/rest/node_modules/express/lib/router/index.js:328:13)\n    at /usr/src/app/rest/node_modules/express/lib/router/index.js:286:9\n    at param (/usr/src/app/rest/node_modules/express/lib/router/index.js:365:14)\n    at param (/usr/src/app/rest/node_modules/express/lib/router/index.js:376:14)",
        "url": "/api/v1/customer/order/pickup-delivery/confirm",
        "method": "POST"
    }
}

Draft Order

POSThttps://api.dhbahrain.bh/api/v1/customer/order/pickup-delivery/draftBearer token

Request body

{
    "orderId": "e7LMNBN_kA4H_GkHlxlUe",
    "customerId": "YOUR_CUSTOMER_ID"
}

Example responses

200Successful
{
    "code": 0,
    "message": "",
    "data": {
        "id": "e7LMNBN_kA4H_GkHlxlUe",
        "status": "Draft",
        "type": "PickupDelivery",
        "statusMessage": "",
        "price": 0,
        "code": "#ZNV5X033H",
        "statusDescription": "Draft",
        "paymentMethod": "Cash",
        "paymentSide": "Sender",
        "currencyCode": "GBP",
        "promoCode": "",
        "promoAmount": 0,
        "promoPercentage": 0,
        "trackOrder": "https://track.dhbahrain.bh/cgc4oQeifb",
        "trackOrderMessage": "",
        "paymentProvider": null,
        "paymentMethodId": null,
        "cardInfo": null,
        "customerRate": null,
        "customerRateText": null,
        "hasFeedbackPageSeen": null,
        "customerReceiptUrl": "https://app.dhbahrain.bh/admin/order/customer/receipt/4e5d074fde4affcc876937fbbde34bd2",
        "pickupOrderTrackUrl": "https://track.dhbahrain.bh/cgc4oQeifb",
        "deliveryOrderTrackUrl": "https://track.dhbahrain.bh/cgc4oQeifb",
        "cardChargeDescription": null,
        "isCardCharged": null,
        "shipmentLabelUrl": "https://app.dhbahrain.bh/admin/order/shipment-label/4e5d074fde4affcc876937fbbde34bd2",
        "codAmount": 0,
        "service": {
            "id": "c7tLEt1KOkkgcG-6Exadx",
            "title": "Box",
            "icon": "https://app.dhbahrain.bh/static/services/qiaINAKxULnu8Z6m7sWrd0i4.png",
            "setting": {
                "enableReceiverCash": true,
                "isCashBySenderActive": true,
                "enableCustomerPhoto": false,
                "isCODActive": true,
                "enablePod": true,
                "enableDriverPhoto": false,
                "isAddressDetailsActive": true
            },
            "options": [
                {
                    "id": "XYezIwmkhXXyKKOwVqMbL",
                    "title": "Box weight",
                    "type": "list",
                    "dataId": "QQNWe9WRid2y0mOA0bmt_",
                    "dataTitle": "50 kilograms",
                    "inputValue": null,
                    "inputType": null,
                    "isRequired": false
                },
                {
                    "id": "JlI_Ez5wyNuXMHq4FCm_m",
                    "title": "Exact weight",
                    "type": "input",
                    "dataId": null,
                    "dataTitle": "",
                    "inputValue": "20 lbs",
                    "inputType": "text",
                    "isRequired": false
                },
                {
                    "id": "ElGWocOJaKXTcjW782jbr",
                    "title": "Important document",
                    "type": "boolean",
                    "dataId": null,
                    "dataTitle": "",
                    "inputValue": null,
                    "inputType": null,
                    "isRequired": null
                }
            ],
            "scheduleSetting": {
                "isActive": true,
                "isPickupNowActive": false,
                "scheduleDateRangeAfter": 600000,
                "scheduleDateRangeBefore": 1200000000,
                "scheduleDateStep": 600000,
                "hasDropoffScheduling": true,
                "guidelines": "1. select your Pickup time 2. Select your Dropoff time 3. Place your order."
            }
        },
        "createdAt": 1717870565503,
        "estimatedDistanceInMeters": 2405,
        "estimatedDuration": 510,
        "note": "note",
        "referenceId": "ref#112",
        "stage": "Pickup",
        "statusUpdatedAt": 1717871473420,
        "pickup": {
            "address": "Cumberland Gate, London W2 2UH, UK",
            "addressDetail": "",
            "coordinates": [
                -0.15869881563038823,
                51.51268479847148
            ],
            "placeId": "",
            "fullName": "samuel",
            "phone": "00611522",
            "email": "abcd@pickup.org",
            "podPhoto": "",
            "podSignature": "",
            "podNote": "",
            "completeAfter": 1717869467474,
            "completeBefore": 1717869467474,
            "buildingBlock": "",
            "floor": "",
            "room": "",
            "scheduleDateAfter": 1717869467474,
            "scheduleDateBefore": 1717869467474,
            "customerDescription": "note",
            "driverDescription": ""
        },
        "dropoff": {
            "address": "Cumberland Gate, London W2 2UH, UK",
            "coordinates": [
                -0.15869881563038823,
                51.51268479847148
            ],
            "placeId": "",
            "fullName": "samuel",
            "phone": "00611522",
            "email": "abcd@pickup.org",
            "podPhoto": "",
            "podSignature": "",
            "buildingBlock": "",
            "floor": "",
            "room": "",
            "scheduleDateAfter": 1717869467474,
            "scheduleDateBefore": 1717869467474,
            "customerDescription": "note"
…
401JWTAuthenticationError
{
    "code": -9,
    "message": "JWTAuthenticationError,invalid signature",
    "data": [],
    "meta": {
        "stack": "JWTAuthenticationError: JWTAuthenticationError,invalid signature\n    at ExpressCustomerAuthMiddleware.authenticate (/usr/src/app/rest/dist/core/express/middlewares/auth.js:154:22)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
        "url": "/api/v1/customer/order/pickup-delivery/draft",
        "method": "POST"
    }
}

Cancellation Reasons List

GEThttps://api.dhbahrain.bh/api/v1/customer/order/pickup-delivery/cancellation-reasonBearer token

Example responses

200Successful
{
    "code": 0,
    "message": "",
    "data": [
        {
            "id": "zspu186nKY8j27omUam5V",
            "text": "It's taking too long",
            "type": "Cancellation"
        },
        {
            "id": "FhbZzcUwXAD9g5sH_HVS-",
            "text": "I want to change my order details",
            "type": "Cancellation"
        },
        {
            "id": "2E1xQ9AihIZ2ARPI7IhGv",
            "text": "I found a driver myself",
            "type": "Cancellation"
        }
    ],
    "metadata": []
}
401JWTAuthenticationError
{
    "code": -9,
    "message": "JWTAuthenticationError,invalid signature",
    "data": [],
    "meta": {
        "stack": "JWTAuthenticationError: JWTAuthenticationError,invalid signature\n    at ExpressCustomerAuthMiddleware.authenticate (/usr/src/app/rest/dist/core/express/middlewares/auth.js:154:22)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
        "url": "/api/v1/customer/order/pickup-delivery/cancellation-reason",
        "method": "GET"
    }
}

Cancel Order

POSThttps://api.dhbahrain.bh/api/v1/customer/order/pickup-delivery/cancelBearer token

Request body

{
    "orderId": "e7LMNBN_kA4H_GkHlxlUe",
    "customerId": "YOUR_CUSTOMER_ID",
    "failureReasonId": "FhbZzcUwXAD9g5sH_HVS-",
    "failureReasonText": "I want to change my order details"
}

Example responses

200Successful
{
    "code": 0,
    "message": "",
    "data": {
        "id": "e7LMNBN_kA4H_GkHlxlUe",
        "status": "CustomerCanceled",
        "type": "PickupDelivery",
        "statusMessage": "Order canceled",
        "price": 0,
        "code": "#ZNV5X033H",
        "statusDescription": "CustomerCanceled",
        "paymentMethod": "Cash",
        "paymentSide": "Sender",
        "currencyCode": "GBP",
        "promoCode": "",
        "promoAmount": 0,
        "promoPercentage": 0,
        "trackOrder": "https://track.dhbahrain.bh/cgc4oQeifb",
        "trackOrderMessage": "",
        "paymentProvider": null,
        "paymentMethodId": null,
        "cardInfo": null,
        "customerRate": null,
        "customerRateText": null,
        "hasFeedbackPageSeen": null,
        "customerReceiptUrl": "https://app.dhbahrain.bh/admin/order/customer/receipt/4e5d074fde4affcc876937fbbde34bd2",
        "pickupOrderTrackUrl": "https://track.dhbahrain.bh/cgc4oQeifb",
        "deliveryOrderTrackUrl": "https://track.dhbahrain.bh/cgc4oQeifb",
        "cardChargeDescription": null,
        "isCardCharged": null,
        "shipmentLabelUrl": "https://app.dhbahrain.bh/admin/order/shipment-label/4e5d074fde4affcc876937fbbde34bd2",
        "codAmount": 0,
        "service": {
            "id": "c7tLEt1KOkkgcG-6Exadx",
            "title": "Box",
            "icon": "https://app.dhbahrain.bh/static/services/qiaINAKxULnu8Z6m7sWrd0i4.png",
            "setting": {
                "enableReceiverCash": true,
                "isCashBySenderActive": true,
                "enableCustomerPhoto": false,
                "isCODActive": true,
                "enablePod": true,
                "enableDriverPhoto": false,
                "isAddressDetailsActive": true
            },
            "options": [
                {
                    "id": "XYezIwmkhXXyKKOwVqMbL",
                    "title": "Box weight",
                    "type": "list",
                    "dataId": "QQNWe9WRid2y0mOA0bmt_",
                    "dataTitle": "50 kilograms",
                    "inputValue": null,
                    "inputType": null,
                    "isRequired": false
                },
                {
                    "id": "JlI_Ez5wyNuXMHq4FCm_m",
                    "title": "Exact weight",
                    "type": "input",
                    "dataId": null,
                    "dataTitle": "",
                    "inputValue": "20 lbs",
                    "inputType": "text",
                    "isRequired": false
                },
                {
                    "id": "ElGWocOJaKXTcjW782jbr",
                    "title": "Important document",
                    "type": "boolean",
                    "dataId": null,
                    "dataTitle": "",
                    "inputValue": null,
                    "inputType": null,
                    "isRequired": null
                }
            ],
            "scheduleSetting": {
                "isActive": true,
                "isPickupNowActive": false,
                "scheduleDateRangeAfter": 600000,
                "scheduleDateRangeBefore": 1200000000,
                "scheduleDateStep": 600000,
                "hasDropoffScheduling": true,
                "guidelines": "1. select your Pickup time 2. Select your Dropoff time 3. Place your order."
            }
        },
        "createdAt": 1717870565503,
        "estimatedDistanceInMeters": 2405,
        "estimatedDuration": 510,
        "note": "note",
        "referenceId": "ref#112",
        "stage": "Pickup",
        "statusUpdatedAt": 1717871605261,
        "pickup": {
            "address": "Cumberland Gate, London W2 2UH, UK",
            "addressDetail": "",
            "coordinates": [
                -0.15869881563038823,
                51.51268479847148
            ],
            "placeId": "",
            "fullName": "samuel",
            "phone": "00611522",
            "email": "abcd@pickup.org",
            "podPhoto": "",
            "podSignature": "",
            "podNote": "",
            "completeAfter": 1717869467474,
            "completeBefore": 1717869467474,
            "buildingBlock": "",
            "floor": "",
            "room": "",
            "scheduleDateAfter": 1717869467474,
            "scheduleDateBefore": 1717869467474,
            "customerDescription": "note",
            "driverDescription": ""
        },
        "dropoff": {
            "address": "Cumberland Gate, London W2 2UH, UK",
            "coordinates": [
                -0.15869881563038823,
                51.51268479847148
            ],
            "placeId": "",
            "fullName": "samuel",
            "phone": "00611522",
            "email": "abcd@pickup.org",
            "podPhoto": "",
            "podSignature": "",
            "buildingBlock": "",
            "floor": "",
            "room": "",
            "scheduleDateAfter": 1717869467474,
            "scheduleDateBefore": 1717869467474,
     
…
400BadRequest: Order not found
{
    "code": -400,
    "message": "Order not found",
    "data": [],
    "meta": {
        "stack": "BadRequest: Order not found\n    at PickupDeliveryUpdateStatusService.updateToCustomerCanceled (/usr/src/app/rest/dist/components/order/update-status/customer/services/pickup-delivery.js:190:23)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async ExpressCustomerOrderController.cancelPickupDeliveryOrder (/usr/src/app/rest/dist/controllers/express/customer/order.js:592:31)",
        "url": "/api/v1/customer/order/pickup-delivery/cancel",
        "method": "POST"
    }
}

On-Demand Orders

Create Order

POSThttps://api.dhbahrain.bh/api/v1/customer/order/ondemandBearer token
Field Description
customerId Unique identifier for the customer.
pickup Pickup location object. Object
pickup.address Pickup address.
pickup.customerDescription - Optional Additional notes about the pickup address.
pickup.schedulePickupNow Indicates if the order is scheduled. true false. If it's not scheduled, the two fields below should be set to 0.
pickup.scheduleDateAfter The earliest time for the pickup to be completed. Set 0 If it's not scheduled. timestamp in ms
pickup.scheduleDateBefore The latest time for the pickup to be completed. Set 0 If it's not scheduled. timestamp in ms
pickup.coordinates Latitude and longitude of the pickup location. [long, lat]
Note: It's not [lat, long], it's the other way around.
pickup.fullName - Optional Additional details about the pickup address (e.g., apartment number, building name).
pickup.phone - Optional Contact phone number for the pickup location.
pickup.email - Optional Contact email for the pickup location.
pickup.placeId - Optional Place ID from a map service for the pickup location. You should set "" for this field.
pickup.floor - Optional Floor number of the address.
pickup.buildingBlock - Optional Block of the address.
pickup.room - Optional Room of the address.
dropoffs An array of drop-off location objects.
dropoffs[].address Delivery address.
dropoffs[].customerDescription - Optional It's the same as pickup.
dropoffs[].scheduleDateAfter It's the same as pickup.
dropoffs[].scheduleDateBefore It's the same as pickup.
dropoffs[].coordinates It's the same as pickup.
dropoffs[].fullName - Optional It's the same as pickup.
dropoffs[].phone - Optional It's the same as pickup.
dropoffs[].email - Optional It's the same as pickup.
dropoffs[].placeId - Optional It's the same as pickup.
dropoffs[].floor - Optional It's the same as pickup.
dropoffs[].buildingBlock - Optional It's the same as pickup.
dropoffs[].room - Optional It's the same as pickup.
service Details about the service being requested.
service.id Unique identifier for the service.
service.options List of service type options. If there is no option selected, [] should be set. Array Of Objects
service.options.id Unique identifier for the service option.
service.options.dataId Data ID for list or boolean service type options.
service.options.inputValue Input value for input service type options.
vehicleType Details about the vehicle type being requested.
vehicleType.id Unique identifier for the vehicle type.
vehicleType.options List of vehicle type options. If there is no option selected, [] should be set. Array Of Objects
vehicleType.options.id Unique identifier for the vehicle type option.
vehicleType.options.dataId Data ID for list or boolean vehicle type options.
vehicleType.options.inputValue Input value for input vehicle type options.
paymentMethod Method of payment. Cash Wallet
paymentSide Indicates who will make the payment. Sender Receiver
promoCode - Optional The promotion code. "" If there is no note.
codAmount - Optional Cash on delivery amount. If there is no COD, 0 should be set.
uid - Optional Client unique identifier for preventing duplications. If there is no mechanism, set "" for this field.
note - Optional Additional notes or instructions. "" If there is no note.
referenceId - Optional Reference identifier for the order.

Request body

{
    "customerId": "YOUR_CUSTOMER_ID",
    "pickup": {
        "phone": "",
        "floor": "",
        "address": "Cumberland Gate, London W2 2UH, UK",
        "room": "",
        "placeId": "",
        "fullName": "",
        "buildingBlock": "",
        "coordinates": [
            -0.15869881563038823,
            51.51268479847148
        ],
        "customerDescription": "",
        "schedulePickupNow": false,
        "scheduleDateAfter": 0,
        "scheduleDateBefore": 0,
        "email": "abcd@pickup.org"
    },
    "dropoffs": [
        {
            "address": "62 Albemarle St, London W1S 4BD, UK",
            "coordinates": [
                -0.1405885408344662,
                51.50785039521855
            ],
            "scheduleDateAfter": 0,
            "scheduleDateBefore": 0,
            "buildingBlock": "",
            "floor": "",
            "fullName": "",
            "phone": "",
            "placeId": "",
            "room": "",
            "email": ""
        },
        {
            "address": "6 Braydon Road, London, N16 6QB",
            "coordinates": [
                -0.06638,
                51.57045
            ],
            "scheduleDateAfter": 0,
            "scheduleDateBefore": 0,
            "buildingBlock": "",
            "floor": "",
            "fullName": "",
            "phone": "",
            "placeId": "",
            "room": "",
            "email": ""
        },
        {
            "address": "41 Braydon Road, London, N16 6QL",
            "coordinates": [
                -0.06798,
                51.57045
            ],
            "scheduleDateAfter": 0,
            "scheduleDateBefore": 0,
            "buildingBlock": "",
            "floor": "",
            "fullName": "",
            "phone": "",
            "placeId": "",
            "room": "",
            "email": ""
        }
    ],
    "service": {
        "id": "clk2wo8rp2fqa01plgm5wbias",
        "options": [
            {
                // list options
                "id": "sjTL9A0oZdAdd0hx9o2tM",
                "dataId": "X3wgDPIvSh4plo4CzRe9k"
            },
            {
                // boolean options
                "id": "bIDb-MELA5NLy1eiNXxI9",
                "dataId": ""
            }
        ]
    },
    "vehicleType": {
        "id": "clakjkbhf1cuybgo84fvc02qq",
        "options": [
            { // list option
                "id": "ldgRhnIA2q4YHm0LvcDmn",
                "dataId": "ns4rTg2KQxQIhbHHl4PkG"
            },
            { // boolean option
                "id": "W93vIRbS7WrPFMrMEOS4i",
                "dataId": ""
            }
        ]
    },
    "paymentMethod": "Wallet", // Cash,Wallet,Card
    "paymentSide": "Sender", // Sender,Receiver
    "isScheduled": false,
    "codAmount": 0,
    "promoCode": "",
    "uid": "d22446bc-b5e5-416b-a182-e29da8a16993",
    "referenceId": "1166212345"
}

Example responses

200Successful
{
    "code": 0,
    "message": "",
    "data": {
        "orderId": "eUZT2ajVwV_uGYCSFDSZo"
    },
    "metadata": []
}
200Successful - Card payment method
{
    "code": 0,
    "message": "",
    "data": {
        "orderId": "eUZT2ajVwV_uGYCSFDSZo"
    },
    "metadata": []
}

Order Info

GEThttps://api.dhbahrain.bh/api/v1/customer/order/e7LMNBN_kA4H_GkHlxlUeBearer token

Possible Statuses : ['Pending', 'Assigned', 'Started', 'PickedUp', 'Arrived' ]

Query parameters

customerId

Example responses

200Successful
{
    "code": 0,
    "message": "",
    "data": {
        "id": "9398Gk3BuhDvcqdBQZmNe",
        "status": "Assigned",
        "type": "Ondemand",
        "statusMessage": "Dear customer, A driver has been assigned to your order",
        "pickup": {
            "address": "Baker Street, Baker St, London, UK",
            "buildingBlock": "2",
            "coordinates": [
                -0.1568041,
                51.5205631
            ],
            "description": "",
            "floor": "3",
            "fullName": "Hana Gilbert",
            "phone": "+989045001342",
            "placeId": "",
            "room": "5",
            "podPhoto": "",
            "podSignature": "",
            "scheduleDateAfter": 0,
            "scheduleDateBefore": 0,
            "schedulePickupNow": false,
            "customerDescription": "",
            "driverDescription": "",
            "email": "",
            "popNote": "",
            "popPhoto": "",
            "popSignature": "",
            "proofs": [],
            "servicePoint": null,
            "locationType": "address"
        },
        "dropoffs": [
            {
                "id": "Fg6XvTx600UsVOP3dlPU1",
                "placeId": "",
                "address": "London, Greater London, England",
                "coordinates": [
                    -0.127698693,
                    51.50740836
                ],
                "status": "Pending",
                "buildingBlock": "",
                "room": "",
                "customerDescription": "",
                "driverDescription": "",
                "floor": "",
                "fullName": "",
                "podPhoto": "",
                "podSignature": "",
                "deliveryDate": 0,
                "scheduleDateAfter": 0,
                "scheduleDateBefore": 0,
                "email": "",
                "phone": "",
                "proofs": [],
                "podNote": "",
                "servicePoint": null,
                "locationType": "address"
            }
        ],
        "price": 70,
        "code": "7228775",
        "vehicleType": {
            "id": "ckff5wvpp00d8vzo8a60y0ey4",
            "title": "Car",
            "icon": "https://app.dhbahrain.bh/static/vehicletypes/5AOU2IHmlVmhyQ6Tnu8N9ccr.png",
            "options": []
        },
        "statusDescription": "Assigned",
        "paymentMethod": "Wallet",
        "paymentSide": "Sender",
        "currencyCode": "BHD",
        "promoCode": "",
        "promoAmount": 0,
        "promoPercentage": 0,
        "trackOrder": "https://track.dhbahrain.bh/hkRMCTQSHC",
        "trackOrderMessage": "On the Way",
        "customerReceipt": [
            {
                "id": "",
                "data": null,
                "price": 20,
                "value": "BHD 20.0",
                "title": "Base fare",
                "type": "keyValue",
                "style": "regular"
            },
            {
                "id": "enfRIfnFy_OPG13lN3CQG",
                "data": {
                    "id": "enfRIfnFy_OPG13lN3CQG",
                    "title": "surcharge",
                    "price": 50,
                    "description": "",
                    "maxPrice": 0,
                    "photo": "",
                    "type": "Fixed",
                    "isCompanyIncome": true,
                    "isDriverIncome": true,
                    "surchargeId": "GjFdtDxCdDLmHZYpbqKCP",
                    "coefficient": 0
                },
                "price": 50,
                "value": "BHD 50.0",
                "title": "surcharge",
                "type": "surcharge",
                "style": "regular"
            },
            {
                "id": "",
                "data": null,
                "price": 70,
                "value": "BHD 70.0",
                "title": "Total",
                "type": "total",
                "style": "bold"
            }
        ],
        "paymentProvider": null,
        "paymentMethodId": null,
        "cardInfo": null,
        "createdAt": 1754169435579,
        "customerPhoto": null,
        "isScheduled": false,
        "customerRate": null,
        "customerRateText": null,
        "hasFeedbackPageSeen": null,
        "customerReceiptUrl": "https://app.dhbahrain.bh/admin/order/customer/receipt/1cf19255a107b8ed415ce7eab98dbd73",
        "cardChargeDescription": null,
        "isCardCharged": null,
        "shipmentLabelUrl": "https://app.dhbahrain.bh/admin/order/shipment-label/1cf19255a107b8ed415ce7eab98dbd73",
        "codAmount": 0,
        "realETA": 0,
        "delayAt": 0,
        "isDelayed": false,
        "isPossibleForDelay": false,
        "driverId": "06P7TwOmiEON4uBR5zG9C",
        "driver": {
            "name": "Mike Pearson",
            "phone": "00989045001342",
            "rate": 0,
            "avatarPhoto": "https://app.dhbahrain.bh/static/drivers/VpNJQoh7g8ANmZPcspIbbqCR.png",
            "vehicle": {
                "pl
…
400BadRequest: Order not found
{
    "code": -400,
    "message": "Order not found",
    "data": [],
    "meta": {
        "stack": "",
        "url": "/api/v1/customer/order/9398Gk3BuhDvcqdBQZmNe?customerId=drlIflxgpU0sE_VxSCdN",
        "method": "GET"
    }
}

Calculate Cost

POSThttps://api.dhbahrain.bh/api/v1/customer/order/ondemand/calculate-priceBearer token

Request body

{
    "customerId": "YOUR_CUSTOMER_ID",
    "isScheduled": false,
    "promoCode": "",
    "vehicleType": {
        "id": "clakjkbhf1cuybgo84fvc02qq",
        "options": [
            {   // list option
                "id": "ldgRhnIA2q4YHm0LvcDmn",
                "dataId": "ns4rTg2KQxQIhbHHl4PkG"
            },
            {   // boolean option
                "id": "W93vIRbS7WrPFMrMEOS4i",
                "dataId": ""
            }
        ]
    },
    "pickup": {
        "coordinates": [
            25.26264924235966,
            54.674691632825535
        ],
        "schedulePickupNow": true,
        "scheduleDateAfter": 0,
        "scheduleDateBefore": 0
    },
    "dropoffs": [
        {
            "coordinates": [
                25.292457744068315,
                54.6898110162224
            ],
            "scheduleDateAfter": 0,
            "scheduleDateBefore": 0
        }
    ],
    "service": {
        "id": "clk2wo8rp2fqa01plgm5wbias",
        "options": [
            {
                // list options
                "id": "sjTL9A0oZdAdd0hx9o2tM",
                "dataId": "X3wgDPIvSh4plo4CzRe9k"
            },
            {
                // boolean options
                "id": "bIDb-MELA5NLy1eiNXxI9",
                "dataId": ""
            }
        ]
    }
}

Example responses

200Successful
{
    "code": 0,
    "message": "",
    "data": {
        "price": 1160,
        "currencyCode": "USD",
        "promoAmount": 0,
        "promoPercentage": 0
    },
    "metadata": []
}
400Service unavailable
{
    "code": -400,
    "message": "Service unavailable",
    "data": [],
    "meta": {
        "stack": "",
        "url": "/api/v1/customer/order/ondemand/calculate-price",
        "method": "POST"
    }
}

Cancel Order

POSThttps://api.dhbahrain.bh/api/v1/customer/order/ondemand/cancelBearer token

Request body

{
    "customerId": "YOUR_CUSTOMER_ID",
    "orderId": "oFUYJkCrn4_2VcPttYY43"
}

Example responses

200Successful
{
    "code": 0,
    "message": "",
    "data": {
        "id": "_WLoaE0qJ65CXl4qBSGVZ",
        "status": "CustomerCanceled",
        "type": "Ondemand",
        "statusMessage": "Order canceled",
        "pickup": {
            "address": "Cumberland Gate, London W2 2UH, UK",
            "buildingBlock": "",
            "coordinates": [
                -0.15869881563038823,
                51.51268479847148
            ],
            "description": "",
            "floor": "",
            "fullName": "",
            "phone": "",
            "placeId": "",
            "room": "",
            "podPhoto": "",
            "podSignature": "",
            "scheduleDateAfter": 0,
            "scheduleDateBefore": 0,
            "schedulePickupNow": false,
            "customerDescription": "",
            "driverDescription": "",
            "email": "abcd@pickup.org",
            "popNote": "",
            "popPhoto": "",
            "popSignature": "",
            "proofs": [],
            "servicePoint": null,
            "locationType": "address"
        },
        "dropoffs": [
            {
                "id": "oKXSCRzy8tC5lbU6zwApC",
                "placeId": "",
                "address": "62 Albemarle St, London W1S 4BD, UK",
                "coordinates": [
                    -0.1405885408344662,
                    51.50785039521855
                ],
                "status": "Pending",
                "buildingBlock": "",
                "room": "",
                "customerDescription": "",
                "driverDescription": "",
                "floor": "",
                "fullName": "",
                "podPhoto": "",
                "podSignature": "",
                "deliveryDate": 0,
                "scheduleDateAfter": 0,
                "scheduleDateBefore": 0,
                "email": "",
                "phone": "",
                "proofs": [],
                "podNote": "",
                "servicePoint": null,
                "locationType": "address"
            },
            {
                "id": "92nWlbjKd50LQoJEeQlH2",
                "placeId": "",
                "address": "6 Braydon Road, London, N16 6QB",
                "coordinates": [
                    -0.06638,
                    51.57045
                ],
                "status": "Pending",
                "buildingBlock": "",
                "room": "",
                "customerDescription": "",
                "driverDescription": "",
                "floor": "",
                "fullName": "",
                "podPhoto": "",
                "podSignature": "",
                "deliveryDate": 0,
                "scheduleDateAfter": 0,
                "scheduleDateBefore": 0,
                "email": "",
                "phone": "",
                "proofs": [],
                "podNote": "",
                "servicePoint": null,
                "locationType": "address"
            },
            {
                "id": "5c56G2WcuW-GrXkv07-J0",
                "placeId": "",
                "address": "41 Braydon Road, London, N16 6QL",
                "coordinates": [
                    -0.06798,
                    51.57045
                ],
                "status": "Pending",
                "buildingBlock": "",
                "room": "",
                "customerDescription": "",
                "driverDescription": "",
                "floor": "",
                "fullName": "",
                "podPhoto": "",
                "podSignature": "",
                "deliveryDate": 0,
                "scheduleDateAfter": 0,
                "scheduleDateBefore": 0,
                "email": "",
                "phone": "",
                "proofs": [],
                "podNote": "",
                "servicePoint": null,
                "locationType": "address"
            }
        ],
        "price": 1160,
        "code": "1098662",
        "vehicleType": {
            "id": "clakjkbhf1cuybgo84fvc02qq",
            "title": "Bike",
            "icon": "https://app.dhbahrain.bh/static/vehicletypes/p1Grezta5mTf9DwOmiveYx-P.png",
            "options": [
                {
                    "id": "ldgRhnIA2q4YHm0LvcDmn",
                    "title": "Available Equipment",
                    "type": "list",
                    "dataId": "ns4rTg2KQxQIhbHHl4PkG",
                    "dataTitle": "Waterproof Cover"
                },
                {
                    "id": "W93vIRbS7WrPFMrMEOS4i",
                    "title": "Need helper",
                    "type": "boolean",
                    "dataId": null,
                    "dataTitle": null
                }
            ]
        },
        "statusDescription": "Canceled by customer",
        "paymentMethod": "Wallet",
        "paymentSide": "Sender",
        "currencyCode": "USD",
        "promoCode": "",
        "promoAmount": 0,
        "promoPercentage": 0,
        "trackOrder": "https://track.dhbahrain.bh/LEbmE9dvQX",
        "trackOrder
…
400BadRequest: Order not found
{
    "code": -400,
    "message": "Order not found",
    "data": [],
    "meta": {
        "stack": "",
        "url": "/api/v1/customer/order/ondemand/cancel",
        "method": "POST"
    }
}

Webhooks

DHB can call your server whenever an order changes. Send us the HTTPS address that should receive these calls.

Every call carries an x-webhook-signature header so you can check it really came from DHB: compute an HMAC-SHA256 of the raw request body with your webhook secret and compare it with the header.

const body = JSON.stringify(req.body);
const expected = require('crypto').createHmac('sha256', process.env.DHB_WEBHOOK_SECRET).update(body).digest('hex');
if (req.get('x-webhook-signature') === expected) { /* trusted */ }

Your webhook secret is provided by DHB. Ask your account manager or DHB support for it.

P&D Payload

POSThttps://yourdomain.com/webhook

Request body

{
    "timestamp": 1758028850388,
    "data": {
        "trigger": "Updated",
        "id": "Dl_EwmIiINm3Gf_6be_7E",
        "status": "NotDelivered",
        "type": "PickupDelivery",
        "statusDescription": {
            "en": "Not Delivered",
            "fa": "Not Delivered",
            "de": "Not Delivered",
            "ckb": "Not Delivered",
            "fr": "Not Delivered",
            "ms": "Not Delivered",
            "ar": "Not Delivered",
            "zh": "Not Delivered",
            "ro": "Not Delivered",
            "nl": "Not Delivered",
            "fi": "Not Delivered",
            "es": "Not Delivered",
            "it": "Not Delivered",
            "az": "Not Delivered",
            "ru": "Not Delivered",
            "tr": "Not Delivered",
            "pt": "Not Delivered",
            "el": "Not Delivered",
            "de-AT": "Not Delivered",
            "ku": "Not Delivered",
            "he": "Not Delivered",
            "hi": "Not Delivered",
            "cs": "Not Delivered"
        },
        "customerId": "YOUR_CUSTOMER_ID",
        "customer": {
            "id": "cus_123456789",
            "name": "Test Business",
            "email": "customer@example.com",
            "phone": "+10000000000",
            "balance": 2730000,
            "blockedBalance": 0,
            "type": "business",
            "language": "en",
            "avatarPhoto": "",
            "address": "123 Example Street, Demo City"
        },
        "customerType": "business",
        "createdAt": 1757330178385,
        "driverId": "drv_987654321",
        "code": "5184194",
        "price": 5000,
        "surchargesPrice": 0,
        "baseFarePrice": 5000,
        "paymentMethod": "Cash",
        "paymentSide": "Receiver",
        "currencyCode": "USD",
        "promoId": null,
        "promoAmount": 0,
        "promoCode": "",
        "promoPercentage": 0,
        "trackOrder": "https://example.com/track/ABCDE12345",
        "trackOrderMessage": {
            "ku": "",
            "en": "",
            "ar": ""
        },
        "dispatcherId": null,
        "customerReceiptUrl": "https://example.com/receipt/12345",
        "trackOrderCode": "ABCDE12345",
        "statusUpdatedAt": 1758028850333,
        "isShowingCurrencyActive": true,
        "zone": {
            "id": "zone_001",
            "name": {
                "ku": "Demo Zone",
                "en": "Demo Zone",
                "ar": "Demo Zone"
            },
            "timeZone": "UTC"
        },
        "shipmentLabelUrl": "https://example.com/shipment-label/12345",
        "codAmount": 32500,
        "estimatedDistance": 19.898,
        "estimatedDistanceInMeters": 19898,
        "estimatedDuration": 1448,
        "dispatcher": null,
        "driver": {
            "username": "driver_user",
            "name": "John Doe",
            "phone": "+10000000001",
            "email": "driver@example.com",
            "vehicle": {
                "id": "veh_001",
                "color": "blue",
                "model": "Toyota Corolla",
                "plate": "AB 123 CD"
            },
            "vehicleId": "veh_001",
            "language": "en",
            "avatarPhoto": "https://example.com/assets/driver.png",
            "location": [
                -73.935242,
                40.73061
            ]
        },
        "service": {
            "id": "svc_001",
            "title": {
                "ku": "Demo Delivery Service",
                "en": "Demo Delivery Service",
                "ar": "Demo Delivery Service"
            },
            "description": {
                "ku": "Demo Delivery Service",
                "en": "Demo Delivery Service",
                "ar": "Demo Delivery Service"
            },
            "icon": "https://example.com/assets/service.png"
        },
        "referenceId": "REF_0002/12345",
        "dueDate": 1757330178385,
        "customerRate": null,
        "customerRateText": null,
        "baseETA": 1749107431000,
        "realETA": 1758025086000,
        "pickup": {
            "status": "Confirmed",
            "statusDescription": {
                "en": "Confirmed",
                "fa": "Confirmed",
                "de": "Confirmed",
                "ckb": "Confirmed",
                "fr": "Confirmed",
                "ms": "Confirmed",
                "ar": "Confirmed",
                "zh": "Confirmed",
                "ro": "Confirmed",
                "nl": "Confirmed",
                "fi": "Confirmed",
                "es": "Confirmed",
                "it": "Confirmed",
                "az": "Confirmed",
                "ru": "Confirmed",
                "tr": "Confirmed",
                "pt": "Confirmed",
                "el": "Confirmed",
                "de-AT": "Confirmed",
                "ku": "Confirmed",
                "he": "Confirmed",
                "hi": "Confirmed",
                "cs": "Confirmed"
            },
            "placeId": "place_001",

…

On-Demand Payload

POSThttps://yourdomain.com/webhook

Request body

{
    "timestamp": 1636778693521,
    "data": {
        "trigger": "Updated",
        "id": "ckvxbi7flm51dk6o80ckiaxg1",
        "status": "Unassigned",
        "statusDescription": "Fahrer nicht gefunden",
        "customerId": "YOUR_CUSTOMER_ID",
        "customer": {
            "id": "DZwlBG1d4rvfuU_kn5X72d",
            "name": "ali",
            "email": "example@gmail.com",
            "phone": "419747239847",
            "balance": 0,
            "blockedBalance": 0,
            "type": "individual",
            "language": "en",
            "avatarPhoto": "string",
            "address": "string"
        },
        "customerType": "individual",
        "driverId": "ZrlBG1T4rvfuU_kn5X7Nw",
        "driver": {
            "username": "string",
            "name": "string",
            "phone": "string",
            "email": "string",
            "vehicle": {
                "id": "string",
                "model": "string",
                "plate": "string",
                "color": "string"
            },
            "vehicleId": "string",
            "language": "en",
            "avatarPhoto": "http://panel.example.io/public/saas/example/drivers/image-e2aede48f9e4e9358fc515084fdeb311.png,"
        },
        "createdAt": 1605952999566,
        "service": {
            "id": "string",
            "tittle": {
                "en": "string",
                "fr": "string"
            },
            "description": {
                "en": "string",
                "fr": "string"
            },
            "icon": "string"
        },
        "code": "string",
        "price": 0,
        "surchargesPrice": 0,
        "baseFarePrice": 0,
        "paymentMethod": "Cash",
        "paymentSide": "Sender",
        "currencyCode": "string",
        "promoId": "string",
        "promoAmount": "string",
        "promoCode": "string",
        "promoPercentage": 0,
        "trackOrder": "string",
        "trackOrderMessage": {
            "en": "string",
            "fr": "string"
        },
        "dispatcherId": "string",
        "dispatcher": {
            "name": "string"
        },
        "vehicleTypeId": "string",
        "vehicleType": {
            "tittle": {
                "en": "string",
                "fr": "string"
            },
            "description": {
                "en": "string",
                "fr": "string"
            },
            "icon": "string"
        },
        "customerReceiptUrl": "string",
        "trackOrderCode": "string",
        "statusUpdatedAt": 1605952999566,
        "isShowingCurrencyActive": true,
        "driverAssignmentModel": "automatic",
        "customerPhoto": "string",
        "driverPhoto": "string",
        "shipmentLabelUrl": "string",
        "codAmount": 0,
        "dispatchAt": 1605952999566,
        "type": "Ondemand",
        "isPickupDelivery": true,
        "dropoffs": [
            {
                "placeId": "string",
                "address": "string",
                "coordinates": [
                    101.6965467,
                    3.1460236
                ],
                "fullName": "string",
                "phone": "string",
                "email": "string",
                "floor": "string",
                "room": "string",
                "buildingBlock": "string",
                "customerDescription": "string",
                "scheduleDateAfter": 1602538142000,
                "scheduleDateBefore": 1602538182000,
                "driverDescription": "string",
                "podPhoto": "string",
                "podSignature": "string",
                "status": "Pending",
                "deliveryDate": 1602538182000
            }
        ],
        "dropoff": {
            "placeId": "string",
            "address": "string",
            "coordinates": [
                101.6965467,
                3.1460236
            ],
            "fullName": "string",
            "phone": "string",
            "email": "string",
            "floor": "string",
            "room": "string",
            "buildingBlock": "string",
            "customerDescription": "string",
            "scheduleDateAfter": 1602538142000,
            "scheduleDateBefore": 1602538182000,
            "driverDescription": "string",
            "podPhoto": "string",
            "podSignature": "string",
            "status": "Pending",
            "deliveryDate": 1602538182000
        },
        "pickup": {
            "placeId": "string",
            "address": "string",
            "coordinates": [
                101.6965467,
                3.1460236
            ],
            "fullName": "string",
            "phone": "string",
            "email": "string",
            "customerDescription": "string",
            "floor": "string",
            "room": "string",
            "buildingBlock": "string",
            "scheduleDateAfter": 0,
            "scheduleDateBefore": 0,
            "schedulePickupNow": true
        },
        "zone": {
            "i
…

Building something bigger? Talk to our team. We help with API access, webhook secrets, test orders and going live. Daily, 9:00 AM to 12:00 midnight.

Ready to send your first delivery?

Create an account in minutes. No deposit, no contract.

WhatsApp us