This API helps get an estimation of the delivery request. The estimation includes the cost, distance, and time. If you are planning to use custom delivery cost for your request, you do not need to use this API to know your cost as it will be automatically calculated when you submit a new delivery request .
Note: The provided data are just an estimate. The exact cost of the delivery, the distance and time, may be different.
Request
Method : POST
URI : https:
Header
{
"Content-Type" : "application/json" ,
"Accept" : "application/json" ,
"api_key" : "your-api-key" ,
"api_aceess" : "your-api-access" ,
"api_pass" : "your-api-password"
}
Key Required Details
api_key Yes String Your API key generated from the user portal
api_access Yes String Your API access generated from the user portal
api_password Yes String Your API password generated from the user portal
Body
{
"originLocation" : {
"lat" : 24.48316739335232 ,
"long" : 39.62342909511722
},
"destinationLocation" : {
"lat" : 24.425913138738597 ,
"long" : 39.60282972988284
}
}
Key Required Type Default Details
originLocation Yes Object - Object of both latitude and longitude of the pickup location
lat Yes Double - The location latitude
long Yes Double - The location longitude
destinationLocation Yes Object - Object of both latitude and longitude of the drop off location
Expected Response
Success
{
"code" : 200 ,
"status" : "success" ,
"message" : "Estimation completed" ,
"data" : {
"cost" : 17 ,
"distance" : "12.9 km" ,
"time" : "20 mins"
}
}
Property Type Details
data Array All the related messages found ordered by new to old
cost Float The estimated cost of the requested delivery. The cost doesn't include the subscription fees
distance String The estimated distance in string format
time String The esitmated travel time between the origin and the destination in string format
Failure
{
"code" : 400 ,
"err_code" : "1x00022-022" ,
"status" : "fail" ,
"message" : "Bad request" ,
"errors" : [
"Cannot calculate the distance - check origin and destination"
]
}
Code Error Details
400 1x00025-021 Error with the data provided
400 1x00025-002 Error with the data provided
401 1x00025-015 Couldn't validate the API
403 1x00025-157 Unauthorized to preform the request