Skip to main content

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

POST /api/pricing/single

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
destination
object
required
Destination location coordinates

Response

Success response

status
boolean
Always true for successful requests
data
object

Examples

curl -X POST https://api.chidori.africa/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
    }
  }'
{
  "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

StatusMessageDescription
400Location out of boundsPickup or destination is outside the supported service area
401UnauthorizedInvalid or missing API key
403ForbiddenAPI 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