Estimated Time of Arrival

Get the estimated time of arrival of the driver for an existing trip.

Use this endpoint after searching for a trip by tripId. The pickup or destination point you send depends on where the driver is in the trip.

EndpointPOST
Path/api/Trips/eta
Test base URLhttps://hub-sandbox-api.truxx.ae
Live base URLhttps://hub-api.truxx.ae
Authenticationx-api-key required

How to use it

Step 1 Search for the trip first by tripId using GET /api/Trips, then read DriverLat, DriverLng, and StatusCode from the response.
When the driver is heading to pickup If the trip status code is 2 (Your driver is on the way), send fromLat and fromLng from DriverLat and DriverLng. Send toLat and toLng from the trip pickup coordinates fromLat and fromLng.
When the trip is already in progress If the trip status code is 5 (TRUXXing Now ;)), send fromLat and fromLng from DriverLat and DriverLng. Send toLat and toLng from the trip destination coordinates toLat and toLng.
Important Call this endpoint only when the search trips response already includes driver coordinates.

Request example

Send the current driver location as the starting point and the next relevant trip point as the destination.

curl --location 'https://hub-sandbox-api.truxx.ae/api/Trips/eta' \
--header 'Content-Type: application/json' \
--header 'x-api-key: truxx_sk_test_6d0f0e50dc9a428ba54d65d7754b4aec' \
--data '{
    "fromLat": 24.4667,
    "fromLng": 54.3667,
    "toLat": 25.2048,
    "toLng": 55.2708
}'

Request fields

fromLatRequired. Current driver latitude from the trip DriverLat.
fromLngRequired. Current driver longitude from the trip DriverLng.
toLatRequired. Use the trip pickup latitude when status is 2, or the destination latitude when status is 5.
toLngRequired. Use the trip pickup longitude when status is 2, or the destination longitude when status is 5.

Response example

A successful response returns ETA duration, route distance, resolved addresses, and the route provider label.

{
  "success": true,
  "code": 200,
  "message": "OK",
  "data": {
    "distanceKm": 141.33,
    "durationMinutes": 90.7,
    "fromAddress": "Hazza Bin Zayed St / SKMC - F988+MMP - المنهل - غرب 14 2 - أبو ظبي - United Arab Emirates",
    "fromAreaName": "غرب 14 2",
    "toAddress": "673C+W8M Alsaillkabeer Saudi Arabia - Al Wasl - Dubai - United Arab Emirates",
    "toAreaName": "Al Wasl",
    "poweredBy": "TRUXX"
  }
}

Response fields

  • distanceKm: Route distance in kilometers
  • durationMinutes: Estimated time of arrival in minutes
  • fromAddress and toAddress: Resolved route addresses
  • fromAreaName and toAreaName: Area labels for the route endpoints
  • poweredBy: Route provider label returned by TRUXX