Quote a delivery
GET
/api/v1/external/quotesOptional but worth doing: it tells you the fee before you commit, and the SLA targets for the zone the pickup falls in, so you can warn a customer that a delivery is already at risk of being late. Nothing is created and no idempotency key is needed.
Query parameters
pickup_latnumberrequiredLatitude of the pickup point, −90 to 90.pickup_lngnumberrequiredLongitude of the pickup point, −180 to 180.dropoff_latnumberrequiredLatitude of the dropoff point, −90 to 90.dropoff_lngnumberrequiredLongitude of the dropoff point, −180 to 180.
How the fee is worked out#
The fee comes from the zone the pickup point falls inside, using that zone's per-kilometre schedule. Outside every zone, platform defaults apply and zone_id is null.
The ETA is a modelled estimate — straight-line distance, a detour factor, and an average speed — not a routed time, so treat eta_travel_seconds as a planning number rather than a promise.
Response fields#
fee_centsintegerDelivery fee in minor units.currencystringThree-letter code, e.g. KES.zone_iduuid | nullThe zone the pickup falls in; null when none matched.zone_namestring | nullIts display name.distance_metersintegerStraight-line distance between the two points.eta_travel_secondsintegerModelled travel time from pickup to dropoff.target_pickup_secondsintegerTarget time to collection: the zone’s SLA, or your account default outside every zone.target_delivery_secondsintegerTarget time to delivery, from the same source.
Unlike the other REST responses, a quote is snake_case.
Authorization: X-API-Key
curl -G https://api.dispatch.gumza.ke/api/v1/external/quotes \
-H "X-API-Key: $DISPATCH_API_KEY" \
--data-urlencode "pickup_lat=-1.2672" \
--data-urlencode "pickup_lng=36.8065" \
--data-urlencode "dropoff_lat=-1.2833" \
--data-urlencode "dropoff_lng=36.7833"{
"success": true,
"data": {
"fee_cents": 32000,
"currency": "KES",
"zone_id": "0b1e…",
"zone_name": "Nairobi Central",
"distance_meters": 4120,
"eta_travel_seconds": 944,
"target_pickup_seconds": 1800,
"target_delivery_seconds": 5400
}
}