Reimburse miles traveled

Product Used: Post Trip Route API

Using NextBillion.ai’s Post Trip Route API you can trace the actual route taken by your agents. The Post Trip 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.

Post Trip Route API request

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

Post Trip Route 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 Post Trip Route API documentation to know more about the available features.

© 2024 NextBillion.ai all rights reserved.