#
Estimation
#
Introduction
Users can get estimates for the time and fees from the branch to the destination location through our endpoints, Allowing them to check potential costs and delivery times without starting the order process.
#
Real-Time Driver Location Estimation
Get delivery estimates based on the current locations of nearby drivers.
To try it, send an HTTP POST request to this endpoint:
https://api.armadadelivery.com/v1/deliveries/estimate
The body of the request should be in JSON format and include the following parameters:
origin
: Origin information Object - Requiredbranch
: Branch ID String - Required
destination
: Customer destination Object - Requiredlocation
: Location information Object - Requiredlatitude
: Float - Requiredlongitude
: Float - Required
#
Request Example
Remember to include your Armada-Access-Token
in the request headers. If you don't have one, please refer to the Authentication page to learn how to obtain it.
curl --location --request POST 'https://api.armadadelivery.com/v1/deliveries/estimate' \
--header 'Armada-Access-Token: [YOUR ACCESS TOKEN]' \
--header 'Content-Type: application/json' \
--data-raw '{
"origin": {
"branch": "6757fe0ecc4d918c80f71256"
},
"destination": {
"location": {
"latitude": 29.3300,
"longitude": 47.9085
}
}
}'
fetch('https://api.armadadelivery.com/v1/deliveries/estimate', {
method: 'POST',
headers: {
'Armada-Access-Token': '[YOUR ACCESS TOKEN]',
'Content-Type': 'application/json'
},
body: JSON.stringify({
origin: {
branch: "6757fe0ecc4d918c80f71256"
},
destination: {
location: {
latitude: 29.3300,
longitude: 47.9085
}
}
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
func main() {
url := "https://api.armadadelivery.com/v1/deliveries/estimate"
requestBody, err := json.Marshal(map[string]interface{}{
"origin": map[string]string{
"branch": "6757fe0ecc4d918c80f71256",
},
"destination": map[string]interface{}{
"location": map[string]float64{
"latitude": 29.3300,
"longitude": 47.9085,
},
},
})
if err != nil {
fmt.Println("Error in JSON marshal:", err)
return
}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(requestBody))
if err != nil {
fmt.Println("Error creating request:", err)
return
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Armada-Access-Token", "[YOUR ACCESS TOKEN]")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error sending request:", err)
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading response body:", err)
return
}
fmt.Println(string(body))
}
#
Response Schema
{
"deliveryFee": Number,
"pickupEta": ISODATE || null,
"deliveryEta": ISODATE || null,
}
Eta: Estimated Arrival time
#
Response Example
{
"deliveryFee": 17,
"pickupEta": "2024-01-18T14:48:00.000Z",
"deliveryEta": "2024-01-18T15:39:00.000Z"
}
The pickupEta
and deliveryEta
might be null
if no driver is available. Please try again later.
To get better results, use real data.
#
Timeless Estimation
Get delivery estimates without relying on real-time driver locations.
To try it, send an HTTP POST request to this endpoint:
https://api.armadadelivery.com/v1/timeless_estimate
The body of the request should be in JSON format and include the following parameters:
origin
: Origin information Object - Requiredbranch
: Branch ID String - Required
destination
: Customer destination Object - Requiredlocation
: Location information Object - Requiredlatitude
: Float - Requiredlongitude
: Float - Required
#
Request Example
Remember to include your Armada-Access-Token
in the request headers. If you don't have one, please refer to the Authentication page to learn how to obtain it.
curl --location --request POST 'https://api.armadadelivery.com/v1/timeless_estimate' \
--header 'Armada-Access-Token: [YOUR ACCESS TOKEN]' \
--header 'Content-Type: application/json' \
--data-raw '{
"origin": {
"branch": "6757fe0ecc4d918c80f71256"
},
"destination": {
"location": {
"latitude": 29.3300,
"longitude": 47.9085
}
}
}'
fetch('https://api.armadadelivery.com/v1/timeless_estimate', {
method: 'POST',
headers: {
'Armada-Access-Token': '[YOUR ACCESS TOKEN]',
'Content-Type': 'application/json'
},
body: JSON.stringify({
origin: {
branch: "6757fe0ecc4d918c80f71256"
},
destination: {
location: {
latitude: 29.3300,
longitude: 47.9085
}
}
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
func main() {
url := "https://api.armadadelivery.com/v1/timeless_estimate"
requestBody, err := json.Marshal(map[string]interface{}{
"origin": map[string]string{
"branch": "6757fe0ecc4d918c80f71256",
},
"destination": map[string]interface{}{
"location": map[string]float64{
"latitude": 29.3300,
"longitude": 47.9085,
},
},
})
if err != nil {
fmt.Println("Error in JSON marshal:", err)
return
}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(requestBody))
if err != nil {
fmt.Println("Error creating request:", err)
return
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Armada-Access-Token", "[YOUR ACCESS TOKEN]")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
fmt.Println("Error sending request:", err)
return
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println("Error reading response body:", err)
return
}
fmt.Println(string(body))
}
#
Response Schema
{
"deliveryFee": Number,
"totalDeliveryDuration": Number,
"durationToPickup": Number
}
#
Response Example
{
"deliveryFee": 17,
"totalDeliveryDuration": 1950,
"durationToPickup": 975
}