DeliverIt bestilling

To access DeliverIts system. You can book a driver directly or you can transfer your customer details from your webshop for later booking of driver using DeliverIts interface.
Order a driver using DeliverIt API access.

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 or Aarhus, 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 Ok

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 Unauthorized

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

Frist name of the customer

lastname
string optional

Last name of the customer

street
string required

streetname and number. Avoid typing: Appartment, apt, floor,basement etc

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

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 Errors

Missing input, closed for the day etc. Check msg.

Body
Object
DeliverItOpen
boolean
error
boolean
Example:
true
message
string
Example:
Telephone cannot be empty
400 Error closed

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 Created

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
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 Accepted

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 OK

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 Unauthorized

Unauthorized access

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

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 OK

The order is canceled

Body
Object
error
boolean

false

message
string
Example:
The order is now canceled
400 Error

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 OK
Body
Object
error
boolean
message
string
Example:
Okay, the order is canceled
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 Unauthorized

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

Get orders period
GET /api/v1/order/{company}/{start}/{end}

Use this to get the orders from a period of time.

Simply enter the date for the first day and date for the last day in the period you wish to fetch.

If you want the orders for 1 day, let “start” and “end” have the same value.

The start date has to be bigger then the end date.

Path variables

company
string required
start
string required

YYYY-MM-DD example 2016-01-31

end
string required

YYYY-MM-DD example 2016-01-31

Request headers

Authorization
string optional

Basic abcdefghicklmnopqrstuvxyz123456789

Responses

200 OK
Body
Object
error
boolean

Should be false

orders
Array

This array contains all orders returned.

Object
created_at
Object
date
string
Example:
2017-05-13 17:30:07.000000
timezone_type
integer
Example:
3
timezone
string
Example:
Europe/Berlin
name
string
Example:
Customer 1
telephone
string
Example:
+45123456789
address
string
Example:
Hovedgaden 1
city
string
Example:
Odense C
zip
string
Example:
5000
remarks
string
deliveryPrice
string
Example:
60
pickupTime
string
Example:
17:59
driverArrive
string
Example:
N/A
driverLeft
string
Example:
N/A
arriveAtCustomer
string
Example:
N/A
done
string
Example:
N/A
distance
string
Example:
1914
canceUrl
string

Url to follow if you wish to cancel a order

cancel
boolean

if canceled or not (1/0)

canceled_at
string

Time for cancellation

message
string
Example:
Here are the orders you are looking for
404 Error

See the message for fix

Body
Object
error
boolean
Example:
true
message
string
Example:
No order is found. Are the dates correct?.
401 Unauthorized

Wrong place at the wrong time

Body
Object
error
boolean
Example:
true
message
string
Example:
You should not be here
Send customer Info
POST /api/v1/orderinfo/{company}/create

Order info, this is if you wish to transfer the customer details into our system. You can later via our interface see the customer and order a driver for the given customer. This is used when you have your own interface for displaying order content.

No order content (items ordered, amount, etc) are not transfered.

Address longtitude and latitude are optional. If you send a dirty address, the longitude and latitude might be calulated wrongly and your customer might not get the order in time.

Path variables

company
string required

The company id givin at login.

Request parameters

ordernumber
string required

Your unique order number

name
string required

Name of the customer

telephone
string ######## required

8 digit number.

street
string required

Send a cleaned version of the streetname. See http://dawa.aws.dk

city
string required
zip
string required

Zip code for the city

remarks
string optional

Any remarks for the driver?

paid
boolean required

1 = paid, 0 = unpaid. Only paid orders are shown in our interface

Default:
false
delivery
boolean optional

Will the customer pick up the order or do you need delivery. 1= Delivery, 0 = no delivery

Default:
true
longitude
string required

Address longitude. DeliverIt is not responsable for the correct longitude. If you have written a wrongfull address the coordinates will be with error as well. But we do our best

latitude
string required

Address latitude. DeliverIt is not responsable for the correct Latitude. If you have written a wrongfull address the coordinates will be with error as well. But we do our best

Request headers

Authorization
string required

Your authorization code obtained via login.

Responses

201 Created

If everyhing is fine. order for delivery:

Body
Object
error
boolean
message
string
Example:
ok,This order is for delivery
distance_in_km
number
Example:
10.35
price_with_vat
integer
Example:
125
update_url
string
Example:
https://butik.deliverit.dk/api/v1/orderinfo/14/q2cJv7WQt0516eh/update
cancel_url
string
Example:
https://butik.deliverit.dk/api/v1/orderinfo/14/q2cJv7WQt0516eh/cancel
201 Created

If everything is fine. Order for self pickup

Body
Object
error
boolean
message
string
Example:
ok,The customer will pick up this order
distance_in_km
number
Example:
10.35
price_with_vat
integer
update_url
string
Example:
https://butik.deliverit.dk/api/v1/orderinfo/14/hqlONswckVx44Q0/update
cancel_url
string
Example:
https://butik.deliverit.dk/api/v1/orderinfo/14/hqlONswckVx44Q0/cancel
400 Variable missing

If a required variable is empty or missing

Body
Object
error
boolean
Example:
true
message
string
Example:
Variable 'variable-name' cannot be empty
400 Messy address

If latitude and longtitude are not send, and the address is too messy to find the correct latitude and longtuide. You will see this error.

Body
Object
error
boolean
Example:
true
message
string
Example:
Address is too messy. Cannot find latitude and longitude.
400 Order exists

If you are trying to save an order with a non-unique order number

Body
Object
error
boolean
Example:
true
message
string
Example:
Order with that number exist. Please use unique number
400 Unknown error

If everything is correct but the order is not saved

Body
Object
error
boolean
Example:
true
message
string
Example:
Some strange error has occured. Please try again. If the error remains, please contact DeliverIt
401 Unauthorized

Trying to access an order that is not yours.

Body
Object
error
boolean
Example:
true
message
string
Example:
You should not be here
Update customer info
POST /api/v1/orderinfo/{company}/{order_number}/update

If you have send customer info to DeliverIt, and you need to update the information. It could be: updating the order from paid=0 to paid=1.

Path variables

company
string required

The company id provided at login

order_number
string required

DeliverIts order number. A unique string returned upon ordering

Request parameters

ordernumber
string required

your unique ordernumber

name
string required

Name of the customer

telephone
number required

8 digit number

street
string required

Send a cleaned version of the street. See http://dawa.aws.dk

city
string required

The city corresponding to the zip code

zip
number required
remarks
string optional

If there are any remarks / instructions for the driver

paid
boolean required

1 = paid, 0 = unpaid. Only paid orders will be shown in the interface

delivery
string required

1= delivery, 0 = no delivery and the customer will pick up the order

longitude
string optional

Address longitude. DeliverIt is not responsable for the correct longitude. If you have written a wrongfull address the coordinates will be with error as well. But we do our best

latitude
string optional

Address latitude. DeliverIt is not responsable for the correct Latitude. If you have written a wrongfull address the coordinates will be with error as well. But we do our best

Request headers

Authorization
string required

The authorization string provied at login

Responses

200 OK
Body
Object
error
boolean

true

message
string
Example:
Update ok,This order is for delivery
distance_in_km
number
Example:
1.93
price_with_vat
integer
Example:
50
update_url
string
Example:
https://butik.deliverit.dk/api/v1/orderinfo/14/NP15eLVptYSvRU0/update
cancel_url
string

url for cancelation

Example:
https://butik.deliverit.dk/api/v1/orderinfo/14/NP15eLVptYSvRU0/cancel
400 Error

When a required variable is missing or empty

Body
Object
error
boolean
Example:
true
message
string

See the required parameters.

Example:
Variable ordernumber cannot be empty
400 wrong Ordernumber

When you try to update an order and the ordernumber does not exist

Body
Object
error
boolean
Example:
true
message
string
Example:
Order with that number does not exist. Please use correct number
Destroy customer info
POST /api/v1/orderinfo/{company}/{order_number}/cancel

If you have send customer info to DeliverIt, but your end customer canceles, you can use destroy to cancel the booking of a driver.

Path variables

company
string required

The company id provided at login

order_number
string required

DeliverIts order number. A unique string returned upon ordering

Responses

200 OK

Cancelation ok

Body
Object
error
boolean
canceled
boolean
Example:
true
message
string
Example:
Cancellation ok,
202 Accepted

There are nothing wrong with the data. But there are less then 15 minutes till pickup. The driver cannot be canceled.

Body
Object
error
boolean

false

canceled
boolean

false

message
string
Example:
You cannot cancel an order, where the driver is booked, and there are less than 15 minutes til pickup.
400 Error

When the order number does not exist

Body
Object
error
boolean
Example:
true
message
string
Example:
Order with that number does not exist. Please use correct number
400 Unknown error

If the database is not updated

Body
Object
error
boolean
Example:
true
message
string
Example:
Some strange error has occured. Please try again. If the error continues, please contact DeliverIt
401 Forbidden

When you are trying to delete an order that is not yours.

Body
Object
error
boolean
Example:
true
message
string
Example:
You should not be here