Book a driver

This documentation will show you how to book a driver using DeliverIt API
Book a driver

This documentation will describe how to order a driver at an exact time using our API or how to transfer your customer details to DeliverIt for later booking of a driver.

It will also tell you how to get a detailed list of your ordered drivers including timestamps for arrival, pickup, arrival at customer and done-time.

The flow for the ordering of a driver: You enter the customer information along with the requested pickup time. If the timeslot is available, everything is fine.

If the timeslot is not available, you will receive a new time near the requested time. You need to either accept the new time or deny the new time. URLs are provided. If you don’t have a login, and you are located in Odense, Aarhus, Aalborg or Copenhagen, please contact jim@deliverit.dk or soren@deliverit.dk to receive a login.

Login
POST /api/v1/login

For logging in, you must first optain a username and a password from DeliverIt. When loggin in, the door for using the system is opened up.

DeliverIt uses basic Authorization and for the rest of the pages you need to included the Authorization in the header.

Request parameters

username
string required

The username, most likely an email address

password
string required

The password for the user.

Request headers

Authorization
string optional

Basic authoriztion

Responses

201 201

If the user is succesfully logged in

Body
Object
login
boolean
Example:
true
company
integer

The company Id. Important to keep.

Example:
1
msg
string
Example:
Welcome
401 401

if the login fails.

Body
Object
login
boolean

true / false

msg
string
Example:
nope, try again
Send delivery request
POST /api/v1/orderdriver/create

This is to feed DeliverIt with the information for necesary to request a driver

Request parameters

firstname
string required

First name of the customer

lastname
string optional

Last name of the customer

street
string required

Streetname and number

zip
integer required

Zip code of the city

city
string optional

The city

time
string required

The requested time. hh:mm (18:30). You can also type the whole date: yyyy-mm-dd hh:ii

arrive_at_customer
string optional

Can be applied instead of time. Used to request arrival at customer instead of arrival at restraurant.

Example:
2019-08-01 17:23
telephone
number required

Telephone for the customer. Avoid country codes like 0045 and +45.

remarks
string optional

If the customer has any remarks the driver needs to know

latitude
number required

Address latitude. example: 55.3957969

longitude
number required

Address longitude. example: 10.3912053

Request headers

Authorization
string optional

Basic abcdeftghijklmnopqrstuvxyz12345=

Responses

400 400

When trying to book befor of after open hours

Body
Object
DeliverItOpen
boolean
error
boolean
Example:
true
message
string
Example:
Sorry. DeliverIt is closed.
201 201

If the trip is placed at delivery without any time alteration

Body
Object
DeliverItOpen
boolean
Example:
true
order_driver
boolean
Example:
true
push
boolean

Can be true of false depending on weather or not the requested time is available

time
string

Time of arrival at restaurant / shop

Example:
20:15
arrive_at_customer
string

Estimated time of arrival at end-customer

Example:
20:26
order_id
integer
Example:
11823
acceptUrl
string

if push is true, this link is to accept the pushed time

denyUrl
string

if push is true, this link is to decline the pushed time

cancelUrl
string

Url to cancel the driver. You can cancel freely untill 20 minutes before pickup time

Example:
http://butik.deliverit.dk/api/v1/orderdriver/cancel/14/F64u3fbxNdaoTyAcOisM
statusUrl
string

Use this link to get the status. This is for logging purposes. (from 01/09/2018)

Example:
https://butik.deliverit.dk/api/v1/orderdriver/status/14/F64u3fbxNdaoTyAcOisM
DeliveryPrice
string

Our price ex. vat

DeliveryDistance
string

Distance in meters

trackntrace
string

Link for track n trace website

Example:
http://minbestilling.deliverit.dk/ZRfgfetrjgCfiq7FruO7
Accept push
POST /api/v1/orderdriver/accept/{company}/{id}

The requested time is not available, the time will be pushed to the nearest free time slot. This is to accept the new time givin.

Path variables

company
string required
id
string required

Request headers

Authorization
string optional

Basic abcdeftghijklmnopqrstuvxyz12345=

Responses

202 202

The trip is accepted

Body
Object
DeliverItOpen
boolean
Example:
true
order_driver
boolean
Example:
true
time
string
Example:
19:23
arriveAtCustomer
string
Example:
19:42
message
string
Example:
The trip is saved and the driver will arrive at restaurant at 19:23
cancelurl
string
Example:
https://dev.butik.deliverit.dk/api/v1/orderdriver/cancel/149/RYGKaXMCSN94WfqPEivy
200 200

The trip is already accepted

Body
Object
DeliverItOpen
boolean
Example:
true
order_driver
boolean

This is false since the trip is already accepted

message
string
Example:
You have already accepted this trip or it has not been pushed. Nothing to do
cancelurl
string
Example:
http://butik.deliverit.dk/api/v1/orderdriver/cancel/14/uyPtNITg5cAOoKDViG2e
401 401

Unauthorized access

Body
Object
DeliverItOpen
boolean
Example:
true
order_driver
boolean
message
string
Example:
You should not be here
400 400

If the time limit is exceeded or the order does not exist

Body
Object
DeliverItOpen
boolean
Example:
true
order_driver
boolean
message
string
Example:
You cannot accept this anymore. Time limit reached or order does not exist. Please create new order
Deny push
POST /api/v1/orderdriver/deny/{company}/{id}

If the order is push, and the restaurant cannot accept the new time, use this URL to deny the new time

Path variables

company
string required
id
string required

Request headers

Authorization
string optional

Basic abcdeftghijklmnopqrstuvxyz12345=

Responses

200 200

The order is canceled

Body
Object
error
boolean

false

message
string
Example:
The order is now canceled
400 400

If an input is missing or you should not be here

Body
Object
error
boolean
Example:
true
message
string
Example:
You should not be here
Cancel
POST /api/v1/orderdriver/cancel/{company}/{weborderId}

You can use this to cancel a order. When you create the order, the cancel url is returned to you. Use the link to cancel a order You can also get the cancel url from “get orders period”

According to the term of trade orders where the pickup time is 15 minutes or less are imposible to cancel.

Path variables

company
string required
weborderId
string required

Request headers

Authorization
string optional

Basic abcdeftghijklmnopqrstuvxyz12345=

Responses

200 200

OK

Body
Object
error
boolean
message
string
Example:
Okay, the order is canceled
400 400

Error

Body
Object
error
boolean
Example:
true
message
string
Example:
You cannot cancel this order. The driver is on the way. Contact DeliverIt +45 93 866 766
401 401

Invalid credentials. If you are not logged in Can also be you are trying to cancel a order that does not belong to you

Status
GET /api/v1/orderdriver/status/{company}/{weborderId}

Use this URL to receive time data. You recieve the URL at the moment you book the driver.

The url will return:

  • Requested pickup time
  • The time the driver arrives at the restaurant
  • The time the driver leaves the restaurant
  • the time the driver is expected to arrive at the customer
  • the time the driver actually arrives at the customer
  • the time the delivery is completed.

Timeformat is YYYY-MM-DD HH:ii:ss

Path variables

company
string required
weborderId
string required

Responses

200 OK
Body
Object
error
boolean
message
string
Example:
Getting status
data
Object
pickup_time
string
Example:
2018-07-30 18:00:00
arrive_at_restaurant
unknown nullable

if null, then the driver has not arrived at restaurant

left_restaurant
unknown nullable

If null, then driver has not left restaurant

arrive_at_customer
unknown nullable

if null, then driver has not arrived at customer

expected_delivery_complete
string
Example:
2018-07-30 18:15:30
deliveryComplete
unknown nullable

if null, then driver has not completed the delivery

401 Unauthorized

If the weborder ID does not exist or belongs to you

Body
Object
error
boolean
Example:
true
message
string
Example:
You should not be here
Open Hours
GET /api/v1/openhours

Get open hours for authenticated restaurant.

Responses

200 OK
Body
Object
monday
Object
start
string
Example:
17:00
end
string
Example:
21:00
tuesday
Object
start
string
Example:
17:00
end
string
Example:
21:00
wednesday
Object
start
string
Example:
17:00
end
string
Example:
21:00
thursday
Object
start
string
Example:
17:00
end
string
Example:
21:00
friday
Object
start
string
Example:
17:00
end
string
Example:
21:30
saturday
Object
start
string
Example:
17:00
end
string
Example:
21:30
sunday
Object
start
string
Example:
17:00
end
string
Example:
21:30
401 Unauthorized
Body
Object
login
boolean
msg
string
Example:
Nope, try again