Reimburse miles traveled

Product Used: Route Reconstruction API

Using NextBillion.ai’s Route Reconstruction API you can trace the actual route taken by your agents. The Route Reconstruction API will take into account a list of locations tracked while the agent was out completing the jobs and returns, the total distance of the trip along with the geometry of the route taken.

This information is quite helpful in tackling business cases needing to track the miles covered for fuel reimbursement or even post-service quality assessments.

Following is a sample request with

  • list of tracked location coordinates provided as input for “waypoints”.
  • “mode” option set to “car”
  • “geometry” parameter is set to “polyline6” to indicate the format in which the path geometry is needed.

Route Reconstruction API request

1
curl --location 'https://api.nextbillion.io/route-reconstruction?key=<your_api_key>' --header 'Content-Type: application/json' --data ' {....}'

Route Reconstruction API response

On successfully submitting the above request the service responds with total distance covered by the agent along with the geometry of the route taken.

1
{
2
"status": "Ok",
3
"route": {
4
"geometry": "...",
5
"distance": 5277.3
6
}
7
}

Visit Route Reconstruction API documentation to know more about the available features.

© 2025 NextBillion.ai all rights reserved.