Create a delivery
/api/v1/external/dispatchesCreates one delivery in NEW, priced from the zone its pickup falls in, and returns it with the tracking token for your customer. Requires an Idempotency-Key header — see Idempotency.
Body
customerNamestringrequiredWho the rider is delivering to. 1–200 characters.customerPhonestringrequiredThe number the rider calls on arrival. 7–20 characters; send it in international form.pickupobjectrequiredWhere the rider collects.addressis required;lat,lngandnotesare optional.dropoffobjectrequiredSame shape as pickup. Where the parcel is going.paymentType'COD' | 'PREPAID'requiredCOD means the rider collects payment on delivery and it is reconciled against the amount below.externalIdstringYour own order id. Returned on every read and every webhook, so you never have to store ours.amountCentsintegerOrder value in minor units. Defaults to 0. Required in practice for COD.currencystringThree-letter code. Defaults to KES.targetPickupAtISO 8601When you want it collected by. Used for SLA reporting.targetDeliveryAtISO 8601When you want it delivered by.
Coordinates#
Coordinates are optional on both ends. With them, the delivery is matched to a zone, priced from that zone and routed; without them the rider navigates by the address text and the fee falls back to defaults. Send coordinates whenever you have them.
What to keep#
Store id if you want to call back about this delivery, and trackingToken if you want to give your customer a live link — see Tracking. Status changes arrive on your webhook; there is no need to poll.
Bulk create#
POST /api/v1/external/dispatches/bulk takes { "orders": [ … ] } with up to 500 entries, each exactly the shape above, and the same Idempotency-Key rule. All rows are written in one transaction: if the batch fails, no deliveries are created. Each row is priced independently against its own zone.
Use it for a daily upload. For anything event-driven, create one at a time — you get a clearer failure and per-delivery idempotency.
Authorization: X-API-Key
curl -X POST https://api.dispatch.gumza.ke/api/v1/external/dispatches \
-H "X-API-Key: $DISPATCH_API_KEY" \
-H "Idempotency-Key: 9b2f1c84-4e1a-4a7f-9f0e-2d3c5a6b7c8d" \
-H "Content-Type: application/json" \
-d '{
"externalId": "order_10294",
"customerName": "Customer 001",
"customerPhone": "+254700000001",
"pickup": { "address": "Shop 4, Westlands, Nairobi", "lat": -1.2672, "lng": 36.8065 },
"dropoff": { "address": "Kileleshwa, Nairobi", "lat": -1.2833, "lng": 36.7833,
"notes": "Gate 2, ask for reception" },
"paymentType": "COD",
"amountCents": 250000,
"currency": "KES",
"targetDeliveryAt": "2026-10-12T16:00:00.000Z"
}'{
"success": true,
"data": {
"id": "c0ffee11-2233-4455-6677-8899aabbccdd",
"externalId": "order_10294",
"status": "NEW",
"riderId": null,
"zoneId": "0b1e…",
"customerName": "Customer 001",
"customerPhone": "+254700000001",
"pickup": { "address": "Shop 4, Westlands, Nairobi", "lat": -1.2672, "lng": 36.8065 },
"dropoff": { "address": "Kileleshwa, Nairobi", "lat": -1.2833, "lng": 36.7833,
"notes": "Gate 2, ask for reception" },
"paymentType": "COD",
"amountCents": 250000,
"feeCents": 32000,
"currency": "KES",
"targetPickupAt": null,
"targetDeliveryAt": "2026-10-12T16:00:00.000Z",
"trackingToken": "Yk3n…",
"source": "api",
"createdAt": "2026-10-12T08:41:02.117Z",
"updatedAt": "2026-10-12T08:41:02.117Z"
}
}