Send customer info

This documentation will show you how you can send customer data to DeliverIt for later booking of driver using the DeliverIt interface.
Customer information

This documentation will describe how to transfer customer detalils to DeliverIt for later booking of the driver using DeliverIt’s interface.

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.

POST /api/v1/login
POST /api/v1/orderinfo/{company}/create
POST /api/v1/orderinfo/{company}/{order_number}/update
POST /api/v1/orderinfo/{company}/{order_number}/cancel
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 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 201

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 400

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 401

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

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 200

Cancelation ok

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

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 400

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 401

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