DeliverIt bestilling
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.
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
The username, most likely an email address
The password for the user.
Request headers
Basic authoriztion
Responses
If the user is succesfully logged in
Body
The company Id. Important to keep.
if the login fails.
Body
true / false
This is to feed DeliverIt with the information for necesary to request a driver
Request parameters
Frist name of the customer
Last name of the customer
streetname and number. Avoid typing: Appartment, apt, floor,basement etc
zip code of the city
The city
The requested time. hh:mm (18:30). You can also type the whole date: yyyy-mm-dd hh:ii
Telephone for the customer. Avoid country codes like 0045 and +45.
If the customer has any remarks the driver needs to know
Address latitude. example: 55.3957969
Address longitude. example: 10.3912053
Request headers
Basic abcdeftghijklmnopqrstuvxyz12345=
Responses
Missing input, closed for the day etc. Check msg.
Body
When trying to book befor of after open hours
Body
If the trip is placed at delivery without any time alteration
Body
Can be true of false depending on weather or not the requested time is available
The price without VAT for the delivery
The distance in meters for the delivery
Time of arrival at restaurant / shop
Estimated time of arrival at end-customer
if push is true, this link is to accept the pushed time
if push is true, this link is to decline the pushed time
Url to cancel the driver. You can cancel freely untill 20 minutes before pickup time
{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
Request headers
Basic abcdeftghijklmnopqrstuvxyz12345=
Responses
The trip is accepted
Body
The trip is already accepted
Body
This is false since the trip is already accepted
Unauthorized access
Body
If the time limit is exceeded or the order does not exist
Body
{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
Request headers
Basic abcdeftghijklmnopqrstuvxyz12345=
Responses
The order is canceled
Body
false
If an input is missing or you should not be here
Body
{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
Request headers
Basic abcdeftghijklmnopqrstuvxyz12345=
Responses
Body
Error
Body
Invalid credentials. If you are not logged in Can also be you are trying to cancel a order that does not belong to you
{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
YYYY-MM-DD example 2016-01-31
YYYY-MM-DD example 2016-01-31
Request headers
Basic abcdefghicklmnopqrstuvxyz123456789
Responses
Body
Should be false
This array contains all orders returned.
Url to follow if you wish to cancel a order
if canceled or not (1/0)
Time for cancellation
See the message for fix
Body
Wrong place at the wrong time
Body
{company}
/createOrder 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
The company id givin at login.
Request parameters
Your unique order number
Name of the customer
8 digit number.
Send a cleaned version of the streetname. See http://dawa.aws.dk
Zip code for the city
Any remarks for the driver?
1 = paid, 0 = unpaid. Only paid orders are shown in our interface
Will the customer pick up the order or do you need delivery. 1= Delivery, 0 = no delivery
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
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
Your authorization code obtained via login.
Responses
If everyhing is fine. order for delivery:
Body
If everything is fine. Order for self pickup
Body
If a required variable is empty or missing
Body
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
If you are trying to save an order with a non-unique order number
Body
If everything is correct but the order is not saved
Body
Trying to access an order that is not yours.
Body
{company}
/{order_number}
/updateIf 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
The company id provided at login
DeliverIts order number. A unique string returned upon ordering
Request parameters
your unique ordernumber
Name of the customer
8 digit number
Send a cleaned version of the street. See http://dawa.aws.dk
The city corresponding to the zip code
If there are any remarks / instructions for the driver
1 = paid, 0 = unpaid. Only paid orders will be shown in the interface
1= delivery, 0 = no delivery and the customer will pick up the order
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
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
The authorization string provied at login
Responses
Body
true
url for cancelation
When a required variable is missing or empty
Body
See the required parameters.
When you try to update an order and the ordernumber does not exist
Body
{company}
/{order_number}
/cancelIf 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
The company id provided at login
DeliverIts order number. A unique string returned upon ordering
Responses
Cancelation ok
Body
There are nothing wrong with the data. But there are less then 15 minutes till pickup. The driver cannot be canceled.
Body
false
false
When the order number does not exist
Body
If the database is not updated
Body
When you are trying to delete an order that is not yours.