Skip to main content

Overview

Calculate delivery price estimates for multiple destinations from a single pickup location. This is ideal for multi-stop deliveries or batch shipments. The endpoint returns a bulkId and individual tempDeliveryIds for each stop.
Required permission: pricing:read

Endpoint

POST /api/pricing/bulk

Request

Headers

X-API-Key
string
required
Your Chidori API key
Content-Type
string
required
Must be application/json

Body parameters

pickup
object
required
Pickup location coordinates (shared for all stops)
stops
array
required
Array of destination coordinates

Response

Success response

status
boolean
Always true for successful requests
data
object

Examples

curl -X POST https://api.chidori.africa/api/pricing/bulk \
  -H "X-API-Key: sk_live_xxx.yyy" \
  -H "Content-Type: application/json" \
  -d '{
    "pickup": {
      "lat": 6.5244,
      "lon": 3.3792
    },
    "stops": [
      {"lat": 6.4654, "lon": 3.4064},
      {"lat": 6.4321, "lon": 3.4567},
      {"lat": 6.4890, "lon": 3.3901}
    ]
  }'
{
  "status": true,
  "data": {
    "totals": {
      "distanceKm": 30.12,
      "durationSec": 2400,
      "pricing": {
        "distance_km": 30.12,
        "total_cost": 7000,
        "promo_applied": false,
        "promo_percent": 0
      }
    },
    "geometry": null,
    "bulkId": "1a4f1a5e-5b79-4c4a-a0d4-4c5c7b7bb1aa",
    "tempDeliveryIds": [
      "7c9aa6f0-0f62-4bb2-a3aa-6c7bbf7b9a1a",
      "6c9aa6f0-0f62-4bb2-a3aa-6c7bbf7b9a1b",
      "5c9aa6f0-0f62-4bb2-a3aa-6c7bbf7b9a1c"
    ]
  }
}

Creating bulk deliveries

After getting bulk pricing, you have two options:

Option 1: Create all at once using bulkId

Use the bulkId to create all deliveries in a single request:
curl -X POST https://api.chidori.africa/api/deliveries/create-bulk \
  -H "X-API-Key: sk_live_xxx.yyy" \
  -H "Content-Type: application/json" \
  -d '{"bulkId": "1a4f1a5e-5b79-4c4a-a0d4-4c5c7b7bb1aa"}'

Option 2: Create individually using tempDeliveryIds

Create each delivery separately using individual tempDeliveryIds:
curl -X POST https://api.chidori.africa/api/deliveries/create \
  -H "X-API-Key: sk_live_xxx.yyy" \
  -H "Content-Type: application/json" \
  -d '{"tempDeliveryId": "7c9aa6f0-0f62-4bb2-a3aa-6c7bbf7b9a1a"}'

Bulk payment

When paying for bulk deliveries, you can pay for all deliveries in the bulk by passing any deliveryId from the bulk. The system automatically calculates the total for all deliveries in that bulk.

Create Bulk Deliveries

Create multiple deliveries from a bulk pricing request