NAV
bash javascript

Info

Welcome to the generated API reference. Get Postman Collection

1. Company @group 2. Order

Class OrderController

Checkout

Example request:

curl -X POST "http://doorhub.dev/api/company/v1/order/checkout" \
    -H "Authorization: Bearer {api-key}" \
    -H "Api-Version: v1"
const url = new URL("http://doorhub.dev/api/company/v1/order/checkout");

let headers = {
    "Authorization": "Bearer {api-key}",
    "Api-Version": "v1",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "POST",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (403):

{
    "success": false,
    "message": "Unauthorized",
    "error": []
}

HTTP Request

POST api/company/v1/order/checkout

api/company/v1/order/checkout/confirm

Example request:

curl -X POST "http://doorhub.dev/api/company/v1/order/checkout/confirm" \
    -H "Authorization: Bearer {api-key}" \
    -H "Api-Version: v1"
const url = new URL("http://doorhub.dev/api/company/v1/order/checkout/confirm");

let headers = {
    "Authorization": "Bearer {api-key}",
    "Api-Version": "v1",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "POST",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (403):

{
    "success": false,
    "message": "Unauthorized",
    "error": []
}

HTTP Request

POST api/company/v1/order/checkout/confirm

api/company/v1/order/cancel/{orderRef}

Example request:

curl -X PATCH "http://doorhub.dev/api/company/v1/order/cancel/{orderRef}" \
    -H "Authorization: Bearer {api-key}" \
    -H "Api-Version: v1"
const url = new URL("http://doorhub.dev/api/company/v1/order/cancel/{orderRef}");

let headers = {
    "Authorization": "Bearer {api-key}",
    "Api-Version": "v1",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "PATCH",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

PATCH api/company/v1/order/cancel/{orderRef}

1. Company

Class StoreController

sub stores

Example request:

curl -X GET -G "http://doorhub.dev/api/company/v1/store/subStores" \
    -H "Authorization: Bearer {api-key}" \
    -H "Api-Version: v1"
const url = new URL("http://doorhub.dev/api/company/v1/store/subStores");

let headers = {
    "Authorization": "Bearer {api-key}",
    "Api-Version": "v1",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (403):

{
    "success": false,
    "message": "Unauthorized",
    "error": []
}

HTTP Request

GET api/company/v1/store/subStores

1. Zone

Checking the pickup and delivery zones, Supported Doorhub areas, etc.

Get Doorhub delivery zones

Gets all the delivery zones supported by Doorhub for different cities

Example request:

curl -X GET -G "http://doorhub.dev/api/platform/v1/zones/area" \
    -H "Authorization: Bearer {api-key}" \
    -H "Api-Version: v1"
const url = new URL("http://doorhub.dev/api/platform/v1/zones/area");

let headers = {
    "Authorization": "Bearer {api-key}",
    "Api-Version": "v1",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "success": true,
    "message": "",
    "data": [
        {
            "zone_city": "Copenhagen",
            "delivery_zone": "55.723304,12.329385,55.748819,12.421395,55.755002,12.452981,55.773544,12.466714,55.771999,12.525765,55.75191,12.540871,55.743408,12.547738,55.744181,12.58207,55.731811,12.599923,55.72021,12.654855,55.600912,12.672707,55.589272,12.649361,55.598584,12.56971,55.633484,12.550484,55.623405,12.506539,55.607894,12.428262,55.611772,12.393929"
        },
        {
            "zone_city": "Roskilde",
            "delivery_zone": "55.657214,12.028107,55.652178,12.020897,55.62408,12.052483,55.617295,12.089218,55.625825,12.115654,55.640941,12.1287,55.660894,12.153763,55.679481,12.12664,55.68103,12.068619,55.674448,12.064842,55.662249,12.083038"
        }
    ]
}

Example response (400):

{
    "success": false,
    "message": "No region is supported or activated to your platform, Please contact Doorhub to activate",
    "error": []
}

HTTP Request

GET api/platform/v1/zones/area

City zone

Get the delivery zone for the specific city

Example request:

curl -X GET -G "http://doorhub.dev/api/platform/v1/zones/area/{city}" \
    -H "Authorization: Bearer {api-key}" \
    -H "Api-Version: v1"
const url = new URL("http://doorhub.dev/api/platform/v1/zones/area/{city}");

    let params = {
            "city": "copenhagen",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {api-key}",
    "Api-Version": "v1",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "success": true,
    "message": "",
    "data": {
        "zone_city": "copenhagen",
        "delivery_zone": "55.723304,12.329385,55.748819,12.421395,55.755002,12.452981,55.773544,12.466714,55.771999,12.525765,55.75191,12.540871,55.743408,12.547738,55.744181,12.58207,55.731811,12.599923,55.72021,12.654855,55.600912,12.672707,55.589272,12.649361,55.598584,12.56971,55.633484,12.550484,55.623405,12.506539,55.607894,12.428262,55.611772,12.393929"
    }
}

Example response (400):

{
    "success": false,
    "message": "Provided city is not supported for your platform",
    "error": {
        "city": [
            "Provided city is not supported for your platform by Doorhub"
        ],
        "suggestions": [
            {
                "message": "Please make sure the provided city\/region name is correct"
            }
        ]
    }
}

HTTP Request

GET api/platform/v1/zones/area/{city}

Query Parameters

Parameter Status Description
city required Name of the city like copenhagen.

Zone checking

Check if the addresses are supported by Doorhub delivery zone

Example request:

curl -X POST "http://doorhub.dev/api/platform/v1/zones/support" \
    -H "Authorization: Bearer {api-key}" \
    -H "Api-Version: v1" \
    -H "Content-Type: application/json" \
    -d '{"pickupAddress":"Tofteg\u00e5rds All\u00e9 49, 2500 K\u00f8benhavn","dropOffAddress":"Heimdalsgade 44, 2200 K\u00f8benhavn","regionName":"copenhagen"}'
const url = new URL("http://doorhub.dev/api/platform/v1/zones/support");

let headers = {
    "Authorization": "Bearer {api-key}",
    "Api-Version": "v1",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "pickupAddress": "Tofteg\u00e5rds All\u00e9 49, 2500 K\u00f8benhavn",
    "dropOffAddress": "Heimdalsgade 44, 2200 K\u00f8benhavn",
    "regionName": "copenhagen"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "success": true,
    "message": "Addresses are supported by Doorhub",
    "data": []
}

Example response (400):

{
    "success": false,
    "message": "Pickup Address is not supported by Doorhub delivery zone",
    "error": {
        "pickupAddress": [
            "Pickup Address is not supported by Doorhub delivery zone"
        ],
        "suggestions": [
            {
                "message": "Please check if the pickupAddress is right and inside the Doorhub delivery zone"
            }
        ]
    }
}

HTTP Request

POST api/platform/v1/zones/support

Body Parameters

Parameter Type Status Description
pickupAddress string required The google address of the pickup location.
dropOffAddress string required The google address of the delivery location.
regionName string optional which region the addresses belongs to.

2. Order

Processing the orders

Checkout

Checkout the order

Example request:

curl -X POST "http://doorhub.dev/api/platform/v1/orders/checkout" \
    -H "Authorization: Bearer {api-key}" \
    -H "Api-Version: v1" \
    -H "Content-Type: application/json" \
    -d '{"regionName":"copenhagen","deliveryId":"#ORD345987","pickupAddress":"Tofteg\u00e5rds All\u00e9 49, 2500 K\u00f8benhavn","dropOffAddress":"Heimdalsgade 44, 2200 K\u00f8benhavn","sellerName":"John Mayer \/ Barakat grill & pizza restaurant","sellerPhone":98547631,"customerName":"Emma Watson","customerPhone":68547631,"customerFloor":"1st Floor \/ 2nd","productSize":"small","timeForDropOff":"2019-01-01 17:25","timeForPickup":"2019-01-01 17:25","description":"Please call on my mobile when you are here, the outside building calling button does not works!"}'
const url = new URL("http://doorhub.dev/api/platform/v1/orders/checkout");

let headers = {
    "Authorization": "Bearer {api-key}",
    "Api-Version": "v1",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "regionName": "copenhagen",
    "deliveryId": "#ORD345987",
    "pickupAddress": "Tofteg\u00e5rds All\u00e9 49, 2500 K\u00f8benhavn",
    "dropOffAddress": "Heimdalsgade 44, 2200 K\u00f8benhavn",
    "sellerName": "John Mayer \/ Barakat grill & pizza restaurant",
    "sellerPhone": 98547631,
    "customerName": "Emma Watson",
    "customerPhone": 68547631,
    "customerFloor": "1st Floor \/ 2nd",
    "productSize": "small",
    "timeForDropOff": "2019-01-01 17:25",
    "timeForPickup": "2019-01-01 17:25",
    "description": "Please call on my mobile when you are here, the outside building calling button does not works!"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (201):

{
    "success": true,
    "message": "Order processed successfully",
    "data": {
        "id": "ORD79-0005",
        "deliveryId": "3364",
        "serviceName": "Doorhub delivery",
        "timeUnit": "minute",
        "priceUnit": "DKK",
        "estimatedPickupTime": 24,
        "estimatedTimeForPickup": "2019-03-19 16:28",
        "estimatedDeliveryTime": 55,
        "estimatedTimeForDelivery": "2019-03-19 16:58",
        "estimatedDeliveryCharge": 47,
        "order": {
            "id": "ORD79-0005",
            "customerName": "Shamsul Alam",
            "customerPhone": "91766313",
            "customerFloor": "3tv",
            "deliveryId": "3364",
            "sellerName": "Barakat & Grill",
            "pickupAddress": "Amerikavej 19, copenhagen",
            "dropOffAddress": "Heimdalsgade 42, copenhagen",
            "estimatedTimeForPickup": "2019-03-19 16:28",
            "estimatedTimeForDelivery": "2019-03-19 16:58",
            "deliveryCharge": 47,
            "productSize": "Small",
            "orderCreated": "2019-03-19 16:03:32",
            "confirmed": true,
            "description": "This is the order description with åäö"
        }
    }
}

Example response (200):

{
    "success": true,
    "message": "Order is already exists, please check the order status",
    "data": {
        "id": "ORD79-0005",
        "deliveryId": "3364",
        "serviceName": "Doorhub delivery",
        "timeUnit": "minute",
        "priceUnit": "DKK",
        "order": {
            "id": "ORD79-0005",
            "customerName": "Shamsul Alam",
            "customerPhone": "91766313",
            "customerFloor": "3tv",
            "deliveryId": "3364",
            "sellerName": "Barakat & Grill",
            "pickupAddress": "Amerikavej 19, copenhagen",
            "dropOffAddress": "Heimdalsgade 42, copenhagen",
            "estimatedTimeForPickup": "2019-03-19 16:28:00",
            "estimatedTimeForDelivery": "2019-03-19 16:58:00",
            "deliveryCharge": 47,
            "productSize": "small",
            "orderCreated": "2019-03-19 16:03:32",
            "confirmed": true,
            "description": "This is the order description with åäö"
        }
    }
}

Example response (200):

{
    "success": true,
    "message": "Order needs to confirm, please check the order status",
    "data": {
        "id": "ORD79-0005",
        "deliveryId": "3364",
        "serviceName": "Doorhub delivery",
        "timeUnit": "minute",
        "priceUnit": "DKK",
        "order": {
            "id": "ORD79-0005",
            "customerName": "Shamsul Alam",
            "customerPhone": "91766313",
            "customerFloor": "3tv",
            "deliveryId": "3364",
            "sellerName": "Barakat & Grill",
            "pickupAddress": "Amerikavej 19, copenhagen",
            "dropOffAddress": "Heimdalsgade 42, copenhagen",
            "estimatedTimeForPickup": "2019-03-19 16:28:00",
            "estimatedTimeForDelivery": "2019-03-19 16:58:00",
            "deliveryCharge": 47,
            "productSize": "small",
            "orderCreated": "2019-03-19 16:03:32",
            "confirmed": false,
            "description": "This is the order description with åäö"
        }
    }
}

Example response (200):

{
    "success": true,
    "message": "DropOff not possible within required time",
    "data": {
        "id": "ORD79-0006",
        "pickupTime": "2019-03-19 16:53",
        "dropOffTime": "2019-03-19 17:23",
        "deliveryId": "3365",
        "valid_until": "2019-03-19 16:33"
    },
    "suggestion": true
}

Example response (400):

{
    "success": false,
    "message": "Pickup address is not supported by Doorhub delivery zone",
    "error": {
        "pickupAddress": "address is out of the delivery zone, please choose an address that is supported by Doorhub",
        "suggestions": [
            {
                "message": "Please make sure the addresses are inside the Doorhub delivery support zone"
            },
            {
                "message": "Suggestion 2 ..."
            }
        ]
    }
}

Example response (422):

{
    "success": false,
    "message": "The delivery id field is required.",
    "error": {
        "deliveryId": [
            "The delivery id field is required."
        ],
        "regionName": [
            "The region name field is required."
        ]
    }
}

HTTP Request

POST api/platform/v1/orders/checkout

Body Parameters

Parameter Type Status Description
regionName string required The region name of the order. The region name must match with the Doorhub zone name provided by the zone service.
deliveryId string required Delivery order Id in the platform system, it is maybe required for B2C model.
pickupAddress string required The google address of the pickup location.
dropOffAddress string required The google address of the delivery location.
sellerName string required The name of the seller, in the case of B2C model it's the restaurant name.
sellerPhone number required The phone number of the seller, in case of B2C model the field is optional.
customerName string required The Name of the customer.
customerPhone number required The Phone number of the customer.
customerFloor string optional optional The Floor number of the customer.
productSize string required The size of the products, it can be [small,medium,big].
timeForDropOff datetime optional Delivery date-time for scheduled delivery, format YYYY-MM-DD H:i.
timeForPickup datetime optional Delivery date-time for scheduled pickup, format YYYY-MM-DD H:i, it is maybe required for B2C model.
description string optional Any instruction / comments about the order.

Checkout confirm

Confirm (accept/deny) the new suggested timeForPickup

Example request:

curl -X POST "http://doorhub.dev/api/platform/v1/orders/checkout/confirm" \
    -H "Authorization: Bearer {api-key}" \
    -H "Api-Version: v1" \
    -H "Content-Type: application/json" \
    -d '{"orderId":"YYR7098","deliveryId":"paIqzrDfIYj9h6ty"}'
const url = new URL("http://doorhub.dev/api/platform/v1/orders/checkout/confirm");

let headers = {
    "Authorization": "Bearer {api-key}",
    "Api-Version": "v1",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "orderId": "YYR7098",
    "deliveryId": "paIqzrDfIYj9h6ty"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (201):

{
    "success": true,
    "message": "Order confirmed successfully",
    "data": {
        "id": "ORD79-0006",
        "deliveryId": "3365",
        "serviceName": "Doorhub delivery",
        "timeUnit": "minute",
        "priceUnit": "DKK",
        "order": {
            "id": "ORD79-0006",
            "customerName": "Shamsul Alam",
            "customerPhone": "91766313",
            "customerFloor": "3tv",
            "deliveryId": "3365",
            "sellerName": "Barakat & Grill",
            "pickupAddress": "Amerikavej 19, copenhagen",
            "dropOffAddress": "Heimdalsgade 42, copenhagen",
            "estimatedTimeForPickup": "2019-03-19 17:43:00",
            "estimatedTimeForDelivery": "2019-03-19 17:23:00",
            "deliveryCharge": 47,
            "productSize": "small",
            "confirmed": true,
            "description": "This is the order description with åäö"
        }
    }
}

Example response (200):

{
    "success": true,
    "message": "Order is already confirmed",
    "data": {
        "id": "ORD79-0006",
        "deliveryId": "3365",
        "serviceName": "Doorhub delivery",
        "timeUnit": "minute",
        "priceUnit": "DKK",
        "order": {
            "id": "ORD79-0006",
            "customerName": "Shamsul Alam",
            "customerPhone": "91766313",
            "customerFloor": "3tv",
            "deliveryId": "3365",
            "sellerName": "Barakat & Grill",
            "pickupAddress": "Amerikavej 19, copenhagen",
            "dropOffAddress": "Heimdalsgade 42, copenhagen",
            "estimatedTimeForPickup": "2019-03-19 17:43:00",
            "estimatedTimeForDelivery": "2019-03-19 17:23:00",
            "deliveryCharge": 47,
            "productSize": "small",
            "orderCreated": "2019-03-19 16:28:50",
            "confirmed": true,
            "description": "This is the order description with åäö"
        }
    }
}

Example response (200):

{
    "success": true,
    "message": "Validity time expired",
    "suggestion": true,
    "data": {
        "id": "ORD79-0006",
        "pickupTime": "2019-03-19 18:36",
        "dropOffTime": "2019-03-19 19:06",
        "deliveryId": "3365",
        "valid_until": "2019-03-19 18:16"
    }
}

Example response (422):

{
    "success": false,
    "message": "orderId is not a valid order id",
    "error": []
}

HTTP Request

POST api/platform/v1/orders/checkout/confirm

Body Parameters

Parameter Type Status Description
orderId string required Reference Id returned from Doorhub checkout response.
deliveryId string required Platform order ID

Cancel order

A placed order can be cancel anytime. Although there are some criteria for Doorhub system where the order maybe still charged.

Example request:

curl -X PATCH "http://doorhub.dev/api/platform/v1/orders/cancel/{orderRef}" \
    -H "Authorization: Bearer {api-key}" \
    -H "Api-Version: v1"
const url = new URL("http://doorhub.dev/api/platform/v1/orders/cancel/{orderRef}");

    let params = {
            "orderRef": "MpumGEdJbAhxDMTJ",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {api-key}",
    "Api-Version": "v1",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "PATCH",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "success": true,
    "message": "Order is canceled",
    "data": {
        "id": "ORD79-0006",
        "deliveryId": "3365",
        "customerName": "Shamsul Alam",
        "customerPhone": "91766313",
        "sellerAddress": "Amerikavej 19, copenhagen",
        "sellerName": "Barakat & Grill",
        "orderedAt": "2019-03-19 18:20:00",
        "pickupTime": "2019-03-20 11:05:00",
        "dropOffTime": "2019-03-19 17:23:00"
    }
}

Example response (400):

{
    "success": false,
    "message": "order is not a valid order id",
    "error": []
}

Example response (400):

{
    "success": false,
    "message": "order can't cancel",
    "error": []
}

Example response (400):

{
    "success": false,
    "message": "order can't cancel, less than 10 min to pickup",
    "error": []
}

HTTP Request

PATCH api/platform/v1/orders/cancel/{orderRef}

Query Parameters

Parameter Status Description
orderRef required Doorhub reference id when order is created, which is the response of checkout endpoint. Example HUN73-0004

View an order

This service is used to view an existing order details.

Example request:

curl -X GET -G "http://doorhub.dev/api/platform/v1/orders/{orderRef}" \
    -H "Authorization: Bearer {api-key}" \
    -H "Api-Version: v1"
const url = new URL("http://doorhub.dev/api/platform/v1/orders/{orderRef}");

    let params = {
            "orderRef": "g0ejMmvEPwVyOERa",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Authorization": "Bearer {api-key}",
    "Api-Version": "v1",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "success": true,
    "message": "",
    "data": {
        "id": "ORD79-0007",
        "deliveryId": "3366",
        "serviceName": "Doorhub delivery",
        "timeUnit": "minute",
        "priceUnit": "DKK",
        "order": {
            "id": "ORD79-0007",
            "customerName": "Shamsul Alam",
            "customerPhone": "91766313",
            "customerFloor": "3tv",
            "deliveryId": "3366",
            "sellerName": "Barakat & Grill",
            "pickupAddress": "Amerikavej 19, copenhagen",
            "dropOffAddress": "Heimdalsgade 42, copenhagen",
            "estimatedTimeForPickup": "2019-03-20 19:41:00",
            "estimatedTimeForDelivery": "2019-03-20 20:11:00",
            "deliveryCharge": 47,
            "productSize": "small",
            "confirmed": true,
            "description": "This is the order description with åäö"
        }
    }
}

HTTP Request

GET api/platform/v1/orders/{orderRef}

Query Parameters

Parameter Status Description
orderRef required Doorhub reference id when order is created, which is the response of checkout endpoint. Example HUN73-0004

api/platform/v1/orders

Example request:

curl -X PUT "http://doorhub.dev/api/platform/v1/orders" \
    -H "Authorization: Bearer {api-key}" \
    -H "Api-Version: v1"
const url = new URL("http://doorhub.dev/api/platform/v1/orders");

let headers = {
    "Authorization": "Bearer {api-key}",
    "Api-Version": "v1",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "PUT",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

HTTP Request

PUT api/platform/v1/orders

general

api/company/v1/test

Example request:

curl -X GET -G "http://doorhub.dev/api/company/v1/test" \
    -H "Authorization: Bearer {api-key}" \
    -H "Api-Version: v1"
const url = new URL("http://doorhub.dev/api/company/v1/test");

let headers = {
    "Authorization": "Bearer {api-key}",
    "Api-Version": "v1",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (403):

{
    "success": false,
    "message": "Unauthorized",
    "error": []
}

HTTP Request

GET api/company/v1/test