DeliverIt bestilling

Til bestilling ved DeliverIt
Order a driver using DeliverIt API access.

This documentation will describe how to order a driver at an exact time using our API.

You can also get a detailed list of your ordered drivers including timestamps for arrival, pickup, arrival at customer and donetime.

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

If the timeslot is not avaiable you will recieve a new time near the requested time. You need to either accept the new time or deny the new time. Urls are provied.

If you don't have a login, and you are located in Odense or Aarhus, please contact jim@deliverit.dk to recieve 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 required

Last name of the customer

street
string required

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

zip
string required

zip code of the city

Min length:4 Max length:5
city
string required

The city

time
string required

The requested time. hh:mm (18:30)

telephone
string required

Telephone for the customer. Avoid 0045 and +45

Min length:8 Max length:8

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
201 Created

If the trip is placed at delivery without any time alteration

Body
Object
DeliverItOpen
boolean
Example:
order_driver
boolean
Example:
push
boolean
Example:
time
string
Example:
hh:mm
order_id
string
acceptUrl
string

If the requested time is not accepted and a new is giving, follow this url to accept the new time

denyUrl
string

If the requested time is not accepted and a new is giving, follow this url to denythe new time

cancelUrl
string

If the time is not pushed, this will contain a link for cancelation of the ordered driver

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

The accepted time

Example:
19:58
message
string

Detailed message

Example:
The trip is saved and the driver will arrive at 19:58
cancelurl
string

Follow this URL to cancel the ordered driver

Example:
http://butik.deliverit.dk/api/v1/orderdriver/cancel/14/uyPtNITg5cAOoKDViG2e
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