RouteXL Tour API is not returning the optimized route

I want to hire the RouteXL API, but rather, I’m trying to make some tests with the free plan and I’m not succeeding. I tried to optimize different routes to the TOUR API, however, all results are returned in the same order as the parameters sent. Why is this happening? (Optimized using the Route XL website and the result was totally different) There is something wrong with my request? - My request: URL: https://api.routexl.nl/tour Type: POST Params: locations:[{“address”:“Rua Inglaterra Itapira”,“lat”:"-22.436335",“lng”:"-46.810605"},{“address”:“São Paulo SP”,“lat”:"-23.550520",“lng”:"-46.633309"},{“address”:“Mogi mirim sp”,“lat”:"-22.432364",“lng”:"-46.950960"},{“address”:“Avenida siqueira campos itapira”,“lat”:"-22.434961",“lng”:"-46.827550"},{“address”:“rua japao itapira”,“lat”:"-22.435345",“lng”:"-46.809699"},{“address”:“paraná”,“lat”:"-25.252089",“lng”:"-52.021542"},{“address”:“rio de janeiro”,“lat”:"-22.906847",“lng”:"-43.172896"}] skipOptimisation:false roundtrip:true - Request result (the same order): { “id”: “5N13q6PF”, “count”: 7, “feasible”: true, “route”: { “0”: { “name”: “Rua Inglaterra Itapira”, “arrival”: 0, “distance”: 0 }, “1”: { “name”: “São Paulo SP”, “arrival”: 111, “distance”: 170.6 }, “2”: { “name”: “Mogi mirim sp”, “arrival”: 211, “distance”: 325.6 }, “3”: { “name”: “Avenida siqueira campos itapira”, “arrival”: 227, “distance”: 343 }, “4”: { “name”: “rua japao itapira”, “arrival”: 232, “distance”: 346.4 }, “5”: { “name”: “paraná”, “arrival”: 868, “distance”: 1155.6 }, “6”: { “name”: “rio de janeiro”, “arrival”: 1722, “distance”: 2333 } } } - Correct result (optimized by Route XL website / no api): 01 - Rua Inglaterra Itapira 02 - Avenida siqueira campos itapira 03 - Rio de Janeiro 04 - São Paulo 05 - Paraná 06 - Mogi Mirim 07 - Rua Japão 08 - Rua Inglaterra Why is this happening? Am I doing something wrong?

The API requires the arrival location to be added to the list of addresses. The first element is used as departure, the last as final arrival. If you need to start and finish at the same location, you’ll need to add it twice in the array.

You probably need to double check the input. Here is the result we get:

{"id":"nzXgN7ej","count":8,"feasible":true,"route":{"0":{"name":"Rua Inglaterra Itapira","arrival":0,"distance":0},"1":{"name":"Avenida siqueira campos itapira","arrival":4,"distance":3.3},"2":{"name":"rio de janeiro","arrival":368,"distance":558.6},"3":{"name":"S\u00e3o Paulo SP","arrival":657,"distance":989.6},"4":{"name":"paran\u00e1","arrival":1207,"distance":1725.5},"5":{"name":"Mogi mirim sp","arrival":1832,"distance":2520.6},"6":{"name":"rua japao itapira","arrival":1850,"distance":2540.1},"7":{"name":"Rua Inglaterra Itapira","arrival":1851,"distance":2540.3}}}

An example with cURL:

https://www.routexl.nl/blog/api/#example

JavaScript and PHP code at:

https://github.com/routexl/RouteXL-API-Connector

Could you give me a simple example?

The place of departure and place of arrival are the same (Rua Inglaterra) and they are now added in the ‘locations’ array.
Still I do not understand what could be wrong.
I just need to understand that to buy the API. I will use it monthly.

Perfect! Thanks!