Drive time (ETA)
Use POST /etas and POST /etas/multi-leg when you need driving distance and duration for maps or customer ETAs. These endpoints use Lynq’s self-hosted OSRM routing. They do not return a price or quote_id, are not stored, and are not counted against quote rate limits.
For checkout pricing, use Quotes instead.
Single leg
POST /etas
Required: pickup and dropoff with lat and lng. Optional address on each point is for your logs only (not used for routing).
Request body
{
"pickup": {"lat": 24.7136, "lng": 46.6753, "address": "RRRD2929"},
"dropoff": {"lat": 24.768, "lng": 46.709, "address": "RRRR1234"}
}
Multi-leg
POST /etas/multi-leg
Same shape as multi-leg quotes: pickups (1–10) plus one dropoff. Only lat and lng are required on each stop; add short_address and contact fields when you have them. Pickups may be reordered by OSRM for the shortest driving route; the response includes ordered_stops.
Request body
{
"pickups": [
{"lat": 24.7136, "lng": 46.6753, "short_address": "RRRD2929"},
{"lat": 24.725, "lng": 46.68, "short_address": "RRRR5678"}
],
"dropoff": {
"lat": 24.768,
"lng": 46.709,
"short_address": "RRRR1234",
"contact_name": "Customer",
"contact_phone": "+966501234567"
}
}
Response
Both endpoints return the same JSON shape.
Example body
{
"distance_km": 8.4,
"duration_minutes": 18.2,
"provider": "osrm",
"legs": [
{
"from_sequence": 1,
"to_sequence": 2,
"distance_km": 8.4,
"duration_minutes": 18.2
}
],
"ordered_stops": [
{"sequence": 1, "stop_type": "pickup", "lat": 24.7136, "lng": 46.6753},
{"sequence": 2, "stop_type": "dropoff", "lat": 24.768, "lng": 46.709}
]
}
| Field | Meaning |
|---|---|
distance_km | Total driving distance (OSRM) |
duration_minutes | Total driving time (OSRM) |
provider | Always osrm |
legs | Per-segment distance and duration between consecutive stops |
ordered_stops | Visit order (pickups then dropoff) |
Errors
| Status | When |
|---|---|
503 | OSRM routing unavailable (eta_unavailable) — retry with backoff |
422 | Invalid coordinates or payload |
401 / 403 | Auth or IP allowlist failure |
Related
- Quotes — priced quotes and
quote_idbinding - Multi-leg
- Rate limits — apply to quotes only