Skip to content
DocsSign inCreate an account

Quote a delivery

GET/api/v1/external/quotes

Optional 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_latnumberrequired
    Latitude of the pickup point, −90 to 90.
  • pickup_lngnumberrequired
    Longitude of the pickup point, −180 to 180.
  • dropoff_latnumberrequired
    Latitude of the dropoff point, −90 to 90.
  • dropoff_lngnumberrequired
    Longitude 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_centsinteger
    Delivery fee in minor units.
  • currencystring
    Three-letter code, e.g. KES.
  • zone_iduuid | null
    The zone the pickup falls in; null when none matched.
  • zone_namestring | null
    Its display name.
  • distance_metersinteger
    Straight-line distance between the two points.
  • eta_travel_secondsinteger
    Modelled travel time from pickup to dropoff.
  • target_pickup_secondsinteger
    Target time to collection: the zone’s SLA, or your account default outside every zone.
  • target_delivery_secondsinteger
    Target time to delivery, from the same source.

Unlike the other REST responses, a quote is snake_case.

Authorization: X-API-Key

Request
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"
Response
{
  "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
  }
}