# Merge Routes

Last updated:

<!-- -->

October 18, 2026

<!-- -->

\| 16 minutes read

<br />

<br />

This example demonstrates how to merge multiple routes into a single route. A new optimization will be created for the merged route, inheriting the configuration parameters, vehicle constraints, and other settings from the first route in the list. The merged route will **not** be optimized automatically.

Note

After merging routes, reoptimize the new route using [Reoptimize Optimization](/docs/cloud-rest-api/guides/fleet-management/core-concepts/optimization.md#8-reoptimize-an--optimization) to improve efficiency. Verify that vehicle constraints (capacity, distance limits) remain suitable for the combined load, and check that order time windows are preserved in the merged schedule.

## How to Use the Sample[​](#how-to-use-the-sample "Direct link to How to Use the Sample")

When you run the example application:

1. The selected routes are merged into a single route.
2. A new optimization is created for the merged route.
3. The merged route is returned without reoptimization.

## Step-by-Step Guide[​](#step-by-step-guide "Direct link to Step-by-Step Guide")

### Step 1: Retrieve the Routes to Be Merged[​](#step-1-retrieve-the-routes-to-be-merged "Direct link to Step 1: Retrieve the Routes to Be Merged")

Prepare the IDs of the routes to be merged, and then follow the next steps to call the merge route request.

* **Method:** `POST`

* **Endpoint:** `/routes/merge`

* **Headers:**

  * `Authorization: YOUR_API_KEY`
  * `Content-Type: application/json`

* **URL:** `https://api.magiclane.net/api/v1/fleetmanagement/routes/merge`

* **Query Parameter:**

  * `encodeShape` (integer, *optional*)

    <!-- -->

    * 0: The route's shape will not be encoded.
    * 1:(default) - The route's shape will be encoded.

Warning

Routes with matrices build type set to `EMatrixBuildType::MBT_Set`, cannot be merged.

#### Example:[​](#example "Direct link to Example:")

* **Request Body:**

```json
{
  [250995, 250996]
}

```

* **Response Body:** (error code `200`)

```json
{
  "configurationParameters": {
    "orderSequenceOptions": [],
    "distanceUnit": 0,
    "maxTimeToOptimize": 300,
    "optimizationQuality": 2,
    "routeType": 0,
    "arrangeCriterion": 0,
    "restrictions": 0,
    "maxWaitTime": 0,
    "balancedRoutes": 0,
    "groupingOrders": false,
    "optimizationCriterion": 1,
    "allowDroppingOrders": false,
    "ignoreTimeWindow": true,
    "name": "Merge routes 250996  250995  - Part 0"
  },
  "vehicleConstraints": {
    "startDate": 1742860800000,
    "maxNumberOfPackages": 53,
    "minNumberOfOrders": 0,
    "maxNumberOfOrders": 99999999,
    "minDistance": 0,
    "maxDistance": 100000000,
    "maxRevenue": 85,
    "fuelPrice": 1.0700000524520874
  },
  "rideStatus": 1,
  "vehicle": {
    "length": 0,
    "weight": 0,
    "width": 0,
    "licensePlate": "",
    "consumption": 6.5,
    "fuelType": 2,
    "make": "",
    "id": 135027,
    "name": "Car vehicle",
    "model": "",
    "costPerHour": 20,
    "type": 0,
    "status": 0,
    "maxLoadWeight": 60,
    "height": 0,
    "maxLoadCube": 50,
    "idDriver": 135027,
    "endTime": 1439,
    "fixedCost": 150.5,
    "startTime": 727,
    "lastPosition": [
      2147483647,
      2147483647
    ]
  },
  "destination": {
    "depotId": 0,
    "alias": "departure2",
    "address": {
      "streetNumber": "34",
      "postalCode": "86000",
      "streetName": "Boulevard Chasseigne",
      "county": "Nouvelle-Aquitaine",
      "state": "",
      "extra": "",
      "city": "Poitiers",
      "country": "France"
    },
    "location": [
      48.826295,
      2.343264
    ],
    "matchedLocation": [
      48.82623,
      2.343238125
    ],
    "arrivalTime": 1742948951000,
    "traveledDistance": 90.75505065917969
  },
  "departure": {
    "depotId": 0,
    "alias": "departure2",
    "address": {
      "streetNumber": "34",
      "postalCode": "86000",
      "streetName": "Boulevard Chasseigne",
      "county": "Nouvelle-Aquitaine",
      "state": "",
      "extra": "",
      "city": "Poitiers",
      "country": "France"
    },
    "location": [
      48.826295,
      2.343264
    ],
    "matchedLocation": [
      48.82623,
      2.343238125
    ],
    "numberOfpackages": 34,
    "weight": 49.20000076293945,
    "cube": 21.600000381469727,
    "departureTime": 1742927130605,
    "timeToNext": 413,
    "distanceToNext": 2.7538180351257324
  },
  "shape": "{j_iHgthMt@sJBq@t@_J@g@[aQkAyi@ByLAkCC_A_@qFiGs|@^w@M[@O`ByMoBmNmAiE{AyEdGwFlDkD`@WlAwCFc@HWaBsGs@gC}B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@b@vCnBT`@Jb@BdAGxBFrADxF_@bAHpMpe@rCBd@Pf@XV\\@At@H~Df@@NFf@t@pTv^d@hApQjZXZv@AfEc@lHcA~@Id@\\NIdHnLbFhI`ElFvB`CPxMo@rBhEhDbC|HpBzGeGhPdCxB_GpPwQcOsAqAwLwJuOyMqCsBu@a@uJrJo@bAeJbJGFUC}AuBkAoBY[w@q@_AqA}CuD{ImLuGgJa@cAg@}AmCoMuBqP{AeSWmCEkAIaNI_BAkAo@{`AH{CJkAZyBbAsEMGUCgBRICiEuCm@o@Qk@s@cAWSmNiJFe@Gy@u@aHIGkAyMeC}VrA_@QaBFWnGkl@fPrH\\{BFEP@bKpEhAcIwDcBw@c@b@oAiDwIpKos@sFgCmHiDOMkRyI~A}K|@mLd@wFd@uGf@qFgB_CSKYu@yAsE{BgJzEkDCU[}AFYK_@^g@Dg@bAePl@wH@}BQ{A{@eGcAqFsAsFuAuDwDzC~@tEGBuDk@kCg@`EgEtDmFlE}FrCiEz@hC{@iCdEgGlCsAbGaHfBbIlAg@B@FFlAxCPJyO|wANLnAfImClF\\f@FZm@xAiA~BcAjB}AbDgB_CSKeB~Aa@f@g[jXxAn@dX~MBVVPPHuArJe@zD}BzPeArIeDd^sArOMb@C`@fLhENeB[{E{@wKNEBLHL~GbCTBjAsIhOmjA~@BzKbFnKrErAp@XDjExBbL~EG`@z@vIO|@fCfAxTrK`@XzHvD`[hNTBp@eF~AkArB`ALFDAfAiA`BuAzAuAbHuHfCuBXDZoAZHfF|KNXvw@xIzCv@z@\\nD`B`Ah@Vl@D\\IxFzAOlAIfHJJi@FmA\\qE",
  "creationTimestamp": 1742904432224,
  "neededFuel": 5.899078369140625,
  "matrixBuildType": 1,
  "price": 276.81201171875,
  "totalWaitTime": 0,
  "totalServiceTime": 8960,
  "optimizationId": 137369,
  "orders": [
    {
      "orderInfo": {
        "revenue": 14.699999809265137,
        "serviceTime": 750,
        "timeWindow": [
          1742924408081,
          1742944028081
        ],
        "creationTimestamp": 1742904432067,
        "cube": 4.599999904632568,
        "numberOfPackages": 11,
        "depotId": 0,
        "customData": "",
        "weight": 12.100000381469727,
        "phoneNumber": "+12025550181",
        "lastName": "",
        "status": 1,
        "firstName": "",
        "alias": "",
        "state": 1,
        "type": 1,
        "priority": 0,
        "id": 878525,
        "location": [
          48.827865,
          2.379216
        ],
        "address": {
          "streetNumber": "",
          "postalCode": "",
          "streetName": "",
          "county": "",
          "state": "",
          "extra": "",
          "city": "",
          "country": ""
        },
        "customerInfo": {
          "phoneNumber": "+12025550181",
          "email": "c6@yahoo.com",
          "lastName": "",
          "firstName": "",
          "alias": "",
          "customData": "",
          "id": 1789281,
          "location": [
            48.827865,
            2.379216
          ],
          "address": {
            "streetNumber": "",
            "postalCode": "",
            "streetName": "",
            "county": "",
            "state": "",
            "extra": "",
            "city": "",
            "country": ""
          }
        }
      },
      "matchedLocation": [
        48.82792,
        2.3791415625
      ],
      "actualLocation": [
        0,
        0
      ],
      "indexInRoute": 0,
      "indexInOptimization": 0,
      "arrivalTime": 1742927544000,
      "timeToNextOrder": 535,
      "waitTime": 0,
      "numberOfPackagesAtArrival": 34,
      "collectedNumberOfPackages": 0,
      "deliveredNumberOfPackages": 11,
      "weightAtArrival": 49.20000076293945,
      "collectedWeight": 0,
      "deliveredWeight": 12.100000381469727,
      "cubeAtArrival": 21.600000381469727,
      "collectedCube": 0,
      "deliveredCube": 4.599999904632568,
      "traveledDistance": 2.7538180351257324,
      "distanceToNextOrder": 3.6211578845977783,
      "revenueAtArrival": 0,
      "visitTimestamp": 0
    },
    {
      "orderInfo": {
        "revenue": 2.700000047683716,
        "serviceTime": 200,
        "timeWindow": [
          1742924408081,
          1742941388081
        ],
        "creationTimestamp": 1742904432067,
        "cube": 5.800000190734863,
        "numberOfPackages": 8,
        "depotId": 0,
        "customData": "",
        "weight": 15.399999618530273,
        "phoneNumber": "+12025550181",
        "lastName": "",
        "status": 1,
        "firstName": "",
        "alias": "",
        "state": 1,
        "type": 1,
        "priority": 0,
        "id": 878526,
        "location": [
          48.845198,
          2.402896
        ],
        "address": {
          "streetNumber": "",
          "postalCode": "",
          "streetName": "",
          "county": "",
          "state": "",
          "extra": "",
          "city": "",
          "country": ""
        },
        "customerInfo": {
          "phoneNumber": "+12025550181",
          "email": "c2@yahoo.com",
          "lastName": "",
          "firstName": "",
          "alias": "",
          "customData": "",
          "id": 1789277,
          "location": [
            48.845198,
            2.402896
          ],
          "address": {
            "streetNumber": "",
            "postalCode": "",
            "streetName": "",
            "county": "",
            "state": "",
            "extra": "",
            "city": "",
            "country": ""
          }
        }
      },
      "matchedLocation": [
        48.8452625,
        2.4027009375
      ],
      "actualLocation": [
        0,
        0
      ],
      "indexInRoute": 1,
      "indexInOptimization": 1,
      "arrivalTime": 1742928829000,
      "timeToNextOrder": 855,
      "waitTime": 0,
      "numberOfPackagesAtArrival": 23,
      "collectedNumberOfPackages": 0,
      "deliveredNumberOfPackages": 8,
      "weightAtArrival": 37.099998474121094,
      "collectedWeight": 0,
      "deliveredWeight": 15.399999618530273,
      "cubeAtArrival": 17,
      "collectedCube": 0,
      "deliveredCube": 5.800000190734863,
      "traveledDistance": 6.37497615814209,
      "distanceToNextOrder": 9.219883918762207,
      "revenueAtArrival": 14.699999809265137,
      "visitTimestamp": 0
    },
    {
      "orderInfo": {
        "revenue": 10,
        "serviceTime": 900,
        "timeWindow": [
          1742926388081,
          1742942408081
        ],
        "creationTimestamp": 1742904432067,
        "cube": 9.699999809265137,
        "numberOfPackages": 9,
        "depotId": 0,
        "customData": "",
        "weight": 16.5,
        "phoneNumber": "+12025550181",
        "lastName": "",
        "status": 1,
        "firstName": "",
        "alias": "",
        "state": 1,
        "type": 1,
        "priority": 0,
        "id": 878527,
        "location": [
          48.90092,
          2.400039
        ],
        "address": {
          "streetNumber": "",
          "postalCode": "",
          "streetName": "",
          "county": "",
          "state": "",
          "extra": "",
          "city": "",
          "country": ""
        },
        "customerInfo": {
          "phoneNumber": "+12025550181",
          "email": "c4@yahoo.com",
          "lastName": "",
          "firstName": "",
          "alias": "",
          "customData": "",
          "id": 1789279,
          "location": [
            48.90092,
            2.400039
          ],
          "address": {
            "streetNumber": "",
            "postalCode": "",
            "streetName": "",
            "county": "",
            "state": "",
            "extra": "",
            "city": "",
            "country": ""
          }
        }
      },
      "matchedLocation": [
        48.9005959375,
        2.4000475
      ],
      "actualLocation": [
        0,
        0
      ],
      "indexInRoute": 2,
      "indexInOptimization": 2,
      "arrivalTime": 1742929884000,
      "timeToNextOrder": 971,
      "waitTime": 0,
      "numberOfPackagesAtArrival": 15,
      "collectedNumberOfPackages": 0,
      "deliveredNumberOfPackages": 9,
      "weightAtArrival": 21.69999885559082,
      "collectedWeight": 0,
      "deliveredWeight": 16.5,
      "cubeAtArrival": 11.199999809265137,
      "collectedCube": 0,
      "deliveredCube": 9.699999809265137,
      "traveledDistance": 15.594860076904297,
      "distanceToNextOrder": 9.614479064941406,
      "revenueAtArrival": 17.399999618530273,
      "visitTimestamp": 0
    },
    {
      "orderInfo": {
        "revenue": 0,
        "serviceTime": 360,
        "timeWindow": [
          1742897230179,
          1742922010179
        ],
        "creationTimestamp": 1742904432067,
        "cube": 0,
        "numberOfPackages": 4,
        "depotId": 0,
        "customData": "",
        "weight": 0,
        "phoneNumber": "+12025550181",
        "lastName": "",
        "status": 1,
        "firstName": "",
        "alias": "",
        "state": 1,
        "type": 0,
        "priority": 0,
        "id": 878528,
        "location": [
          48.88366,
          2.313722
        ],
        "address": {
          "streetNumber": "",
          "postalCode": "",
          "streetName": "",
          "county": "",
          "state": "",
          "extra": "",
          "city": "",
          "country": ""
        },
        "customerInfo": {
          "phoneNumber": "+12025550181",
          "email": "c13@yahoo.com",
          "lastName": "",
          "firstName": "",
          "alias": "",
          "customData": "",
          "id": 1789288,
          "location": [
            48.88366,
            2.313722
          ],
          "address": {
            "streetNumber": "",
            "postalCode": "",
            "streetName": "",
            "county": "",
            "state": "",
            "extra": "",
            "city": "",
            "country": ""
          }
        }
      },
      "matchedLocation": [
        48.8837328125,
        2.31352375
      ],
      "actualLocation": [
        0,
        0
      ],
      "indexInRoute": 3,
      "indexInOptimization": 3,
      "arrivalTime": 1742931755000,
      "timeToNextOrder": 612,
      "waitTime": 0,
      "numberOfPackagesAtArrival": 6,
      "collectedNumberOfPackages": 4,
      "deliveredNumberOfPackages": 0,
      "weightAtArrival": 5.19999885559082,
      "collectedWeight": 0,
      "deliveredWeight": 0,
      "cubeAtArrival": 1.5,
      "collectedCube": 0,
      "deliveredCube": 0,
      "traveledDistance": 25.209339141845703,
      "distanceToNextOrder": 3.481471061706543,
      "revenueAtArrival": 27.399999618530273,
      "visitTimestamp": 0
    },
    {
      "orderInfo": {
        "revenue": 2.299999952316284,
        "serviceTime": 600,
        "timeWindow": [
          1742931428081,
          1742940428081
        ],
        "creationTimestamp": 1742904432067,
        "cube": 11.5,
        "numberOfPackages": 6,
        "depotId": 0,
        "customData": "",
        "weight": 4.800000190734863,
        "phoneNumber": "+12025550181",
        "lastName": "",
        "status": 1,
        "firstName": "",
        "alias": "",
        "state": 1,
        "type": 0,
        "priority": 0,
        "id": 878529,
        "location": [
          48.895658,
          2.344043
        ],
        "address": {
          "streetNumber": "",
          "postalCode": "",
          "streetName": "",
          "county": "",
          "state": "",
          "extra": "",
          "city": "",
          "country": ""
        },
        "customerInfo": {
          "phoneNumber": "+12025550181",
          "email": "c10@yahoo.com",
          "lastName": "",
          "firstName": "",
          "alias": "",
          "customData": "",
          "id": 1789285,
          "location": [
            48.895658,
            2.344043
          ],
          "address": {
            "streetNumber": "",
            "postalCode": "",
            "streetName": "",
            "county": "",
            "state": "",
            "extra": "",
            "city": "",
            "country": ""
          }
        }
      },
      "matchedLocation": [
        48.8958034375,
        2.344040625
      ],
      "actualLocation": [
        0,
        0
      ],
      "indexInRoute": 4,
      "indexInOptimization": 4,
      "arrivalTime": 1742932727000,
      "timeToNextOrder": 413,
      "waitTime": 0,
      "numberOfPackagesAtArrival": 10,
      "collectedNumberOfPackages": 6,
      "deliveredNumberOfPackages": 0,
      "weightAtArrival": 5.19999885559082,
      "collectedWeight": 4.800000190734863,
      "deliveredWeight": 0,
      "cubeAtArrival": 1.5,
      "collectedCube": 11.5,
      "deliveredCube": 0,
      "traveledDistance": 28.690811157226562,
      "distanceToNextOrder": 2.538957118988037,
      "revenueAtArrival": 27.399999618530273,
      "visitTimestamp": 0
    },
    {
      "orderInfo": {
        "revenue": 8.100000381469727,
        "serviceTime": 1000,
        "timeWindow": [
          1742928188081,
          1742942408081
        ],
        "creationTimestamp": 1742904432067,
        "cube": 7.5,
        "numberOfPackages": 13,
        "depotId": 0,
        "customData": "",
        "weight": 6.300000190734863,
        "phoneNumber": "+12025550181",
        "lastName": "",
        "status": 1,
        "firstName": "",
        "alias": "",
        "state": 1,
        "type": 0,
        "priority": 0,
        "id": 878530,
        "location": [
          48.896894,
          2.321586
        ],
        "address": {
          "streetNumber": "",
          "postalCode": "",
          "streetName": "",
          "county": "",
          "state": "",
          "extra": "",
          "city": "",
          "country": ""
        },
        "customerInfo": {
          "phoneNumber": "+12025550181",
          "email": "c8@yahoo.com",
          "lastName": "",
          "firstName": "",
          "alias": "",
          "customData": "",
          "id": 1789283,
          "location": [
            48.896894,
            2.321586
          ],
          "address": {
            "streetNumber": "",
            "postalCode": "",
            "streetName": "",
            "county": "",
            "state": "",
            "extra": "",
            "city": "",
            "country": ""
          }
        }
      },
      "matchedLocation": [
        48.8971759375,
        2.321263125
      ],
      "actualLocation": [
        0,
        0
      ],
      "indexInRoute": 5,
      "indexInOptimization": 5,
      "arrivalTime": 1742933740000,
      "timeToNextOrder": 447,
      "waitTime": 0,
      "numberOfPackagesAtArrival": 16,
      "collectedNumberOfPackages": 13,
      "deliveredNumberOfPackages": 0,
      "weightAtArrival": 9.999999046325684,
      "collectedWeight": 6.300000190734863,
      "deliveredWeight": 0,
      "cubeAtArrival": 13,
      "collectedCube": 7.5,
      "deliveredCube": 0,
      "traveledDistance": 31.229768753051758,
      "distanceToNextOrder": 3.124872922897339,
      "revenueAtArrival": 29.69999885559082,
      "visitTimestamp": 0
    },
    {
      "orderInfo": {
        "revenue": 7.5,
        "serviceTime": 600,
        "timeWindow": [
          1742923388081,
          1742944028081
        ],
        "creationTimestamp": 1742904432067,
        "cube": 8.399999618530273,
        "numberOfPackages": 9,
        "depotId": 0,
        "customData": "",
        "weight": 16.200000762939453,
        "phoneNumber": "+12025550181",
        "lastName": "",
        "status": 1,
        "firstName": "",
        "alias": "",
        "state": 1,
        "type": 0,
        "priority": 0,
        "id": 878531,
        "location": [
          48.897163,
          2.292865
        ],
        "address": {
          "streetNumber": "",
          "postalCode": "",
          "streetName": "",
          "county": "",
          "state": "",
          "extra": "",
          "city": "",
          "country": ""
        },
        "customerInfo": {
          "phoneNumber": "+12025550181",
          "email": "c3@yahoo.com",
          "lastName": "",
          "firstName": "",
          "alias": "",
          "customData": "",
          "id": 1789278,
          "location": [
            48.897163,
            2.292865
          ],
          "address": {
            "streetNumber": "",
            "postalCode": "",
            "streetName": "",
            "county": "",
            "state": "",
            "extra": "",
            "city": "",
            "country": ""
          }
        }
      },
      "matchedLocation": [
        48.89706375,
        2.29247
      ],
      "actualLocation": [
        0,
        0
      ],
      "indexInRoute": 6,
      "indexInOptimization": 6,
      "arrivalTime": 1742935187000,
      "timeToNextOrder": 404,
      "waitTime": 0,
      "numberOfPackagesAtArrival": 29,
      "collectedNumberOfPackages": 9,
      "deliveredNumberOfPackages": 0,
      "weightAtArrival": 16.299999237060547,
      "collectedWeight": 16.200000762939453,
      "deliveredWeight": 0,
      "cubeAtArrival": 20.5,
      "collectedCube": 8.399999618530273,
      "deliveredCube": 0,
      "traveledDistance": 34.35464096069336,
      "distanceToNextOrder": 2.4328789710998535,
      "revenueAtArrival": 37.79999923706055,
      "visitTimestamp": 0
    },
    {
      "orderInfo": {
        "revenue": 2.9000000953674316,
        "serviceTime": 800,
        "timeWindow": [
          1742925428081,
          1742943428081
        ],
        "creationTimestamp": 1742904432067,
        "cube": 1.5,
        "numberOfPackages": 6,
        "depotId": 0,
        "customData": "",
        "weight": 5.199999809265137,
        "phoneNumber": "+12025550181",
        "lastName": "",
        "status": 1,
        "firstName": "",
        "alias": "",
        "state": 1,
        "type": 1,
        "priority": 0,
        "id": 878532,
        "location": [
          48.887096,
          2.283513
        ],
        "address": {
          "streetNumber": "",
          "postalCode": "",
          "streetName": "",
          "county": "",
          "state": "",
          "extra": "",
          "city": "",
          "country": ""
        },
        "customerInfo": {
          "phoneNumber": "+12025550181",
          "email": "c7@yahoo.com",
          "lastName": "",
          "firstName": "",
          "alias": "",
          "customData": "",
          "id": 1789282,
          "location": [
            48.887096,
            2.283513
          ],
          "address": {
            "streetNumber": "",
            "postalCode": "",
            "streetName": "",
            "county": "",
            "state": "",
            "extra": "",
            "city": "",
            "country": ""
          }
        }
      },
      "matchedLocation": [
        48.886898125,
        2.2838078125
      ],
      "actualLocation": [
        0,
        0
      ],
      "indexInRoute": 7,
      "indexInOptimization": 7,
      "arrivalTime": 1742936191000,
      "timeToNextOrder": 1286,
      "waitTime": 0,
      "numberOfPackagesAtArrival": 38,
      "collectedNumberOfPackages": 0,
      "deliveredNumberOfPackages": 6,
      "weightAtArrival": 32.5,
      "collectedWeight": 0,
      "deliveredWeight": 5.199999809265137,
      "cubeAtArrival": 28.899999618530273,
      "collectedCube": 0,
      "deliveredCube": 1.5,
      "traveledDistance": 36.78752136230469,
      "distanceToNextOrder": 10.027785301208496,
      "revenueAtArrival": 45.29999923706055,
      "visitTimestamp": 0
    },
    {
      "orderInfo": {
        "revenue": 0,
        "serviceTime": 420,
        "timeWindow": [
          1742896330179,
          1742911210179
        ],
        "creationTimestamp": 1742904432067,
        "cube": 0,
        "numberOfPackages": 3,
        "depotId": 0,
        "customData": "",
        "weight": 0,
        "phoneNumber": "+12025550181",
        "lastName": "",
        "status": 1,
        "firstName": "",
        "alias": "",
        "state": 1,
        "type": 1,
        "priority": 0,
        "id": 878533,
        "location": [
          48.867146,
          2.370473
        ],
        "address": {
          "streetNumber": "",
          "postalCode": "",
          "streetName": "",
          "county": "",
          "state": "",
          "extra": "",
          "city": "",
          "country": ""
        },
        "customerInfo": {
          "phoneNumber": "+12025550181",
          "email": "c14@yahoo.com",
          "lastName": "",
          "firstName": "",
          "alias": "",
          "customData": "",
          "id": 1789289,
          "location": [
            48.867146,
            2.370473
          ],
          "address": {
            "streetNumber": "",
            "postalCode": "",
            "streetName": "",
            "county": "",
            "state": "",
            "extra": "",
            "city": "",
            "country": ""
          }
        }
      },
      "matchedLocation": [
        48.86717375,
        2.370590625
      ],
      "actualLocation": [
        0,
        0
      ],
      "indexInRoute": 8,
      "indexInOptimization": 8,
      "arrivalTime": 1742938277000,
      "timeToNextOrder": 895,
      "waitTime": 0,
      "numberOfPackagesAtArrival": 32,
      "collectedNumberOfPackages": 0,
      "deliveredNumberOfPackages": 3,
      "weightAtArrival": 27.299999237060547,
      "collectedWeight": 0,
      "deliveredWeight": 0,
      "cubeAtArrival": 27.399999618530273,
      "collectedCube": 0,
      "deliveredCube": 0,
      "traveledDistance": 46.8153076171875,
      "distanceToNextOrder": 5.919641017913818,
      "revenueAtArrival": 48.20000076293945,
      "visitTimestamp": 0
    },
    {
      "orderInfo": {
        "revenue": 13.399999618530273,
        "serviceTime": 500,
        "timeWindow": [
          1742924828081,
          1742940428081
        ],
        "creationTimestamp": 1742904432067,
        "cube": 2.5999999046325684,
        "numberOfPackages": 5,
        "depotId": 0,
        "customData": "",
        "weight": 7.5,
        "phoneNumber": "+12025550181",
        "lastName": "",
        "status": 1,
        "firstName": "",
        "alias": "",
        "state": 1,
        "type": 0,
        "priority": 0,
        "id": 878534,
        "location": [
          48.860914,
          2.310625
        ],
        "address": {
          "streetNumber": "",
          "postalCode": "",
          "streetName": "",
          "county": "",
          "state": "",
          "extra": "",
          "city": "",
          "country": ""
        },
        "customerInfo": {
          "phoneNumber": "+12025550181",
          "email": "c5@yahoo.com",
          "lastName": "",
          "firstName": "",
          "alias": "",
          "customData": "",
          "id": 1789280,
          "location": [
            48.860914,
            2.310625
          ],
          "address": {
            "streetNumber": "",
            "postalCode": "",
            "streetName": "",
            "county": "",
            "state": "",
            "extra": "",
            "city": "",
            "country": ""
          }
        }
      },
      "matchedLocation": [
        48.86112,
        2.310630625
      ],
      "actualLocation": [
        0,
        0
      ],
      "indexInRoute": 9,
      "indexInOptimization": 9,
      "arrivalTime": 1742939592000,
      "timeToNextOrder": 493,
      "waitTime": 0,
      "numberOfPackagesAtArrival": 29,
      "collectedNumberOfPackages": 5,
      "deliveredNumberOfPackages": 0,
      "weightAtArrival": 27.299999237060547,
      "collectedWeight": 7.5,
      "deliveredWeight": 0,
      "cubeAtArrival": 27.399999618530273,
      "collectedCube": 2.5999999046325684,
      "deliveredCube": 0,
      "traveledDistance": 52.734947204589844,
      "distanceToNextOrder": 3.4768919944763184,
      "revenueAtArrival": 48.20000076293945,
      "visitTimestamp": 0
    },
    {
      "orderInfo": {
        "revenue": 0,
        "serviceTime": 0,
        "timeWindow": [
          1742904428081,
          1742944028081
        ],
        "creationTimestamp": 1742904432067,
        "cube": 0,
        "numberOfPackages": 0,
        "depotId": 0,
        "customData": "",
        "weight": 0,
        "phoneNumber": "+12025550181",
        "lastName": "",
        "status": 1,
        "firstName": "",
        "alias": "",
        "state": 1,
        "type": 0,
        "priority": 0,
        "id": 878535,
        "location": [
          48.847327,
          2.342267
        ],
        "address": {
          "streetNumber": "",
          "postalCode": "",
          "streetName": "",
          "county": "",
          "state": "",
          "extra": "",
          "city": "",
          "country": ""
        },
        "customerInfo": {
          "phoneNumber": "+12025550181",
          "email": "c1@yahoo.com",
          "lastName": "",
          "firstName": "",
          "alias": "",
          "customData": "",
          "id": 1789276,
          "location": [
            48.847327,
            2.342267
          ],
          "address": {
            "streetNumber": "",
            "postalCode": "",
            "streetName": "",
            "county": "",
            "state": "",
            "extra": "",
            "city": "",
            "country": ""
          }
        }
      },
      "matchedLocation": [
        48.8471475,
        2.342168125
      ],
      "actualLocation": [
        0,
        0
      ],
      "indexInRoute": 10,
      "indexInOptimization": 10,
      "arrivalTime": 1742940585000,
      "timeToNextOrder": 599,
      "waitTime": 0,
      "numberOfPackagesAtArrival": 34,
      "collectedNumberOfPackages": 0,
      "deliveredNumberOfPackages": 0,
      "weightAtArrival": 34.79999923706055,
      "collectedWeight": 0,
      "deliveredWeight": 0,
      "cubeAtArrival": 30,
      "collectedCube": 0,
      "deliveredCube": 0,
      "traveledDistance": 56.21183776855469,
      "distanceToNextOrder": 3.5733330249786377,
      "revenueAtArrival": 61.599998474121094,
      "visitTimestamp": 0
    },
    {
      "orderInfo": {
        "revenue": 0,
        "serviceTime": 600,
        "timeWindow": [
          1742887330179,
          1742922010179
        ],
        "creationTimestamp": 1742904432067,
        "cube": 0,
        "numberOfPackages": 3,
        "depotId": 0,
        "customData": "",
        "weight": 0,
        "phoneNumber": "+12025550181",
        "lastName": "",
        "status": 1,
        "firstName": "",
        "alias": "",
        "state": 1,
        "type": 0,
        "priority": 0,
        "id": 878536,
        "location": [
          48.869065,
          2.3452
        ],
        "address": {
          "streetNumber": "",
          "postalCode": "",
          "streetName": "",
          "county": "",
          "state": "",
          "extra": "",
          "city": "",
          "country": ""
        },
        "customerInfo": {
          "phoneNumber": "+12025550181",
          "email": "c11@yahoo.com",
          "lastName": "",
          "firstName": "",
          "alias": "",
          "customData": "",
          "id": 1789286,
          "location": [
            48.869065,
            2.3452
          ],
          "address": {
            "streetNumber": "",
            "postalCode": "",
            "streetName": "",
            "county": "",
            "state": "",
            "extra": "",
            "city": "",
            "country": ""
          }
        }
      },
      "matchedLocation": [
        48.8693153125,
        2.3454121875
      ],
      "actualLocation": [
        0,
        0
      ],
      "indexInRoute": 11,
      "indexInOptimization": 11,
      "arrivalTime": 1742941184000,
      "timeToNextOrder": 1111,
      "waitTime": 0,
      "numberOfPackagesAtArrival": 34,
      "collectedNumberOfPackages": 3,
      "deliveredNumberOfPackages": 0,
      "weightAtArrival": 34.79999923706055,
      "collectedWeight": 0,
      "deliveredWeight": 0,
      "cubeAtArrival": 30,
      "collectedCube": 0,
      "deliveredCube": 0,
      "traveledDistance": 59.78517150878906,
      "distanceToNextOrder": 6.871033191680908,
      "revenueAtArrival": 61.599998474121094,
      "visitTimestamp": 0
    },
    {
      "orderInfo": {
        "revenue": 0,
        "serviceTime": 480,
        "timeWindow": [
          1742891230179,
          1742911210179
        ],
        "creationTimestamp": 1742904432067,
        "cube": 0,
        "numberOfPackages": 4,
        "depotId": 0,
        "customData": "",
        "weight": 0,
        "phoneNumber": "+12025550181",
        "lastName": "",
        "status": 1,
        "firstName": "",
        "alias": "",
        "state": 1,
        "type": 1,
        "priority": 0,
        "id": 878537,
        "location": [
          48.841855,
          2.288084
        ],
        "address": {
          "streetNumber": "",
          "postalCode": "",
          "streetName": "",
          "county": "",
          "state": "",
          "extra": "",
          "city": "",
          "country": ""
        },
        "customerInfo": {
          "phoneNumber": "+12025550181",
          "email": "c12@yahoo.com",
          "lastName": "",
          "firstName": "",
          "alias": "",
          "customData": "",
          "id": 1789287,
          "location": [
            48.841855,
            2.288084
          ],
          "address": {
            "streetNumber": "",
            "postalCode": "",
            "streetName": "",
            "county": "",
            "state": "",
            "extra": "",
            "city": "",
            "country": ""
          }
        }
      },
      "matchedLocation": [
        48.8419025,
        2.2881503125
      ],
      "actualLocation": [
        0,
        0
      ],
      "indexInRoute": 12,
      "indexInOptimization": 12,
      "arrivalTime": 1742942895000,
      "timeToNextOrder": 930,
      "waitTime": 0,
      "numberOfPackagesAtArrival": 37,
      "collectedNumberOfPackages": 0,
      "deliveredNumberOfPackages": 4,
      "weightAtArrival": 34.79999923706055,
      "collectedWeight": 0,
      "deliveredWeight": 0,
      "cubeAtArrival": 30,
      "collectedCube": 0,
      "deliveredCube": 0,
      "traveledDistance": 66.65620422363281,
      "distanceToNextOrder": 7.025349140167236,
      "revenueAtArrival": 61.599998474121094,
      "visitTimestamp": 0
    },
    {
      "orderInfo": {
        "revenue": 0,
        "serviceTime": 180,
        "timeWindow": [
          1742895130179,
          1742917990179
        ],
        "creationTimestamp": 1742904432067,
        "cube": 0,
        "numberOfPackages": 2,
        "depotId": 0,
        "customData": "",
        "weight": 0,
        "phoneNumber": "+12025550181",
        "lastName": "",
        "status": 1,
        "firstName": "",
        "alias": "",
        "state": 1,
        "type": 0,
        "priority": 0,
        "id": 878538,
        "location": [
          48.868315,
          2.339323
        ],
        "address": {
          "streetNumber": "",
          "postalCode": "",
          "streetName": "",
          "county": "",
          "state": "",
          "extra": "",
          "city": "",
          "country": ""
        },
        "customerInfo": {
          "phoneNumber": "+12025550181",
          "email": "c15@yahoo.com",
          "lastName": "",
          "firstName": "",
          "alias": "",
          "customData": "",
          "id": 1789290,
          "location": [
            48.868315,
            2.339323
          ],
          "address": {
            "streetNumber": "",
            "postalCode": "",
            "streetName": "",
            "county": "",
            "state": "",
            "extra": "",
            "city": "",
            "country": ""
          }
        }
      },
      "matchedLocation": [
        48.868245625,
        2.3397215625
      ],
      "actualLocation": [
        0,
        0
      ],
      "indexInRoute": 13,
      "indexInOptimization": 13,
      "arrivalTime": 1742944305000,
      "timeToNextOrder": 918,
      "waitTime": 0,
      "numberOfPackagesAtArrival": 33,
      "collectedNumberOfPackages": 2,
      "deliveredNumberOfPackages": 0,
      "weightAtArrival": 34.79999923706055,
      "collectedWeight": 0,
      "deliveredWeight": 0,
      "cubeAtArrival": 30,
      "collectedCube": 0,
      "deliveredCube": 0,
      "traveledDistance": 73.68155670166016,
      "distanceToNextOrder": 5.317834854125977,
      "revenueAtArrival": 61.599998474121094,
      "visitTimestamp": 0
    },
    {
      "orderInfo": {
        "revenue": 0,
        "serviceTime": 120,
        "timeWindow": [
          1742907430179,
          1742917210179
        ],
        "creationTimestamp": 1742904432067,
        "cube": 0,
        "numberOfPackages": 1,
        "depotId": 0,
        "customData": "",
        "weight": 0,
        "phoneNumber": "+12025550181",
        "lastName": "",
        "status": 1,
        "firstName": "",
        "alias": "",
        "state": 1,
        "type": 1,
        "priority": 0,
        "id": 878539,
        "location": [
          48.867983,
          2.380173
        ],
        "address": {
          "streetNumber": "",
          "postalCode": "",
          "streetName": "",
          "county": "",
          "state": "",
          "extra": "",
          "city": "",
          "country": ""
        },
        "customerInfo": {
          "phoneNumber": "+12025550181",
          "email": "c16@yahoo.com",
          "lastName": "",
          "firstName": "",
          "alias": "",
          "customData": "",
          "id": 1789291,
          "location": [
            48.867983,
            2.380173
          ],
          "address": {
            "streetNumber": "",
            "postalCode": "",
            "streetName": "",
            "county": "",
            "state": "",
            "extra": "",
            "city": "",
            "country": ""
          }
        }
      },
      "matchedLocation": [
        48.8679525,
        2.380690625
      ],
      "actualLocation": [
        0,
        0
      ],
      "indexInRoute": 14,
      "indexInOptimization": 14,
      "arrivalTime": 1742945403000,
      "timeToNextOrder": 632,
      "waitTime": 0,
      "numberOfPackagesAtArrival": 35,
      "collectedNumberOfPackages": 0,
      "deliveredNumberOfPackages": 1,
      "weightAtArrival": 34.79999923706055,
      "collectedWeight": 0,
      "deliveredWeight": 0,
      "cubeAtArrival": 30,
      "collectedCube": 0,
      "deliveredCube": 0,
      "traveledDistance": 78.9993896484375,
      "distanceToNextOrder": 3.4660398960113525,
      "revenueAtArrival": 61.599998474121094,
      "visitTimestamp": 0
    },
    {
      "orderInfo": {
        "revenue": 0,
        "serviceTime": 600,
        "timeWindow": [
          1742904428081,
          1742944028081
        ],
        "creationTimestamp": 1742904432067,
        "cube": 0,
        "numberOfPackages": 0,
        "depotId": 0,
        "customData": "",
        "weight": 0,
        "phoneNumber": "+12025550181",
        "lastName": "",
        "status": 1,
        "firstName": "",
        "alias": "",
        "state": 1,
        "type": 0,
        "priority": 0,
        "id": 878540,
        "location": [
          48.870852,
          2.356148
        ],
        "address": {
          "streetNumber": "",
          "postalCode": "",
          "streetName": "",
          "county": "",
          "state": "",
          "extra": "",
          "city": "",
          "country": ""
        },
        "customerInfo": {
          "phoneNumber": "+12025550181",
          "email": "c0@yahoo.com",
          "lastName": "",
          "firstName": "",
          "alias": "",
          "customData": "",
          "id": 1789275,
          "location": [
            48.870852,
            2.356148
          ],
          "address": {
            "streetNumber": "",
            "postalCode": "",
            "streetName": "",
            "county": "",
            "state": "",
            "extra": "",
            "city": "",
            "country": ""
          }
        }
      },
      "matchedLocation": [
        48.8707784375,
        2.3565665625
      ],
      "actualLocation": [
        0,
        0
      ],
      "indexInRoute": 15,
      "indexInOptimization": 15,
      "arrivalTime": 1742946155000,
      "timeToNextOrder": 318,
      "waitTime": 0,
      "numberOfPackagesAtArrival": 34,
      "collectedNumberOfPackages": 0,
      "deliveredNumberOfPackages": 0,
      "weightAtArrival": 34.79999923706055,
      "collectedWeight": 0,
      "deliveredWeight": 0,
      "cubeAtArrival": 30,
      "collectedCube": 0,
      "deliveredCube": 0,
      "traveledDistance": 82.4654312133789,
      "distanceToNextOrder": 1.8787050247192383,
      "revenueAtArrival": 61.599998474121094,
      "visitTimestamp": 0
    },
    {
      "orderInfo": {
        "revenue": 6.199999809265137,
        "serviceTime": 850,
        "timeWindow": [
          1742923388081,
          1742933408081
        ],
        "creationTimestamp": 1742904432067,
        "cube": 4.099999904632568,
        "numberOfPackages": 10,
        "depotId": 0,
        "customData": "",
        "weight": 8,
        "phoneNumber": "+12025550181",
        "lastName": "",
        "status": 1,
        "firstName": "",
        "alias": "",
        "state": 1,
        "type": 0,
        "priority": 0,
        "id": 878541,
        "location": [
          48.870449,
          2.342204
        ],
        "address": {
          "streetNumber": "",
          "postalCode": "",
          "streetName": "",
          "county": "",
          "state": "",
          "extra": "",
          "city": "",
          "country": ""
        },
        "customerInfo": {
          "phoneNumber": "+12025550181",
          "email": "c9@yahoo.com",
          "lastName": "",
          "firstName": "",
          "alias": "",
          "customData": "",
          "id": 1789284,
          "location": [
            48.870449,
            2.342204
          ],
          "address": {
            "streetNumber": "",
            "postalCode": "",
            "streetName": "",
            "county": "",
            "state": "",
            "extra": "",
            "city": "",
            "country": ""
          }
        }
      },
      "matchedLocation": [
        48.870181875,
        2.342345
      ],
      "actualLocation": [
        0,
        0
      ],
      "indexInRoute": 16,
      "indexInOptimization": 16,
      "arrivalTime": 1742947073000,
      "timeToNextOrder": 1028,
      "waitTime": 0,
      "numberOfPackagesAtArrival": 34,
      "collectedNumberOfPackages": 10,
      "deliveredNumberOfPackages": 0,
      "weightAtArrival": 34.79999923706055,
      "collectedWeight": 8,
      "deliveredWeight": 0,
      "cubeAtArrival": 30,
      "collectedCube": 4.099999904632568,
      "deliveredCube": 0,
      "traveledDistance": 84.3441390991211,
      "distanceToNextOrder": 6.410910129547119,
      "revenueAtArrival": 61.599998474121094,
      "visitTimestamp": 0
    }
  ],
  "totalTime": 21820,
  "totalDistance": 90.75505065917969,
  "id": 250999
}

```

## Conclusion[​](#conclusion "Direct link to Conclusion")

This example demonstrates how to merge multiple routes into one while maintaining the configuration of the first route. The merged route is returned without optimization, but it can be optimized later using the reoptimization feature.
