Overview
Calculate the delivery price estimate for a single pickup-to-destination route. This endpoint returns pricing information and a tempDeliveryId that you use to create the actual delivery.
Required permission: pricing:read
Endpoint
Request
Body parameters
Pickup location coordinates Latitude of the pickup location (e.g., 6.5244)
Longitude of the pickup location (e.g., 3.3792)
Destination location coordinates Latitude of the destination (e.g., 6.4654)
Longitude of the destination (e.g., 3.4064)
Response
Success response
Always true for successful requests
Distance in kilometers between pickup and destination
Estimated duration in seconds
Encoded polyline of the route (can be null)
Temporary delivery ID to use when creating the delivery
Total delivery cost in Naira
Whether a promotional discount was applied
Percentage discount applied (0 if none)
Examples
curl -X POST https://api.chidori.africa/enterprise-service/api/pricing/single \
-H "X-API-Key: sk_live_xxx.yyy" \
-H "Content-Type: application/json" \
-d '{
"pickup": {
"lat": 6.5244,
"lon": 3.3792
},
"destination": {
"lat": 6.4654,
"lon": 3.4064
}
}'
200 Success
400 Location Out of Bounds
401 Unauthorized
403 Forbidden
{
"status" : true ,
"data" : {
"distanceKm" : 12.34 ,
"durationSec" : 900 ,
"geometry" : null ,
"tempDeliveryId" : "7c9aa6f0-0f62-4bb2-a3aa-6c7bbf7b9a1a" ,
"pricing" : {
"distance_km" : 12.34 ,
"total_cost" : 2500 ,
"promo_applied" : false ,
"promo_percent" : 0
}
}
}
Error codes
Status Message Description 400Location out of bounds Pickup or destination is outside the supported service area 401Unauthorized Invalid or missing API key 403Forbidden API key lacks pricing:read permission
Next steps
After getting a price estimate, use the tempDeliveryId to create the delivery:
Create Delivery Create a delivery using the tempDeliveryId