# Multiple rounds request

**URL:** <https://support.routexl.com/t/multiple-rounds-request/507>\
**Category:** API\
**Created:** [January 30, 2018, 1:14pm UTC](https://support.routexl.com/t/multiple-rounds-request/507 "2018-01-30T13:14:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![amartin3g](https://support.routexl.com/letter_avatar_proxy/v4/letter/a/a6a055/32.png) [@amartin3g](https://support.routexl.com/u/amartin3g)\
**Post date:** [January 30, 2018, 1:14pm UTC](https://support.routexl.com/t/multiple-rounds-request/507/1 "2018-01-30T13:14:28Z")

</div>

Hi, we’re testing the API v2 using Postman application. Following the API reference we add the tour parameters as JSON array, but the API returns only one route. You can see in the attached image our POST configuration with form-data and the response.

![33](https://support.routexl.com/uploads/default/original/1X/52d29d0bea6acc65bff571435f4d177791aca70c.png)

Could you help us with this??

Thanks.

---

<div class="post-metadata">

**Author:** ![RouteXL](https://support.routexl.com/user_avatar/support.routexl.com/routexl/32/347_2.png) [@RouteXL](https://support.routexl.com/u/RouteXL)\
**Post date:** [January 30, 2018, 1:32pm UTC](https://support.routexl.com/t/multiple-rounds-request/507/2 "2018-01-30T13:32:44Z")

</div>

In the API/v2 the parameters array should not be JSON encoded.

The locations array may be JSON encoded for backward compatibility, but it’s not required.

---

<div class="post-metadata">

**Author:** ![nuvolablu](https://support.routexl.com/letter_avatar_proxy/v4/letter/n/59ef9b/32.png) [@nuvolablu](https://support.routexl.com/u/nuvolablu)\
**Post date:** [February 13, 2018, 4:05pm UTC](https://support.routexl.com/t/multiple-rounds-request/507/3 "2018-02-13T16:05:49Z")

</div>

Hi could you give a working example how the rounds should be used? I think i tried every markup, but nothing seems to work? I am trying in Postman also… should the parameters be send as key (formfield) parameters?

Thanks!

---

<div class="post-metadata">

**Author:** ![RouteXL](https://support.routexl.com/user_avatar/support.routexl.com/routexl/32/347_2.png) [@RouteXL](https://support.routexl.com/u/RouteXL)\
**Post date:** [February 14, 2018, 9:42am UTC](https://support.routexl.com/t/multiple-rounds-request/507/4 "2018-02-14T09:42:39Z")

</div>

Here’s an example in Postman:

![RouteXL API v2 parameter rounds](https://support.routexl.com/uploads/default/original/1X/ebb826424b8f0275a9c4261dc9bf36986478cc8b.png)

---

<div class="post-metadata">

**Author:** ![nuvolablu](https://support.routexl.com/letter_avatar_proxy/v4/letter/n/59ef9b/32.png) [@nuvolablu](https://support.routexl.com/u/nuvolablu)\
**Post date:** [February 14, 2018, 11:40am UTC](https://support.routexl.com/t/multiple-rounds-request/507/5 "2018-02-14T11:40:03Z")

</div>

Thanks… and how can you tell each round to start and end at a certain location, like in the webversion?

And furthermore, how can you tell from the json which is which route?! It looks like it is just one route.

routxlapi-2|690x345 ![routxlapi-1](https://support.routexl.com/uploads/default/original/1X/128bcb36cd69b9dbda10d0d979362f35931bccda.PNG)

---

<div class="post-metadata">

**Author:** ![RouteXL](https://support.routexl.com/user_avatar/support.routexl.com/routexl/32/347_2.png) [@RouteXL](https://support.routexl.com/u/RouteXL)\
**Post date:** [February 14, 2018, 2:17pm UTC](https://support.routexl.com/t/multiple-rounds-request/507/6 "2018-02-14T14:17:15Z")

</div>

The API is very simple, it only creates rounds within one route. Each round will have the same departure, which is the first location. The route will end at the last location.

---

<div class="post-metadata">

**Author:** ![brunogayet](https://support.routexl.com/letter_avatar_proxy/v4/letter/b/13edae/32.png) [@brunogayet](https://support.routexl.com/u/brunogayet)\
**Post date:** [June 22, 2018, 6:21pm UTC](https://support.routexl.com/t/multiple-rounds-request/507/7 "2018-06-22T18:21:25Z")

</div>

Hi, I’m having difficulty returning rounds or any other parameter. I’m programming in Javascript and sending the parameters in Json (dataType), as in the image below.

![routeXl2](https://support.routexl.com/uploads/default/original/1X/04a659b1af5ed1d748795febf990e36a9a954fd0.png)

Return is ignoring all the parameters passed.

How to return the route rounds? Change vehicle type …

Could you help me?

Thanks!

---

<div class="post-metadata">

**Author:** ![RouteXL](https://support.routexl.com/user_avatar/support.routexl.com/routexl/32/347_2.png) [@RouteXL](https://support.routexl.com/u/RouteXL)\
**Post date:** [June 23, 2018, 7:41am UTC](https://support.routexl.com/t/multiple-rounds-request/507/8 "2018-06-23T07:41:13Z")

</div>

Not tested and it all seems fine, but it may be the brackets around the parameters value. Can you give it a try without them? The parameters may now be interpreted as an object within an array. Not sure how that is handled…

---

<div class="post-metadata">

**Author:** ![brunogayet](https://support.routexl.com/letter_avatar_proxy/v4/letter/b/13edae/32.png) [@brunogayet](https://support.routexl.com/u/brunogayet)\
**Post date:** [June 23, 2018, 1:16pm UTC](https://support.routexl.com/t/multiple-rounds-request/507/9 "2018-06-23T13:16:12Z")

</div>

It worked! Thanks for your help.

---

<div class="post-metadata">

**Author:** ![paul](https://support.routexl.com/letter_avatar_proxy/v4/letter/p/bbe5ce/32.png) [@paul](https://support.routexl.com/u/paul)\
**Post date:** [June 29, 2020, 7:55pm UTC](https://support.routexl.com/t/multiple-rounds-request/507/10 "2020-06-29T19:55:10Z")

</div>

Example for Google Scripts:

// Set options  
const options = {  
‘headers’ : headers,  
‘method’ : ‘post’,  
‘contentType’: ‘application/x-www-form-urlencoded’,  
‘muteHttpExceptions’ : true

};

options.payload = {locations:JSON.stringify(locations),“parameters[rounds]”: rounds};

---

<div class="post-metadata">

**Author:** ![deschouwwitgoed](https://support.routexl.com/letter_avatar_proxy/v4/letter/d/47e85d/32.png) [@deschouwwitgoed](https://support.routexl.com/u/deschouwwitgoed)\
**Post date:** [June 2, 2021, 12:43pm UTC](https://support.routexl.com/t/multiple-rounds-request/507/12 "2021-06-02T12:43:33Z")

</div>

I have the same problem in python. This code gives only one route, in stead of two. I have tried multiple option (the parameters array in a list or in single or double quotes, and combinations) but it kept giving me one route. How can I fix this?

 ![347f4e2e0c3646b58aa89912db023dda](https://support.routexl.com/uploads/default/original/1X/3e51f7ba7aea219275d545c05f230f6718141ce0.png)

 ![](https://i.gyazo.com/b10f9373705d3812045efbbdc087c340.png)

---

<div class="post-metadata">

**Author:** ![RouteXL](https://support.routexl.com/user_avatar/support.routexl.com/routexl/32/347_2.png) [@RouteXL](https://support.routexl.com/u/RouteXL)\
**Post date:** [June 2, 2021, 12:59pm UTC](https://support.routexl.com/t/multiple-rounds-request/507/13 "2021-06-02T12:59:23Z")

</div>

Not an expert in Python, but `parameters` should not be JSON encoded, it’s expected to be an array. Only the _value_ of `locations` is expected to be JSON. So we’d try with something like:

`parameters[rounds] = 2`

---

<div class="post-metadata">

**Author:** ![deschouwwitgoed](https://support.routexl.com/letter_avatar_proxy/v4/letter/d/47e85d/32.png) [@deschouwwitgoed](https://support.routexl.com/u/deschouwwitgoed)\
**Post date:** [June 2, 2021, 1:58pm UTC](https://support.routexl.com/t/multiple-rounds-request/507/14 "2021-06-02T13:58:07Z")

</div>

Thanks for your reply. Still not working :\ Can you give me an example in this format? :

`locations=[{"address":"The Hague, The Netherlands","lat":"52.05429","lng":"4.248618"},{"address":"The Hague, The Netherlands","lat":"52.076892","lng":"4.26975"},{"address":"Uden, The Netherlands","lat":"51.669946","lng":"5.61852"},{"address":"Sint-Oedenrode, The Netherlands","lat":"51.589548","lng":"5.432482"}]`

but than with `parameters=` in stead of `locations=`?

---

<div class="post-metadata">

**Author:** ![RouteXL](https://support.routexl.com/user_avatar/support.routexl.com/routexl/32/347_2.png) [@RouteXL](https://support.routexl.com/u/RouteXL)\
**Post date:** [June 2, 2021, 6:14pm UTC](https://support.routexl.com/t/multiple-rounds-request/507/15 "2021-06-02T18:14:27Z")

</div>

We’ve installed Python, copied your code and played around with it. We seem to get correct results with this input:

`data={'locations':'[{"address":"The Hague, The Netherlands","lat":"52.05429","lng":"4.248618"},{"address":"The Hague, The Netherlands","lat":"52.076892","lng":"4.26975"},{"address":"Uden, The Netherlands","lat":"51.669946","lng":"5.61852"},{"address":"Sint-Oedenrode, The Netherlands","lat":"51.589548","lng":"5.432482"}]', 'parameters[rounds]':2}`

---

<div class="post-metadata">

**Author:** ![deschouwwitgoed](https://support.routexl.com/letter_avatar_proxy/v4/letter/d/47e85d/32.png) [@deschouwwitgoed](https://support.routexl.com/u/deschouwwitgoed)\
**Post date:** [June 3, 2021, 9:08am UTC](https://support.routexl.com/t/multiple-rounds-request/507/16 "2021-06-03T09:08:28Z")

</div>

Thanks, it works!! Must say I’m impessed by your level of customer care! Two last question about the multiple rounds:

- I get confusing results when I use different locations as start and finish; not every route has the right start and the right finish. How to fix this?

And my last question:

- is it possible with multiple routes to have them all start at the same location, but have a different finish for only one route?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![RouteXL](https://support.routexl.com/user_avatar/support.routexl.com/routexl/32/347_2.png) [@RouteXL](https://support.routexl.com/u/RouteXL)\
**Post date:** [June 3, 2021, 2:39pm UTC](https://support.routexl.com/t/multiple-rounds-request/507/17 "2021-06-03T14:39:59Z")

</div>

On your first question, our [multiple rounds](https://docs.routexl.com/index.php/Multiple_rounds) feature always returns to the first location and ends at the last location of your input.

There is no fix, but a non-optimal workaround is to take the locations of each round separately and create a new route for that with the right start and finish.

On your second question, all rounds always start from the same first location. The final round will end at the final location.

So, if your input has location A, B, C, and so on to location Z, the multiple rounds feature will always create one route with multiple returns to A, ending in Z:

`A - - - - A - - - - A - - - - A - - - - Z`

=================

_Edit: as mentioned in a later post below, the described result is as the website would act. The API will act differently, returning:_

`A - - - - A - - - - A - - - - A`

_with Z somewhere in the route as a regular stop._

---

<div class="post-metadata">

**Author:** ![deschouwwitgoed](https://support.routexl.com/letter_avatar_proxy/v4/letter/d/47e85d/32.png) [@deschouwwitgoed](https://support.routexl.com/u/deschouwwitgoed)\
**Post date:** [August 4, 2021, 10:19am UTC](https://support.routexl.com/t/multiple-rounds-request/507/18 "2021-08-04T10:19:19Z")

</div>

Thank you for your response, but what you say here:

> [@RouteXL](#):
>
> So, if your input has location A, B, C, and so on to location Z, the multiple rounds feature will always create one route with multiple returns to A, ending in Z:
> 
> `A - - - - A - - - - A - - - - A - - - - Z`

seems not right. With the following input:

```
[{"address": "MAGAZIJN", "lat": "52.301153", "lng": "5.239027"}, 
{"address": "12344777", "lat": "52.292895", "lng": "5.240746666666666"}, 
{"address": "12345075", "lat": "52.24288333333333", "lng": "4.810811666666667"}, 
{"address": "12345160", "lat": "51.956581666666665", "lng": "4.963391666666666"}, 
{"address": "12345390", "lat": "52.939935", "lng": "4.735586666666666"}, 
{"address": "12345490", "lat": "52.29616166666667", "lng": "5.160463333333333"}, 
{"address": "12345522", "lat": "52.17655333333333", "lng": "5.6009166666666665"}, 
{"address": "12345530", "lat": "52.661183333333334", "lng": "6.7367799999999995"}, 
{"address": "12345532", "lat": "52.05883333333333", "lng": "4.347488333333334"}, 
{"address": "12345544", "lat": "52.35351333333333", "lng": "4.854746666666666"}, 
{"address": "12345550", "lat": "52.78319", "lng": "6.102668333333333"}, 
{"address": "12345557", "lat": "52.01390166666667", "lng": "4.3495083333333335"}, 
{"address": "12345559", "lat": "52.350053333333335", "lng": "6.671786666666667"}, 
{"address": "12345568", "lat": "52.152816666666666", "lng": "4.7691333333333334"}, 
{"address": "12345571", "lat": "52.34079", "lng": "4.788871666666667"}, 
{"address": "12345578", "lat": "52.351416666666665", "lng": "5.155856666666667"}, 
{"address": "12345591", "lat": "52.19592333333333", "lng": "6.636681666666666"}, 
{"address": "12345592", "lat": "51.92289666666667", "lng": "4.50205"}, 
{"address": "12345595", "lat": "52.28866333333333", "lng": "5.160481666666667"}, 
{"address": "12345596", "lat": "52.15743", "lng": "4.783493333333333"}, 
{"address": "12345601", "lat": "52.677773333333334", "lng": "4.699188333333334"}, 
{"address": "32123", "lat": "52.29749666666667", "lng": "5.2689433333333335"}, 
{"address": "DELFT", "lat": "51.998893", "lng": "4.357264"}]

```

and

```
"parameters[rounds]" : "3", "parameters[balance]":"50"

```

i get the following output, which should go

```
MAGAZIJN - - - - - MAGAZIJN - - - - MAGAZIJN - - - - - DELFT

```

which is what I want. But it is as follows:

```
{'name': 'MAGAZIJN', 'lat': '52.301153', 'lng': '5.239027', 'arrival': 0, 'distance': 0}
{'name': '12345522', 'lat': '52.17655333333333', 'lng': '5.6009166666666665', 'arrival': 29, 'distance': 38.8}
{'name': '12345591', 'lat': '52.19592333333333', 'lng': '6.636681666666666', 'arrival': 90, 'distance': 123.7}
{'name': '12345559', 'lat': '52.350053333333335', 'lng': '6.671786666666667', 'arrival': 112, 'distance': 145.4}
{'name': '12345530', 'lat': '52.661183333333334', 'lng': '6.7367799999999995', 'arrival': 145, 'distance': 190.8}
{'name': '12345550', 'lat': '52.78319', 'lng': '6.102668333333333', 'arrival': 193, 'distance': 253.3}
{'name': 'MAGAZIJN', 'lat': '52.301153', 'lng': '5.239027', 'arrival': 270, 'distance': 355.4}
{'name': '12345390', 'lat': '52.939935', 'lng': '4.735586666666666', 'arrival': 89, 'distance': 472.1}
{'name': '12345601', 'lat': '52.677773333333334', 'lng': '4.699188333333334', 'arrival': 126, 'distance': 509.5}
{'name': '12345571', 'lat': '52.34079', 'lng': '4.788871666666667', 'arrival': 164, 'distance': 556.5}
{'name': '12345544', 'lat': '52.35351333333333', 'lng': '4.854746666666666', 'arrival': 172, 'distance': 562.6}
{'name': '12345490', 'lat': '52.29616166666667', 'lng': '5.160463333333333', 'arrival': 193, 'distance': 588.5}
{'name': '12345595', 'lat': '52.28866333333333', 'lng': '5.160481666666667', 'arrival': 195, 'distance': 589.6}
{'name': '12344777', 'lat': '52.292895', 'lng': '5.240746666666666', 'arrival': 203, 'distance': 596.1}
{'name': 'MAGAZIJN', 'lat': '52.301153', 'lng': '5.239027', 'arrival': 205, 'distance': 597.3}
{'name': '12345578', 'lat': '52.351416666666665', 'lng': '5.155856666666667', 'arrival': 19, 'distance': 617.7}
{'name': '12345075', 'lat': '52.24288333333333', 'lng': '4.810811666666667', 'arrival': 51, 'distance': 653.9}
{'name': '12345596', 'lat': '52.15743', 'lng': '4.783493333333333', 'arrival': 66, 'distance': 666.9}
{'name': '12345568', 'lat': '52.152816666666666', 'lng': '4.7691333333333334', 'arrival': 68, 'distance': 668.7}
{'name': '12345532', 'lat': '52.05883333333333', 'lng': '4.347488333333334', 'arrival': 98, 'distance': 706.8}
{'name': '12345557', 'lat': '52.01390166666667', 'lng': '4.3495083333333335', 'arrival': 106, 'distance': 713.6}
{'name': 'DELFT', 'lat': '51.998893', 'lng': '4.357264', 'arrival': 110, 'distance': 715.9}
{'name': '12345592', 'lat': '51.92289666666667', 'lng': '4.50205', 'arrival': 128, 'distance': 733.4}
{'name': '12345160', 'lat': '51.956581666666665', 'lng': '4.963391666666666', 'arrival': 168, 'distance': 778.8}
{'name': '32123', 'lat': '52.29749666666667', 'lng': '5.2689433333333335', 'arrival': 212, 'distance': 834.3}
{'name': 'MAGAZIJN', 'lat': '52.301153', 'lng': '5.239027', 'arrival': 216, 'distance': 837.2}

```

How is this possible, and more important: how to fix this?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![RouteXL](https://support.routexl.com/user_avatar/support.routexl.com/routexl/32/347_2.png) [@RouteXL](https://support.routexl.com/u/RouteXL)\
**Post date:** [August 4, 2021, 11:05am UTC](https://support.routexl.com/t/multiple-rounds-request/507/19 "2021-08-04T11:05:59Z")

</div>

You’re right, what we said is how the website will respond. The API will respond differently as you describe, adding the first location to the end of the array and then fix the last location of the resulting array as finish.

As to a fix, we have none at this moment. Our apologies.

---

<div class="post-metadata">

**Author:** ![isaacyeos](https://support.routexl.com/letter_avatar_proxy/v4/letter/i/dec6dc/32.png) [@isaacyeos](https://support.routexl.com/u/isaacyeos)\
**Post date:** [August 17, 2021, 7:02am UTC](https://support.routexl.com/t/multiple-rounds-request/507/20 "2021-08-17T07:02:48Z")

</div>

Hi there,

Is is possible to use RouteXL to solve the following delivery route problem?  
I have 3 drivers starting from the same location. I have 10 other locations to deliver to. I want the 10 locations to be split among the 3 drivers in the most optimized manner. I don’t wish to input destinations as the drivers can proceed to any destination after completing their deliveries.

---

<div class="post-metadata">

**Author:** ![RouteXL](https://support.routexl.com/user_avatar/support.routexl.com/routexl/32/347_2.png) [@RouteXL](https://support.routexl.com/u/RouteXL)\
**Post date:** [August 17, 2021, 7:33am UTC](https://support.routexl.com/t/multiple-rounds-request/507/21 "2021-08-17T07:33:29Z")

</div>

Our API can create multiple rounds, but will always arrive at the departure location, as described in this discussion. There is no “open-end” feature.

The non-optimal workaround is to create the route with rounds, use each round as input for each driver, select the farthest location based on coordinates, and make that the last location in the input so it will act as final destination, and create a new route from that.

[Next page](https://support.routexl.com/t/multiple-rounds-request/507.md?page=2)
