Learn the company integration in details. We have described all the integration steps in details here.
First of all you have to signup as a store into the Doorhub system. Register.
Once your company is registered, it may take 24-48 hours to activate the account. Please contact us to activate it immediately.
Once your account is activated, you can login to the dashboard
of our test environment (https://test.doorhub.io/dashboard). Test environment is used only for testing and integration purposes.
The dashboard is useful for the integration as here you can see the placed orders, order current statuses etc.
Once you are logged in you’ll have 3 different options for registration you can create (Warehouse / Store / Hub). To offer your customers with sameday deliveries you have to create a (Warehouse).
Dashboard of the test environment provides helpful features targets for the testing of the system and integration. When you use the TEST api key the response of the API might be a mock of the same format as it is on the live server.
Once you are into the dashboard, you can see the TEST api key. while doing the integration you should send this API key for all the requests.
Key format: Test api key starts with co_test_*
You LIVE api key will be activated once the integration is complete and agreed by both parties (Doorhub and Company). Live api key should be used for the production environment for placing the real orders.
Key format: Live api key starts with co_live_*
{info} Even thought you are using TEST key or LIVE key, you should always send the api request to our LIVE environment (https://doorhub.io).
Using this api service company can get all the delivery regions that Doorhub supports for them (the company).
{primary} Example of a request
curl -X GET -G "https://doorhub.io/api/sameday/v1/company/warehouse"
-H "Authorization: Bearer {api-key}"
-H "Api-Version: v1"
{success} Example of response [200]
{
"success": true,
"message": "Warehouses list",
"data": {
"company": {
"id": 1,
"name": "DH Restaurant"
},
"warehouse": [
{
"warehouseId": 172,
"warehouseName": "Kastrup Warehouse",
"pickupAddress": "Kastrup, Denmark",
"city": "Copenhagen",
"distribution": [
{
"id": 1,
"firstDate": "25-04-2020",
"orderBefore": "10:00:00",
"starTime": "12:00:00",
"endTime": "17:00:00"
},
{
"id": 2,
"firstDate": "24-04-2020",
"orderBefore": "14:00:00",
"starTime": "19:00:00",
"endTime": "20:00:00"
}
]
}
]
}
}
Using this api service company can get the next available date and times.
{primary} Example of a request
curl -X GET -G "https://doorhub.io/api/sameday/v1/company/warehouse/{warehouse}"
-H "Authorization: Bearer {api-key}"
-H "Api-Version: v1"
{success} Example of response [200]
{
"success": true,
"message": "Warehouses list",
"data": [
{
"id": 2,
"firstDate": "02-10-2020",
"orderBefore": "10:00:00",
"starTime": "11:00:00",
"endTime": "13:00:00"
}
]
}
To validate customer address you will use this service.
{primary} Example of a request
curl -X POST "https://doorhub.io/api/sameday/v1/warehouse/customer/address/check"
-H "Authorization: Bearer {api-key}"
-H "Api-Version: v1"
-H "Content-Type: application/json"
-d '{
"dropOffAddress" : "Amager, Copenhagen"
"storeId" : 176
}'
Parameters | Type | Status | Description |
---|---|---|---|
dropOffAddress | string | required | The google like address of the order where it should be delivered. Example: Heimdalsgade 42, 2200 København N |
storeId | Integer | required | The warehouse Id for address validation |
Validate customer response:
200 - When the address is valid
404 - When the address is not valid
400 - When the address or storeId parameter is not valid
{success} Example of a response [200]
when the address is validate, it will response with http code: 200
{
"success": true,
"message": "Address support status!",
"data": {
"status": true,
"region_id": 2,
"city": "Copenhagen",
"price": 49.0,
"priceUnit": "DKK"
}
}
{danger} Example of a response [404]
when the address is not validate, it will response with http code: 404
{
"success": true,
"message": "Address support status!",
"data": {
"status": false,
"region_id": null,
"city": null,
"price": null,
"priceUnit": null
}
}
{danger} Example of a response [400]
when the address parameter is not set correctly, it will response with http code: 400
{
"success": false,
"message": "Address not set!",
"error": ""
}
when the storeId parameter is not set correctly, it will response with http code: 400
{
"success": false,
"message": "StoreId not set!",
"error": ""
}
To place an order to Doorhub as warehouse, you will use this checkout service.
{primary} Example of a request
curl -X POST "https://doorhub.io/api/sameday/v1/warehouse/order/checkout"
-H "Authorization: Bearer {api-key}"
-H "Api-Version: v1"
-H "Content-Type: application/json"
-d '{
"dropOffAddress" : "Amager, Copenhagen",
"customerName" : "Ahmed",
"customerPhone" : "52172329",
"customerEmail": "test@anymail.com",
"productSize" : "medium",
"customerFloor" : "11",
"warehouseId" : 172,
"description" : "this is test",
"deliveryId" : "1000022",
"dateForDropOff" : "2019-07-09",
"distributionId" : 2,
"deliveryType" : 0,
"hubId" : 41,
"plugin" : {
"name": "shopify"
}
}'
Parameters | Type | Status | Description |
---|---|---|---|
warehouseId | integer | nullable if company is set | warehouseId is for the reference of the Warehouse. (Choose according to the pickup location) |
distributionId | integer | nullable | preferred delivery time |
deliveryId | string | nullable | Is your own order reference number, this is for the reference of the order. |
pickupAddress | string | required | The google like address of the order pickup location, Example: Toftegårds Allé 49, 2500 København |
dropOffAddress | string | required | The google like address of the order where it should be delivered. Example: Heimdalsgade 42, 2200 København N |
customerFloor | string | required | customer apartment floor |
dateForDropOff | Date | required | Drop off time |
customerName | string | required | Name of the customer |
customerPhone | string | required | Phone numner of the customer. Example: 91722653 |
customerEmail | string | optional | Email address of the customer. Example: test@anymail.com |
customerFloor | string | optional | Floor numner of the customer. Example: 1.Tv |
productSize | string | required | The size of the products, it can be [small ,medium, big]. Our Bag size is W: 16 x L: 16 x H: 18 "Inch". For Food category: 0-6 items AND price <> 0 - 550 dkk: small ,0-9 items AND price <> 551 - 999 dkk: medium ,10 > items AND price > 1000 dkk: big |
deliveryType | integer | required | 0 for Parcel Delivery and 1 for Home Delivery. |
hubId | Integer | required if deliveryType 0 | Closest Hub id. |
plugin.name | string | optional | values could be [shopify, woocommerce, magento] |
Checkout response:
201 - When the order it created
200 - Order maybe already exists and confirmed
200 - Order maybe already exists and needs to confirm using confirm API
200 - Order maybe can't place in time (for scheduled order) and Doorhub sends best possible suggestion time
400 - Any bad request, like the zone is not supported by Doorhub etc.
422 - If any required request field is missing / any error
{success} Example of a response [201]
when the order is created, it will response with http code: 201
{
"success": true,
"message": "Order processed successfully",
"data": {
"orderRef": "172-0001",
"serviceName": "Doorhub delivery",
"priceUnit": "DKK",
"order": {
"bundleRef": "Kh173_1",
"customerName": "Ahmed",
"customerPhone": "52172329",
"customerFloor": "11",
"deliveryId": 1000022,
"sellerName": "Kastrup Warehouse",
"pickupAddress": "Kastrup, Denmark",
"dropOffAddress": "Amager, Copenhagen",
"deliveryCharge": 49,
"productSize": "medium",
"confirmed": true,
"distributionId": 2,
"dateForDropOff": "2019-07-05",
"deliveryTime": "12:00:00 to 17:00:00",
"description": "Test order",
"status": "Waiting"
}
}
}
{danger} Example of a response [422]
if any arguments is missing or preferred date and time if not satisfied
{
"success": false,
"message": "Order can not be placed! please check your drop off date and time!",
"error": {
"dropOffAddress": "Ryparken 35, Copenhagen",
"customerName": "Ahmed",
"customerPhone": "52172329",
"productSize": "medium",
"customerFloor": "11",
"warehouseId": 172,
"description": "this is test",
"deliveryId": "1000011",
"dateForDropOff": "2019-06-2",
"distributionId": 1,
"regionId": 1
}
}
{warning} Example of response [200]
if Order already exists and confirmed
{
"success": false,
"message": "Order already exists and confirmed.",
"data": {
"orderRef": "172-0001",
"serviceName": "Doorhub delivery",
"priceUnit": "DKK",
"order": {
"bundleRef": "Kh173_1",
"customerName": "Ahmed",
"customerPhone": "52172329",
"customerFloor": "11",
"deliveryId": 1000022,
"sellerName": "Kastrup Warehouse",
"pickupAddress": "Kastrup, Denmark",
"dropOffAddress": "Amager, Copenhagen",
"deliveryCharge": 49,
"productSize": "medium",
"confirmed": true,
"distributionId": 2,
"dateForDropOff": "2019-07-05",
"deliveryTime": "12:00:00 to 17:00:00",
"description": "Test order",
"status": "Waiting"
}
}
}
if Order already exists but needs confirmation
{
"success": false,
"message": "Order already exist, but need to be confirmed.",
"data": {
"orderRef": "172-0001",
"serviceName": "Doorhub delivery",
"priceUnit": "DKK",
"order": {
"bundleRef": "Kh173_1",
"customerName": "Ahmed",
"customerPhone": "52172329",
"customerFloor": "11",
"deliveryId": 1000022,
"sellerName": "Kastrup Warehouse",
"pickupAddress": "Kastrup, Denmark",
"dropOffAddress": "Amager, Copenhagen",
"deliveryCharge": 49,
"productSize": "medium",
"confirmed": true,
"distributionId": 2,
"dateForDropOff": "2019-07-05",
"deliveryTime": "12:00:00 to 17:00:00",
"description": "Test order",
"status": "Waiting"
}
}
}
This service is used to cancel an order. Any order maybe canceled after it is placed to the Doorhub system.
When order can be cancel?
Which cases the order can't be cancel?
An order maybe canceled but still might charged as if the pickup time less than 10 minutes
{primary} Example of request
curl -X PATCH "https://doorhub.io/api/sameday/v1/warehouse/order/cancel"
-H "Authorization: Bearer {api-key}"
-H "Api-Version: v1"
-d '{
"orderRef" : "172-0006"
}'
{success} Example of response [200]
{
"success": true,
"message": "Order is canceled!",
"data": {
"orderRef": "174-0006"
}
}
if order is already canceled
{success} Example of response [200]
{
"success": true,
"message": "Order is already canceled!",
"data": {
"orderRef": "174-0006"
}
}
{danger} Example of response [404]
if the order is not valid
{
"success": false,
"message": "Order is not found!",
"error": "174-00062 is invalid, Please check your order reference!"
}
{danger} Example of response [400]
{
"success": true,
"message": "Order can not be canceled!",
"data": {
"orderRef": "174-0004"
}
}
This service is used to view an existing order details.
{primary} Example of request
curl -X GET -G "https://doorhub.io/api/sameday/v1/warehouse/order/{orderRef}/show"
-H "Authorization: Bearer {api-key}"
-H "Api-Version: v1"
{success} Example of response [200]
{
"success": true,
"message": "",
"data": {
"orderRef": "/docs/1.0/samedays/integration-details#172-0001",
"serviceName": "Doorhub delivery",
"priceUnit": "DKK",
"order": {
"bundleRef": "Kh173_1",
"customerName": "Ahmed",
"customerPhone": "52172329",
"customerFloor": "11",
"deliveryId": 1000022,
"sellerName": "Kastrup Warehouse",
"pickupAddress": "Kastrup, Denmark",
"dropOffAddress": "Amager, Copenhagen",
"deliveryCharge": 49,
"productSize": "medium",
"confirmed": true,
"deliveryDate": "2019-07-05",
"deliveryTime": "12:00:00 to 17:00:00",
"description": "Test order",
"status": "Waiting"
}
}
}
{danger} Example of response [404]
{
"success": false,
"message": "Order is not found!",
"error": "174-00062 is invalid, Please check your order reference!"
}