# Reoptimize Optimization

Last updated:

<!-- -->

October 18, 2026

<!-- -->

\| 14 minutes read

<br />

<br />

This example demonstrates how to reoptimize an existing optimization to generate a new and potentially better solution. The reoptimization process uses the latest fuel prices to calculate the new solution (refer to the [Get Fuel Prices](/docs/cloud-rest-api/guides/fleet-management/core-concepts/fuelprice.md#2-get-all-fuel-prices) example).

## 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 existing optimization is reoptimized.
2. A new solution is generated and returned.

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

### Step 1: Retrieve the Existing Optimization[​](#step-1-retrieve-the-existing-optimization "Direct link to Step 1: Retrieve the Existing Optimization")

To reoptimize an optimization, you first need to retrieve the existing optimization using its ID.

* **Method:** `GET`

* **Endpoint:** `/optimizations/{id}`

* **Headers:**

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

* **Path Parameter:**
  * `id` (integer, \**required*) - The unique optimization ID.

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

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

```json
{
  "id": 12345,
  "orders": [
    {
      "id": 879888,
      "creationTimestamp": 1752745377776,
      "customerInfo": {
        "id": 1791105,
        "alias": "Customer 1",
        "firstName": "Customer1",
        "lastName": "Customer1",
        "address": {
          "country": "",
          "state": "",
          "county": "",
          "city": "",
          "postalCode": "",
          "streetName": "",
          "streetNumber": ""
        },
        "email": "customer1@example.com",
        "phoneNumber": "+12025550180",
        "location": [
          48.849151,
          2.266093
        ],
        "customData": ""
      },
      "location": [
        48.849151,
        2.266093
      ],
      "alias": "Customer 1",
      "firstName": "Customer1",
      "lastName": "Customer1",
      "address": {
        "country": "",
        "state": "",
        "county": "",
        "city": "",
        "postalCode": "",
        "streetName": "",
        "streetNumber": ""
      },
      "phoneNumber": "+12025550180",
      "customData": "",
      "type": 0,
      "status": 0,
      "state": 1,
      "priority": 0,
      "numberOfPackages": 1,
      "weight": 2,
      "cube": 0.1,
      "revenue": 31.2,
      "timeWindow": [
        420,
        1086
      ],
      "serviceTime": 0,
      "depotId": 0
    },
    {
      "id": 879887,
      "creationTimestamp": 1752745377776,
      "customerInfo": {
        "id": 1791104,
        "alias": "Customer 2",
        "firstName": "Customer2",
        "lastName": "Customer2",
        "address": {
          "country": "",
          "state": "",
          "county": "",
          "city": "",
          "postalCode": "",
          "streetName": "",
          "streetNumber": ""
        },
        "email": "customer2@example.com",
        "phoneNumber": "+12025550181",
        "location": [
          48.914831,
          2.168591
        ],
        "customData": ""
      },
      "location": [
        48.914831,
        2.168591
      ],
      "alias": "Customer 2",
      "firstName": "Customer2",
      "lastName": "Customer2",
      "address": {
        "country": "",
        "state": "",
        "county": "",
        "city": "",
        "postalCode": "",
        "streetName": "",
        "streetNumber": ""
      },
      "phoneNumber": "+12025550181",
      "customData": "",
      "type": 0,
      "status": 0,
      "state": 1,
      "priority": 0,
      "numberOfPackages": 1,
      "weight": 1.1,
      "cube": 0.1,
      "revenue": 24.5,
      "timeWindow": [
        420,
        1086
      ],
      "serviceTime": 0,
      "depotId": 0
    },
    {
      "id": 879886,
      "creationTimestamp": 1752745377776,
      "customerInfo": {
        "id": 1791103,
        "alias": "Customer 3",
        "firstName": "Customer3",
        "lastName": "Customer3",
        "address": {
          "country": "",
          "state": "",
          "county": "",
          "city": "",
          "postalCode": "",
          "streetName": "",
          "streetNumber": ""
        },
        "email": "customer3@example.com",
        "phoneNumber": "+12025550182",
        "location": [
          48.898456,
          2.359571
        ],
        "customData": ""
      },
      "location": [
        48.898456,
        2.359571
      ],
      "alias": "Customer 3",
      "firstName": "Customer3",
      "lastName": "Customer3",
      "address": {
        "country": "",
        "state": "",
        "county": "",
        "city": "",
        "postalCode": "",
        "streetName": "",
        "streetNumber": ""
      },
      "phoneNumber": "+12025550182",
      "customData": "",
      "type": 0,
      "status": 0,
      "state": 1,
      "priority": 0,
      "numberOfPackages": 3,
      "weight": 5.1,
      "cube": 0.5,
      "revenue": 12,
      "timeWindow": [
        500,
        1020
      ],
      "serviceTime": 0,
      "depotId": 0
    },
    {
      "id": 879885,
      "creationTimestamp": 1752745377776,
      "customerInfo": {
        "id": 1791102,
        "alias": "Customer 4",
        "firstName": "Customer4",
        "lastName": "Customer4",
        "address": {
          "country": "",
          "state": "",
          "county": "",
          "city": "",
          "postalCode": "",
          "streetName": "",
          "streetNumber": ""
        },
        "email": "customer4@example.com",
        "phoneNumber": "+12025550183",
        "location": [
          48.891034,
          2.376929
        ],
        "customData": ""
      },
      "location": [
        48.891034,
        2.376929
      ],
      "alias": "Customer 4",
      "firstName": "Customer4",
      "lastName": "Customer4",
      "address": {
        "country": "",
        "state": "",
        "county": "",
        "city": "",
        "postalCode": "",
        "streetName": "",
        "streetNumber": ""
      },
      "phoneNumber": "+12025550183",
      "customData": "",
      "type": 1,
      "status": 0,
      "state": 1,
      "priority": 0,
      "numberOfPackages": 8,
      "weight": 15.4,
      "cube": 0.8,
      "revenue": 2.7,
      "timeWindow": [
        430,
        1036
      ],
      "serviceTime": 0,
      "depotId": 0
    },
    {
      "id": 879884,
      "creationTimestamp": 1752745377776,
      "customerInfo": {
        "id": 1791101,
        "alias": "Customer 5",
        "firstName": "Customer5",
        "lastName": "Customer5",
        "address": {
          "country": "",
          "state": "",
          "county": "",
          "city": "",
          "postalCode": "",
          "streetName": "",
          "streetNumber": ""
        },
        "email": "customer5@example.com",
        "phoneNumber": "+12025550184",
        "location": [
          48.928086,
          2.217675
        ],
        "customData": ""
      },
      "location": [
        48.928086,
        2.217675
      ],
      "alias": "Customer 5",
      "firstName": "Customer5",
      "lastName": "Customer5",
      "address": {
        "country": "",
        "state": "",
        "county": "",
        "city": "",
        "postalCode": "",
        "streetName": "",
        "streetNumber": ""
      },
      "phoneNumber": "+12025550184",
      "customData": "",
      "type": 0,
      "status": 0,
      "state": 1,
      "priority": 0,
      "numberOfPackages": 9,
      "weight": 16.2,
      "cube": 0.4,
      "revenue": 7.5,
      "timeWindow": [
        480,
        1086
      ],
      "serviceTime": 0,
      "depotId": 0
    },
    {
      "id": 879883,
      "creationTimestamp": 1752745377776,
      "customerInfo": {
        "id": 1791100,
        "alias": "Customer 6",
        "firstName": "Customer6",
        "lastName": "Customer6",
        "address": {
          "country": "",
          "state": "",
          "county": "",
          "city": "",
          "postalCode": "",
          "streetName": "",
          "streetNumber": ""
        },
        "email": "customer6@example.com",
        "phoneNumber": "+12025550185",
        "location": [
          48.89258,
          2.081645
        ],
        "customData": ""
      },
      "location": [
        48.89258,
        2.081645
      ],
      "alias": "Customer 6",
      "firstName": "Customer6",
      "lastName": "Customer6",
      "address": {
        "country": "",
        "state": "",
        "county": "",
        "city": "",
        "postalCode": "",
        "streetName": "",
        "streetNumber": ""
      },
      "phoneNumber": "+12025550185",
      "customData": "",
      "type": 1,
      "status": 0,
      "state": 1,
      "priority": 0,
      "numberOfPackages": 9,
      "weight": 13.5,
      "cube": 1.7,
      "revenue": 10,
      "timeWindow": [
        350,
        1053
      ],
      "serviceTime": 0,
      "depotId": 0
    },
    {
      "id": 879882,
      "creationTimestamp": 1752745377776,
      "customerInfo": {
        "id": 1791099,
        "alias": "Customer 7",
        "firstName": "Customer7",
        "lastName": "Customer7",
        "address": {
          "country": "",
          "state": "",
          "county": "",
          "city": "",
          "postalCode": "",
          "streetName": "",
          "streetNumber": ""
        },
        "email": "customer7@example.com",
        "phoneNumber": "+12025550186",
        "location": [
          48.891779,
          2.149101
        ],
        "customData": ""
      },
      "location": [
        48.891779,
        2.149101
      ],
      "alias": "Customer 7",
      "firstName": "Customer7",
      "lastName": "Customer7",
      "address": {
        "country": "",
        "state": "",
        "county": "",
        "city": "",
        "postalCode": "",
        "streetName": "",
        "streetNumber": ""
      },
      "phoneNumber": "+12025550186",
      "customData": "",
      "type": 0,
      "status": 0,
      "state": 1,
      "priority": 0,
      "numberOfPackages": 5,
      "weight": 7.5,
      "cube": 1.2,
      "revenue": 13.4,
      "timeWindow": [
        540,
        1020
      ],
      "serviceTime": 0,
      "depotId": 0
    },
    {
      "id": 879881,
      "creationTimestamp": 1752745377776,
      "customerInfo": {
        "id": 1791098,
        "alias": "Customer 8",
        "firstName": "Customer8",
        "lastName": "Customer8",
        "address": {
          "country": "",
          "state": "",
          "county": "",
          "city": "",
          "postalCode": "",
          "streetName": "",
          "streetNumber": ""
        },
        "email": "customer8@example.com",
        "phoneNumber": "+12025550187",
        "location": [
          48.86921,
          2.283707
        ],
        "customData": ""
      },
      "location": [
        48.86921,
        2.283707
      ],
      "alias": "Customer 8",
      "firstName": "Customer8",
      "lastName": "Customer8",
      "address": {
        "country": "",
        "state": "",
        "county": "",
        "city": "",
        "postalCode": "",
        "streetName": "",
        "streetNumber": ""
      },
      "phoneNumber": "+12025550187",
      "customData": "",
      "type": 1,
      "status": 0,
      "state": 1,
      "priority": 0,
      "numberOfPackages": 11,
      "weight": 12.1,
      "cube": 0.6,
      "revenue": 14.7,
      "timeWindow": [
        500,
        1086
      ],
      "serviceTime": 0,
      "depotId": 0
    },
    {
      "id": 879880,
      "creationTimestamp": 1752745377776,
      "customerInfo": {
        "id": 1791097,
        "alias": "Customer 9",
        "firstName": "Customer9",
        "lastName": "Customer9",
        "address": {
          "country": "",
          "state": "",
          "county": "",
          "city": "",
          "postalCode": "",
          "streetName": "",
          "streetNumber": ""
        },
        "email": "customer9@example.com",
        "phoneNumber": "+12025550188",
        "location": [
          48.897715,
          2.324124
        ],
        "customData": ""
      },
      "location": [
        48.897715,
        2.324124
      ],
      "alias": "Customer 9",
      "firstName": "Customer9",
      "lastName": "Customer9",
      "address": {
        "country": "",
        "state": "",
        "county": "",
        "city": "",
        "postalCode": "",
        "streetName": "",
        "streetNumber": ""
      },
      "phoneNumber": "+12025550188",
      "customData": "",
      "type": 1,
      "status": 0,
      "state": 1,
      "priority": 0,
      "numberOfPackages": 6,
      "weight": 5.2,
      "cube": 1.5,
      "revenue": 2.9,
      "timeWindow": [
        380,
        1070
      ],
      "serviceTime": 0,
      "depotId": 0
    },
    {
      "id": 879879,
      "creationTimestamp": 1752745377776,
      "customerInfo": {
        "id": 1791096,
        "alias": "Customer 10",
        "firstName": "Customer10",
        "lastName": "Customer10",
        "address": {
          "country": "",
          "state": "",
          "county": "",
          "city": "",
          "postalCode": "",
          "streetName": "",
          "streetNumber": ""
        },
        "email": "customer10@example.com",
        "phoneNumber": "+12025550189",
        "location": [
          48.802124,
          2.157246
        ],
        "customData": ""
      },
      "location": [
        48.802124,
        2.157246
      ],
      "alias": "Customer 10",
      "firstName": "Customer10",
      "lastName": "Customer10",
      "address": {
        "country": "",
        "state": "",
        "county": "",
        "city": "",
        "postalCode": "",
        "streetName": "",
        "streetNumber": ""
      },
      "phoneNumber": "+12025550189",
      "customData": "",
      "type": 0,
      "status": 0,
      "state": 1,
      "priority": 0,
      "numberOfPackages": 13,
      "weight": 6.3,
      "cube": 0.5,
      "revenue": 8.1,
      "timeWindow": [
        400,
        1053
      ],
      "serviceTime": 0,
      "depotId": 0
    },
    {
      "id": 879878,
      "creationTimestamp": 1752745377776,
      "customerInfo": {
        "id": 1791095,
        "alias": "Customer 11",
        "firstName": "Customer11",
        "lastName": "Customer11",
        "address": {
          "country": "",
          "state": "",
          "county": "",
          "city": "",
          "postalCode": "",
          "streetName": "",
          "streetNumber": ""
        },
        "email": "customer11@example.com",
        "phoneNumber": "+120255501810",
        "location": [
          48.772667,
          2.150946
        ],
        "customData": ""
      },
      "location": [
        48.772667,
        2.150946
      ],
      "alias": "Customer 11",
      "firstName": "Customer11",
      "lastName": "Customer11",
      "address": {
        "country": "",
        "state": "",
        "county": "",
        "city": "",
        "postalCode": "",
        "streetName": "",
        "streetNumber": ""
      },
      "phoneNumber": "+120255501810",
      "customData": "",
      "type": 0,
      "status": 0,
      "state": 1,
      "priority": 0,
      "numberOfPackages": 10,
      "weight": 8,
      "cube": 0.1,
      "revenue": 6.2,
      "timeWindow": [
        430,
        1020
      ],
      "serviceTime": 0,
      "depotId": 0
    },
    {
      "id": 879877,
      "creationTimestamp": 1752745377776,
      "customerInfo": {
        "id": 1791094,
        "alias": "Customer 12",
        "firstName": "Customer12",
        "lastName": "Customer12",
        "address": {
          "country": "",
          "state": "",
          "county": "",
          "city": "",
          "postalCode": "",
          "streetName": "",
          "streetNumber": ""
        },
        "email": "customer12@example.com",
        "phoneNumber": "+120255501811",
        "location": [
          48.761058,
          2.077915
        ],
        "customData": ""
      },
      "location": [
        48.761058,
        2.077915
      ],
      "alias": "Customer 12",
      "firstName": "Customer12",
      "lastName": "Customer12",
      "address": {
        "country": "",
        "state": "",
        "county": "",
        "city": "",
        "postalCode": "",
        "streetName": "",
        "streetNumber": ""
      },
      "phoneNumber": "+120255501811",
      "customData": "",
      "type": 0,
      "status": 0,
      "state": 1,
      "priority": 0,
      "numberOfPackages": 6,
      "weight": 4.8,
      "cube": 1.5,
      "revenue": 2.3,
      "timeWindow": [
        430,
        1020
      ],
      "serviceTime": 0,
      "depotId": 0
    },
    {
      "creationTimestamp": 1752745377776,
      "customerInfo": {
        "alias": "Customer 13",
        "firstName": "Customer13",
        "lastName": "Customer13",
        "address": {
          "country": "",
          "state": "",
          "county": "",
          "city": "",
          "postalCode": "",
          "streetName": "",
          "streetNumber": ""
        },
        "email": "customer13@example.com",
        "phoneNumber": "+120255501812",
        "location": [
          48.900701,
          1.999858
        ],
        "customData": ""
      },
      "location": [
        48.900701,
        1.999858
      ],
      "alias": "Customer 13",
      "firstName": "Customer13",
      "lastName": "Customer13",
      "address": {
        "country": "",
        "state": "",
        "county": "",
        "city": "",
        "postalCode": "",
        "streetName": "",
        "streetNumber": ""
      },
      "phoneNumber": "+120255501812",
      "customData": "",
      "type": 1,
      "status": 0,
      "state": 1,
      "priority": 0,
      "numberOfPackages": 2,
      "weight": 1.2,
      "cube": 0.5,
      "revenue": 12.1,
      "timeWindow": [
        350,
        1053
      ],
      "serviceTime": 0,
      "depotId": 0
    },
    {
      "creationTimestamp": 1752745377776,
      "customerInfo": {
        "alias": "Customer 14",
        "firstName": "Customer14",
        "lastName": "Customer14",
        "address": {
          "country": "",
          "state": "",
          "county": "",
          "city": "",
          "postalCode": "",
          "streetName": "",
          "streetNumber": ""
        },
        "email": "customer14@example.com",
        "phoneNumber": "+120255501813",
        "location": [
          48.868801,
          2.035137
        ],
        "customData": ""
      },
      "location": [
        48.868801,
        2.035137
      ],
      "alias": "Customer 14",
      "firstName": "Customer14",
      "lastName": "Customer14",
      "address": {
        "country": "",
        "state": "",
        "county": "",
        "city": "",
        "postalCode": "",
        "streetName": "",
        "streetNumber": ""
      },
      "phoneNumber": "+120255501813",
      "customData": "",
      "type": 0,
      "status": 0,
      "state": 1,
      "priority": 0,
      "numberOfPackages": 5,
      "weight": 2.3,
      "cube": 0.2,
      "revenue": 5.2,
      "timeWindow": [
        540,
        1020
      ],
      "serviceTime": 0,
      "depotId": 0
    },
    {
      "creationTimestamp": 1752745377776,
      "customerInfo": {
        "alias": "Customer 15",
        "firstName": "Customer15",
        "lastName": "Customer15",
        "address": {
          "country": "",
          "state": "",
          "county": "",
          "city": "",
          "postalCode": "",
          "streetName": "",
          "streetNumber": ""
        },
        "email": "customer15@example.com",
        "phoneNumber": "+120255501814",
        "location": [
          48.873694,
          2.358232
        ],
        "customData": ""
      },
      "location": [
        48.873694,
        2.358232
      ],
      "alias": "Customer 15",
      "firstName": "Customer15",
      "lastName": "Customer15",
      "address": {
        "country": "",
        "state": "",
        "county": "",
        "city": "",
        "postalCode": "",
        "streetName": "",
        "streetNumber": ""
      },
      "phoneNumber": "+120255501814",
      "customData": "",
      "type": 1,
      "status": 0,
      "state": 1,
      "priority": 0,
      "numberOfPackages": 3,
      "weight": 2.1,
      "cube": 0.3,
      "revenue": 6.3,
      "timeWindow": [
        500,
        1086
      ],
      "serviceTime": 0,
      "depotId": 0
    },
    {
      "creationTimestamp": 1752745377776,
      "customerInfo": {
        "alias": "Customer 16",
        "firstName": "Customer16",
        "lastName": "Customer16",
        "address": {
          "country": "",
          "state": "",
          "county": "",
          "city": "",
          "postalCode": "",
          "streetName": "",
          "streetNumber": ""
        },
        "email": "customer16@example.com",
        "phoneNumber": "+120255501815",
        "location": [
          48.800876,
          2.047703
        ],
        "customData": ""
      },
      "location": [
        48.800876,
        2.047703
      ],
      "alias": "Customer 16",
      "firstName": "Customer16",
      "lastName": "Customer16",
      "address": {
        "country": "",
        "state": "",
        "county": "",
        "city": "",
        "postalCode": "",
        "streetName": "",
        "streetNumber": ""
      },
      "phoneNumber": "+120255501815",
      "customData": "",
      "type": 1,
      "status": 0,
      "state": 1,
      "priority": 0,
      "numberOfPackages": 1,
      "weight": 3.3,
      "cube": 0.1,
      "revenue": 8,
      "timeWindow": [
        380,
        1070
      ],
      "serviceTime": 0,
      "depotId": 0
    },
    {
      "creationTimestamp": 1752745377776,
      "customerInfo": {
        "alias": "Customer 17",
        "firstName": "Customer17",
        "lastName": "Customer17",
        "address": {
          "country": "",
          "state": "",
          "county": "",
          "city": "",
          "postalCode": "",
          "streetName": "",
          "streetNumber": ""
        },
        "email": "customer17@example.com",
        "phoneNumber": "+120255501816",
        "location": [
          48.828673,
          1.954428
        ],
        "customData": ""
      },
      "location": [
        48.828673,
        1.954428
      ],
      "alias": "Customer 17",
      "firstName": "Customer17",
      "lastName": "Customer17",
      "address": {
        "country": "",
        "state": "",
        "county": "",
        "city": "",
        "postalCode": "",
        "streetName": "",
        "streetNumber": ""
      },
      "phoneNumber": "+120255501816",
      "customData": "",
      "type": 0,
      "status": 0,
      "state": 1,
      "priority": 0,
      "numberOfPackages": 4,
      "weight": 1.4,
      "cube": 0.4,
      "revenue": 4.8,
      "timeWindow": [
        400,
        1053
      ],
      "serviceTime": 0,
      "depotId": 0
    },
    {
      "creationTimestamp": 1752745377776,
      "customerInfo": {
        "alias": "Customer 18",
        "firstName": "Customer18",
        "lastName": "Customer18",
        "address": {
          "country": "",
          "state": "",
          "county": "",
          "city": "",
          "postalCode": "",
          "streetName": "",
          "streetNumber": ""
        },
        "email": "customer18@example.com",
        "phoneNumber": "+120255501817",
        "location": [
          48.870529,
          1.966413
        ],
        "customData": ""
      },
      "location": [
        48.870529,
        1.966413
      ],
      "alias": "Customer 18",
      "firstName": "Customer18",
      "lastName": "Customer18",
      "address": {
        "country": "",
        "state": "",
        "county": "",
        "city": "",
        "postalCode": "",
        "streetName": "",
        "streetNumber": ""
      },
      "phoneNumber": "+120255501817",
      "customData": "",
      "type": 1,
      "status": 0,
      "state": 1,
      "priority": 0,
      "numberOfPackages": 8,
      "weight": 1.8,
      "cube": 1.7,
      "revenue": 15.4,
      "timeWindow": [
        430,
        1020
      ],
      "serviceTime": 0,
      "depotId": 0
    },
    {
      "creationTimestamp": 1752745377776,
      "customerInfo": {
        "alias": "Customer 19",
        "firstName": "Customer19",
        "lastName": "Customer19",
        "address": {
          "country": "",
          "state": "",
          "county": "",
          "city": "",
          "postalCode": "",
          "streetName": "",
          "streetNumber": ""
        },
        "email": "customer19@example.com",
        "phoneNumber": "+120255501818",
        "location": [
          48.885094,
          2.298155
        ],
        "customData": ""
      },
      "location": [
        48.885094,
        2.298155
      ],
      "alias": "Customer 19",
      "firstName": "Customer19",
      "lastName": "Customer19",
      "address": {
        "country": "",
        "state": "",
        "county": "",
        "city": "",
        "postalCode": "",
        "streetName": "",
        "streetNumber": ""
      },
      "phoneNumber": "+120255501818",
      "customData": "",
      "type": 0,
      "status": 0,
      "state": 1,
      "priority": 0,
      "numberOfPackages": 5,
      "weight": 1.3,
      "cube": 1.2,
      "revenue": 16.2,
      "timeWindow": [
        430,
        1020
      ],
      "serviceTime": 0,
      "depotId": 0
    },
    {
      "creationTimestamp": 1752745377776,
      "customerInfo": {
        "alias": "Customer 20",
        "firstName": "Customer20",
        "lastName": "Customer20",
        "address": {
          "country": "",
          "state": "",
          "county": "",
          "city": "",
          "postalCode": "",
          "streetName": "",
          "streetNumber": ""
        },
        "email": "customer20@example.com",
        "phoneNumber": "+120255501819",
        "location": [
          48.970061,
          2.199346
        ],
        "customData": ""
      },
      "location": [
        48.970061,
        2.199346
      ],
      "alias": "Customer 20",
      "firstName": "Customer20",
      "lastName": "Customer20",
      "address": {
        "country": "",
        "state": "",
        "county": "",
        "city": "",
        "postalCode": "",
        "streetName": "",
        "streetNumber": ""
      },
      "phoneNumber": "+120255501819",
      "customData": "",
      "type": 0,
      "status": 0,
      "state": 1,
      "priority": 0,
      "numberOfPackages": 3,
      "weight": 3.5,
      "cube": 0.6,
      "revenue": 29.1,
      "timeWindow": [
        435,
        1020
      ],
      "serviceTime": 0,
      "depotId": 0
    }
  ],
  "departures": [
    {
      "depotId": 0,
      "alias": "Depot 1",
      "location": [
        48.850315,
        2.326157
      ],
      "address": {
        "country": "France",
        "state": "Ile-de-France",
        "county": "Paris",
        "city": "Paris",
        "postalCode": "75001",
        "streetName": "Rue de Rivoli",
        "streetNumber": "1"
      }
    },
    {
      "depotId": 0,
      "alias": "Depot 2",
      "location": [
        8.826995,
        2.13394
      ],
      "address": {
        "country": "France",
        "state": "Ile-de-France",
        "county": "Paris",
        "city": "Paris",
        "postalCode": "75002",
        "streetName": "Rue de Richelieu",
        "streetNumber": "2"
      }
    }
  ],
  "destinations": [
    {
      "alias": "Destination 1",
      "location": [
        48.85453,
        2.385119
      ],
      "address": {
        "country": "France",
        "state": "Ile-de-France",
        "county": "Paris",
        "city": "Paris",
        "postalCode": "75001",
        "streetName": "Rue de Rivoli",
        "streetNumber": "1"
      }
    },
    {
      "alias": "Destination 2",
      "location": [
        48.949147,
        2.254177
      ],
      "address": {
        "country": "France",
        "state": "Ile-de-France",
        "county": "Paris",
        "city": "Paris",
        "postalCode": "75002",
        "streetName": "Rue de Richelieu",
        "streetNumber": "2"
      }
    }
  ],
  "vehicles": [
    {
      "id": 135933,
      "type": 0,
      "status": 0,
      "name": "Car vehicle 1",
      "manufacturer": "Renault",
      "model": "Master",
      "fuelType": 2,
      "lastPosition": [
        48.870569,
        2.356448
      ],
      "consumption": 6.5,
      "plate": "AA-123-AA",
      "maxLoadWeight": 60,
      "maxLoadCube": 50,
      "height": 0,
      "width": 0,
      "weight": 0,
      "length": 0,
      "axleLoad": 0,
      "fixedCost": 0,
      "costPerHour": 0,
      "startTime": 420,
      "endTime": 1439
    },
    {
      "id": 135932,
      "type": 0,
      "status": 0,
      "name": "Car vehicle 2",
      "manufacturer": "Renault",
      "model": "Master",
      "fuelType": 2,
      "lastPosition": [
        48.82674,
        2.342116
      ],
      "consumption": 6.5,
      "plate": "AA-124-AA",
      "maxLoadWeight": 60,
      "maxLoadCube": 50,
      "height": 0,
      "width": 0,
      "weight": 0,
      "length": 0,
      "axleLoad": 0,
      "fixedCost": 0,
      "costPerHour": 0,
      "startTime": 420,
      "endTime": 1439
    }
  ],
  "vehiclesConstraints": [
    {
      "fuelPrice": 1.09,
      "startDate": 1596758400000,
      "maxNumberOfPackages": 53,
      "minNumberOfOrders": 0,
      "maxNumberOfOrders": 99999999,
      "minDistance": 0,
      "maxDistance": 99999999,
      "maxRevenue": 85
    }
  ],
  "configurationParameters": {
    "name": "Paris - test optimization",
    "ignoreTimeWindow": false,
    "allowDroppingOrders": false,
    "groupingOrders": false,
    "balancedRoutes": 0,
    "optimizationCriterion": 0,
    "arrangeCriterion": 0,
    "optimizationQuality": 2,
    "maxTimeToOptimize": 300,
    "maxWaitTime": 8000,
    "routeType": 0,
    "restrictions": 0,
    "distanceUnit": 0,
    "orderSequenceOptions": []
  },
  "creationTimestamp": 1752745377776,
  "matrixBuildType": 1,
  "request": {
    "id": 1234,
    "optimizationId": 12345,
    "status": 1,
    "message": "Operation done successfully!",
    "creationTimestamp": 1752745377776
  }
}

```

### Step 2: Reoptimize the Optimization[​](#step-2-reoptimize-the-optimization "Direct link to Step 2: Reoptimize the Optimization")

* **Description:** Creates a new and improved solution (if one exists) for the optimization. Reoptimizing an existing optimization returns a `request` object, which can be used to track the status of the process. Once the request status is marked as *finished*, the new solution can be retrieved using the [Get Optimization's Solution](/docs/cloud-rest-api/guides/fleet-management/core-concepts/optimization.md#7-get-optimizations-solution) endpoint. The latest fuel prices are used in generating the new solution (see [Get Fuel Prices](/docs/cloud-rest-api/guides/fleet-management/core-concepts/fuelprice.md)).

* **Method:** `POST`

* **Endpoint:** `/optimizations/{id}/reoptimize`

* **Headers:**

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

* **URL:** `https://fleetmanagement.magiclaneapis.com/v1/optimizations/{id}/reoptimize`

* **Path Parameter:**

  * `id` (integer, \**required*) - The unique optimization ID.

  * **Query Parameter:**

  * `encodeShape` (integer, *optional*)

    <!-- -->

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

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

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

```json
[
  {
    "id": 23423,
    "optimizationId": 137211,
    "routeId": 0,
    "status": 0,
    "message": "Operation done successfully!",
    "creationTimestamp": 123456
  }
]

```

### Step 3: Retrieve the Reoptimized Solution[​](#step-3-retrieve-the-reoptimized-solution "Direct link to Step 3: Retrieve the Reoptimized Solution")

After the reoptimization process is complete, you can retrieve the new solution.

* **Method:** `GET`

* **Endpoint:** `/optimizations/{id}/solution`

* **Headers:**
  * `Authorization: YOUR_API_KEY`

* **Path Parameter:**
  * `id` (integer, \**required*) - The unique optimization ID.

* **Query Parameter:**

  * `encodeShape` (integer, *optional*)

    <!-- -->

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

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

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

```json
{
  "totalRecords": 1,
  "routes": [
    {
      "configurationParameters": {
        "orderSequenceOptions": [
        ],
        "distanceUnit": 0,
        "maxTimeToOptimize": 300,
        "optimizationQuality": 2,
        "routeType": 0,
        "arrangeCriterion": 0,
        "restrictions": 0,
        "maxWaitTime": 18000,
        "balancedRoutes": 0,
        "groupingOrders": false,
        "optimizationCriterion": 0,
        "allowDroppingOrders": false,
        "ignoreTimeWindow": false,
        "name": "Paris - test optimization - Part 1"
      },
      "vehicleConstraints": {
        "startDate": 1596758400000,
        "maxNumberOfPackages": 53,
        "minNumberOfOrders": 0,
        "maxNumberOfOrders": 99999999,
        "minDistance": 0.0,
        "maxDistance": 100000000.0,
        "maxRevenue": 85.0,
        "fuelPrice": 1.0700000524520874023
      },
      "rideStatus": 1,
      "vehicle": {
        "length": 0.0,
        "weight": 0.0,
        "width": 0.0,
        "licensePlate": "",
        "consumption": 6.5,
        "fuelType": 2,
        "make": "",
        "id": 134764,
        "name": "Car vehicle",
        "model": "",
        "costPerHour": 0.0,
        "type": 0,
        "status": 0,
        "maxLoadWeight": 60.0,
        "height": 0.0,
        "maxLoadCube": 50.0,
        "idDriver": 134764,
        "endTime": 1439,
        "fixedCost": 0.0,
        "startTime": 420,
        "lastPosition": [
          2147483647.0,
          2147483647.0
        ]
      },
      "destination": {
        "depotId": 0,
        "alias": "Departure2",
        "address": {
          "streetNumber": "34",
          "postalCode": "86000",
          "streetName": "Boulevard Chasseigne",
          "county": "Nouvelle-Aquitaine",
          "state": "",
          "extra": "",
          "city": "Poitiers",
          "country": "France"
        },
        "location": [
          48.826740000000000919,
          2.3421159999999998647
        ],
        "matchedLocation": [
          48.826793750000000216,
          2.3420853125000000716
        ],
        "arrivalTime": 1596783691000,
        "traveledDistance": 0.66383504867553710938
      },
      "departure": {
        "depotId": 0,
        "alias": "Departure2",
        "address": {
          "streetNumber": "34",
          "postalCode": "86000",
          "streetName": "Boulevard Chasseigne",
          "county": "Nouvelle-Aquitaine",
          "state": "",
          "extra": "",
          "city": "Poitiers",
          "country": "France"
        },
        "location": [
          48.826740000000000919,
          2.3421159999999998647
        ],
        "matchedLocation": [
          48.826793750000000216,
          2.3420853125000000716
        ],
        "numberOfpackages": 0,
        "weight": 0.0,
        "cube": 0.0,
        "departureTime": 1596783600000,
        "timeToNext": 12,
        "distanceToNext": 0.070194996893405914307
      },
      "shape": "mn_iH_mhMCVuGuBQIy@s@SDOLIxFzAOlAIfHJJi@mAa@BW",
      "creationTimestamp": 1742220618730,
      "neededFuel": 0.043149281293153762817,
      "matrixBuildType": 1,
      "price": 0.046169731765985488892,
      "totalWaitTime": 0,
      "totalServiceTime": 0,
      "optimizationId": 137211,
      "orders": [
        {
          "orderInfo": {
            "revenue": 0.0,
            "serviceTime": 0,
            "timeWindow": [
              1596783600000,
              1596823600000
            ],
            "creationTimestamp": 1742220613856,
            "cube": 0.0,
            "numberOfPackages": 0,
            "depotId": 0,
            "customData": "",
            "weight": 0.0,
            "phoneNumber": "+12025550181",
            "lastName": "",
            "status": 1,
            "firstName": "",
            "alias": "",
            "state": 1,
            "type": 0,
            "priority": 0,
            "id": 876534,
            "location": [
              48.827326999999996815,
              2.3422670000000000989
            ],
            "address": {
              "streetNumber": "",
              "postalCode": "",
              "streetName": "",
              "county": "",
              "state": "",
              "extra": "",
              "city": "",
              "country": ""
            },
            "customerInfo": {
              "phoneNumber": "+12025550181",
              "email": "c1@yahoo.com",
              "lastName": "",
              "firstName": "",
              "alias": "",
              "customData": "",
              "id": 1786643,
              "location": [
                48.827326999999996815,
                2.3422670000000000989
              ],
              "address": {
                "streetNumber": "",
                "postalCode": "",
                "streetName": "",
                "county": "",
                "state": "",
                "extra": "",
                "city": "",
                "country": ""
              }
            }
          },
          "matchedLocation": [
            48.827346249999997951,
            2.3421875000000000888
          ],
          "actualLocation": [
            0.0,
            0.0
          ],
          "indexInRoute": 0,
          "indexInOptimization": 1,
          "arrivalTime": 1596783612000,
          "timeToNextOrder": 79,
          "waitTime": 0,
          "numberOfPackagesAtArrival": 0,
          "collectedNumberOfPackages": 0,
          "deliveredNumberOfPackages": 0,
          "weightAtArrival": 0.0,
          "collectedWeight": 0.0,
          "deliveredWeight": 0.0,
          "cubeAtArrival": 0.0,
          "collectedCube": 0.0,
          "deliveredCube": 0.0,
          "traveledDistance": 0.070194996893405914307,
          "distanceToNextOrder": 0.5936400294303894043,
          "revenueAtArrival": 0.0,
          "visitTimestamp": 0
        }
      ],
      "totalTime": 91,
      "totalDistance": 0.66383504867553710938,
      "id": 250806
    },
    {
      "configurationParameters": {
        "orderSequenceOptions": [
        ],
        "distanceUnit": 0,
        "maxTimeToOptimize": 300,
        "optimizationQuality": 2,
        "routeType": 0,
        "arrangeCriterion": 0,
        "restrictions": 0,
        "maxWaitTime": 18000,
        "balancedRoutes": 0,
        "groupingOrders": false,
        "optimizationCriterion": 0,
        "allowDroppingOrders": false,
        "ignoreTimeWindow": false,
        "name": "Paris - test optimization - Part 0"
      },
      "vehicleConstraints": {
        "startDate": 1596758400000,
        "maxNumberOfPackages": 53,
        "minNumberOfOrders": 0,
        "maxNumberOfOrders": 99999999,
        "minDistance": 0.0,
        "maxDistance": 100000000.0,
        "maxRevenue": 85.0,
        "fuelPrice": 1.0700000524520874023
      },
      "rideStatus": 1,
      "vehicle": {
        "length": 0.0,
        "weight": 0.0,
        "width": 0.0,
        "licensePlate": "",
        "consumption": 6.5,
        "fuelType": 2,
        "make": "",
        "id": 134763,
        "name": "Car vehicle",
        "model": "",
        "costPerHour": 0.0,
        "type": 0,
        "status": 0,
        "maxLoadWeight": 60.0,
        "height": 0.0,
        "maxLoadCube": 50.0,
        "idDriver": 134763,
        "endTime": 1439,
        "fixedCost": 0.0,
        "startTime": 420,
        "lastPosition": [
          2147483647.0,
          2147483647.0
        ]
      },
      "destination": {
        "depotId": 0,
        "alias": "Departure1",
        "address": {
          "streetNumber": "34",
          "postalCode": "86000",
          "streetName": "Boulevard Chasseigne",
          "county": "Nouvelle-Aquitaine",
          "state": "",
          "extra": "",
          "city": "Poitiers",
          "country": "France"
        },
        "location": [
          48.870569000000003257,
          2.3564479999999998761
        ],
        "matchedLocation": [
          48.870568437499997572,
          2.356441562500000142
        ],
        "arrivalTime": 1596819173000,
        "traveledDistance": 42.916095733642578125
      },
      "departure": {
        "depotId": 0,
        "alias": "Departure1",
        "address": {
          "streetNumber": "34",
          "postalCode": "86000",
          "streetName": "Boulevard Chasseigne",
          "county": "Nouvelle-Aquitaine",
          "state": "",
          "extra": "",
          "city": "Poitiers",
          "country": "France"
        },
        "location": [
          48.870569000000003257,
          2.3564479999999998761
        ],
        "matchedLocation": [
          48.870568437499997572,
          2.356441562500000142
        ],
        "numberOfpackages": 34,
        "weight": 49.200000762939453125,
        "cube": 21.600000381469726562,
        "departureTime": 1596784763530,
        "timeToNext": 836,
        "distanceToNext": 6.0698499679565429688
      },
      "shape": "a`hiHwfkM`GxCBKHMHCd@LZyB|@mLd@wFd@uGf@qF|AcDbAkBhA_Cl@yAXDPC`SeKxr@mK`C_@lA[j@CD\\J^LJZPn@RdBdB~C~@zWnJPLRTZz@JLPJJ@l@M^MdBwA|CuDh@w@pB_DpA}BZ{@TcBTu@N[dHkK`CcD`JwK~EsFpDyEx@_AjB_BpJkMv@qAPCvGiJ~FpM~EuGtAnE`BiAJChBbGdC{BvAnEdGwFlDkD`@WlAwCFc@HWaBsGs@gC}BiGOUUYaGqOm@gB}@}C[wBc@wAaAoCW{@q@}CoBeN_@}Bo@wCc@_BaBaFcAhBQD_FwHwS{Zq@_@ip@qLmEdOjC|BMPER?^HVFHNFPELMFYAc@EOGIGqA~Bcn@eFaA{EeAu@UWWCGAi@\\aKL_AZSRc@Ha@Bc@Am@Ku@Uc@SEU@QHILwDKsHIkDi@}AK_BDsBb@kGxCs@XkAXcCb@cC@qJi@}FSoC?kEXyFf@iEf@kK|@oBHaCDqZOaDHmAHoAZoAb@wCvAcCzAgFnEcFtDuTjLk@^kApAcAzAc@|@iA|C]tAkB~Jm@bCe@vAo@tAc@p@yLnP}@hA}@~@eA`A}@l@iAn@{Bv@wE|@sLjBuFhAmZtFGBsLnBkA\\oAf@}@j@a@^{@|@w@hAm@n@m@`Ak@nAeAtEIt@g@rFu@T[g@p@sIyHgLm@f@uEkHhE_RhBcQXqA`BwDDTEUs@~Am@vAYpAoA~LvGxJzC|E{@~@WP{CvCQXqCjCm@f@{@~@QVoAnAm@^XTvM|Nd@pAJp@JjASf@Id@Ah@Df@Lb@HNVZZLX?l@d@LNp@tBJh@D\\?^Ed@Mf@w@vBU`A]~AIl@Gj@AjAVxFP`GJ`BBrKEpEOxEq@xOOjDAxAKx[IxFAxGBdEIpc@GfDg@nPGvC?nGP~ZOn@CzAFhJMbB@pAtA@JALOlGAbFQTIN@DCNWbAw@LxAFELBnFxChANAaCHb[{BdCi@f@Qj@QHa@ZvDpj@d@vHJnCUxBmIiBe@ODv@BzCHzLApA@pDD`BDzG@h@Dj@NpANr@lCvJXvAdAtD^YcAyDm@aBaCuIS_AMoACaE]M@hC@h@Dj@NpANr@lCvJXvAv@rCl@dBvA`Fd@jBRfAdAdED\\H\\~@lDPf@Md@Yt@oC|F}BrEsCvBQ?l@`Cx@pCf@vAlArEdApC~@xBxHtNpAtExA~C\\V\\v@YXi@v@sGnJa@r@qC`EqBrCoAlAaIzGvCrMqLhIoArKlD|PjHjYlA`E~n@sj@`GzOGRBTFHF@HClC|GDPEPCXFTNJREJU@SCMb@u@lMcOjEcG{E}It@_TdAsAbAgAVUjDaE|BcCxE_GuAwE~C{FhAmBaBeA`BdAnEcI{AkLp@{A~CuHHAFI?MAIbCuG~DmFLI|IsIp@kAHAV_@r@qA~@kAbBkBn@zCfBmH^kBbDgQZsANa@~KrHdF~ChAEjg@tCKzI?pFcHYEo@e@gECg@CmJEeCA{HEeE?mC@}@\\aAj@mCk@[gGcEGYEMe@]MGUCgBRICiEuCm@o@Qk@s@cAWSmNiJFe@Gy@u@aHIGgB}RiByQrA_@QaBFWnGkl@oEoB{@wKK@oBc@bBgP_CeAbA_LdBkNdDsVc[sNgCkA_Ai@pEyDxAn@dPdI",
      "creationTimestamp": 1742220618581,
      "neededFuel": 2.7895462512969970703,
      "matrixBuildType": 1,
      "price": 2.9848146438598632812,
      "totalWaitTime": 21114,
      "totalServiceTime": 7400,
      "optimizationId": 137211,
      "orders": [
        {
          "orderInfo": {
            "revenue": 14.699999809265136719,
            "serviceTime": 750,
            "timeWindow": [
              1596803600000,
              1596823600000
            ],
            "creationTimestamp": 1742220614098,
            "cube": 4.5999999046325683594,
            "numberOfPackages": 11,
            "depotId": 0,
            "customData": "",
            "weight": 12.100000381469726562,
            "phoneNumber": "+12025550181",
            "lastName": "",
            "status": 1,
            "firstName": "",
            "alias": "",
            "state": 1,
            "type": 1,
            "priority": 0,
            "id": 876540,
            "location": [
              48.827865000000002738,
              2.3792159999999999975
            ],
            "address": {
              "streetNumber": "",
              "postalCode": "",
              "streetName": "",
              "county": "",
              "state": "",
              "extra": "",
              "city": "",
              "country": ""
            },
            "customerInfo": {
              "phoneNumber": "+12025550181",
              "email": "c7@yahoo.com",
              "lastName": "",
              "firstName": "",
              "alias": "",
              "customData": "",
              "id": 1786649,
              "location": [
                48.827865000000002738,
                2.3792159999999999975
              ],
              "address": {
                "streetNumber": "",
                "postalCode": "",
                "streetName": "",
                "county": "",
                "state": "",
                "extra": "",
                "city": "",
                "country": ""
              }
            }
          },
          "matchedLocation": [
            48.827919999999998879,
            2.3791415625000000844
          ],
          "actualLocation": [
            0.0,
            0.0
          ],
          "indexInRoute": 0,
          "indexInOptimization": 7,
          "arrivalTime": 1596803600000,
          "timeToNextOrder": 535,
          "waitTime": 16715,
          "numberOfPackagesAtArrival": 34,
          "collectedNumberOfPackages": 0,
          "deliveredNumberOfPackages": 11,
          "weightAtArrival": 49.200000762939453125,
          "collectedWeight": 0.0,
          "deliveredWeight": 12.100000381469726562,
          "cubeAtArrival": 21.600000381469726562,
          "collectedCube": 0.0,
          "deliveredCube": 4.5999999046325683594,
          "traveledDistance": 6.0698499679565429688,
          "distanceToNextOrder": 3.6211578845977783203,
          "revenueAtArrival": 0.0,
          "visitTimestamp": 0
        },
        {
          "orderInfo": {
            "revenue": 2.7000000476837158203,
            "serviceTime": 200,
            "timeWindow": [
              1596803600000,
              1596820600000
            ],
            "creationTimestamp": 1742220613938,
            "cube": 5.8000001907348632812,
            "numberOfPackages": 8,
            "depotId": 0,
            "customData": "",
            "weight": 15.399999618530273438,
            "phoneNumber": "+12025550181",
            "lastName": "",
            "status": 1,
            "firstName": "",
            "alias": "",
            "state": 1,
            "type": 1,
            "priority": 0,
            "id": 876536,
            "location": [
              48.845198000000003447,
              2.4028960000000001429
            ],
            "address": {
              "streetNumber": "",
              "postalCode": "",
              "streetName": "",
              "county": "",
              "state": "",
              "extra": "",
              "city": "",
              "country": ""
            },
            "customerInfo": {
              "phoneNumber": "+12025550181",
              "email": "c3@yahoo.com",
              "lastName": "",
              "firstName": "",
              "alias": "",
              "customData": "",
              "id": 1786645,
              "location": [
                48.845198000000003447,
                2.4028960000000001429
              ],
              "address": {
                "streetNumber": "",
                "postalCode": "",
                "streetName": "",
                "county": "",
                "state": "",
                "extra": "",
                "city": "",
                "country": ""
              }
            }
          },
          "matchedLocation": [
            48.845262499999996919,
            2.4027009375000001334
          ],
          "actualLocation": [
            0.0,
            0.0
          ],
          "indexInRoute": 1,
          "indexInOptimization": 3,
          "arrivalTime": 1596803600000,
          "timeToNextOrder": 855,
          "waitTime": 945,
          "numberOfPackagesAtArrival": 23,
          "collectedNumberOfPackages": 0,
          "deliveredNumberOfPackages": 8,
          "weightAtArrival": 37.09999847412109375,
          "collectedWeight": 0.0,
          "deliveredWeight": 15.399999618530273438,
          "cubeAtArrival": 17.0,
          "collectedCube": 0.0,
          "deliveredCube": 5.8000001907348632812,
          "traveledDistance": 9.6910076141357421875,
          "distanceToNextOrder": 9.2198839187622070312,
          "revenueAtArrival": 14.699999809265136719,
          "visitTimestamp": 0
        },
        {
          "orderInfo": {
            "revenue": 10.0,
            "serviceTime": 900,
            "timeWindow": [
              1596805600000,
              1596821600000
            ],
            "creationTimestamp": 1742220614023,
            "cube": 9.6999998092651367188,
            "numberOfPackages": 9,
            "depotId": 0,
            "customData": "",
            "weight": 16.5,
            "phoneNumber": "+12025550181",
            "lastName": "",
            "status": 1,
            "firstName": "",
            "alias": "",
            "state": 1,
            "type": 1,
            "priority": 0,
            "id": 876538,
            "location": [
              48.900919999999999277,
              2.4000390000000000335
            ],
            "address": {
              "streetNumber": "",
              "postalCode": "",
              "streetName": "",
              "county": "",
              "state": "",
              "extra": "",
              "city": "",
              "country": ""
            },
            "customerInfo": {
              "phoneNumber": "+12025550181",
              "email": "c5@yahoo.com",
              "lastName": "",
              "firstName": "",
              "alias": "",
              "customData": "",
              "id": 1786647,
              "location": [
                48.900919999999999277,
                2.4000390000000000335
              ],
              "address": {
                "streetNumber": "",
                "postalCode": "",
                "streetName": "",
                "county": "",
                "state": "",
                "extra": "",
                "city": "",
                "country": ""
              }
            }
          },
          "matchedLocation": [
            48.900595937500000332,
            2.4000474999999998893
          ],
          "actualLocation": [
            0.0,
            0.0
          ],
          "indexInRoute": 2,
          "indexInOptimization": 5,
          "arrivalTime": 1596805600000,
          "timeToNextOrder": 646,
          "waitTime": 3454,
          "numberOfPackagesAtArrival": 15,
          "collectedNumberOfPackages": 0,
          "deliveredNumberOfPackages": 9,
          "weightAtArrival": 21.699998855590820312,
          "collectedWeight": 0.0,
          "deliveredWeight": 16.5,
          "cubeAtArrival": 11.199999809265136719,
          "collectedCube": 0.0,
          "deliveredCube": 9.6999998092651367188,
          "traveledDistance": 18.910892486572265625,
          "distanceToNextOrder": 5.517826080322265625,
          "revenueAtArrival": 17.399999618530273438,
          "visitTimestamp": 0
        },
        {
          "orderInfo": {
            "revenue": 2.2999999523162841797,
            "serviceTime": 600,
            "timeWindow": [
              1596810600000,
              1596819600000
            ],
            "creationTimestamp": 1742220614238,
            "cube": 11.5,
            "numberOfPackages": 6,
            "depotId": 0,
            "customData": "",
            "weight": 4.8000001907348632812,
            "phoneNumber": "+12025550181",
            "lastName": "",
            "status": 1,
            "firstName": "",
            "alias": "",
            "state": 1,
            "type": 0,
            "priority": 0,
            "id": 876544,
            "location": [
              48.895657999999997401,
              2.3440430000000000987
            ],
            "address": {
              "streetNumber": "",
              "postalCode": "",
              "streetName": "",
              "county": "",
              "state": "",
              "extra": "",
              "city": "",
              "country": ""
            },
            "customerInfo": {
              "phoneNumber": "+12025550181",
              "email": "c11@yahoo.com",
              "lastName": "",
              "firstName": "",
              "alias": "",
              "customData": "",
              "id": 1786653,
              "location": [
                48.895657999999997401,
                2.3440430000000000987
              ],
              "address": {
                "streetNumber": "",
                "postalCode": "",
                "streetName": "",
                "county": "",
                "state": "",
                "extra": "",
                "city": "",
                "country": ""
              }
            }
          },
          "matchedLocation": [
            48.895803437499999688,
            2.3440406249999998778
          ],
          "actualLocation": [
            0.0,
            0.0
          ],
          "indexInRoute": 3,
          "indexInOptimization": 11,
          "arrivalTime": 1596810600000,
          "timeToNextOrder": 413,
          "waitTime": 0,
          "numberOfPackagesAtArrival": 6,
          "collectedNumberOfPackages": 6,
          "deliveredNumberOfPackages": 0,
          "weightAtArrival": 5.1999988555908203125,
          "collectedWeight": 4.8000001907348632812,
          "deliveredWeight": 0.0,
          "cubeAtArrival": 1.5,
          "collectedCube": 11.5,
          "deliveredCube": 0.0,
          "traveledDistance": 24.42871856689453125,
          "distanceToNextOrder": 2.5389571189880371094,
          "revenueAtArrival": 27.399999618530273438,
          "visitTimestamp": 0
        },
        {
          "orderInfo": {
            "revenue": 8.1000003814697265625,
            "serviceTime": 1000,
            "timeWindow": [
              1596808600000,
              1596821600000
            ],
            "creationTimestamp": 1742220614166,
            "cube": 7.5,
            "numberOfPackages": 13,
            "depotId": 0,
            "customData": "",
            "weight": 6.3000001907348632812,
            "phoneNumber": "+12025550181",
            "lastName": "",
            "status": 1,
            "firstName": "",
            "alias": "",
            "state": 1,
            "type": 0,
            "priority": 0,
            "id": 876542,
            "location": [
              48.896894000000003189,
              2.3215859999999999275
            ],
            "address": {
              "streetNumber": "",
              "postalCode": "",
              "streetName": "",
              "county": "",
              "state": "",
              "extra": "",
              "city": "",
              "country": ""
            },
            "customerInfo": {
              "phoneNumber": "+12025550181",
              "email": "c9@yahoo.com",
              "lastName": "",
              "firstName": "",
              "alias": "",
              "customData": "",
              "id": 1786651,
              "location": [
                48.896894000000003189,
                2.3215859999999999275
              ],
              "address": {
                "streetNumber": "",
                "postalCode": "",
                "streetName": "",
                "county": "",
                "state": "",
                "extra": "",
                "city": "",
                "country": ""
              }
            }
          },
          "matchedLocation": [
            48.897175937500001908,
            2.3212631250000002048
          ],
          "actualLocation": [
            0.0,
            0.0
          ],
          "indexInRoute": 4,
          "indexInOptimization": 9,
          "arrivalTime": 1596811613000,
          "timeToNextOrder": 447,
          "waitTime": 0,
          "numberOfPackagesAtArrival": 12,
          "collectedNumberOfPackages": 13,
          "deliveredNumberOfPackages": 0,
          "weightAtArrival": 9.9999990463256835938,
          "collectedWeight": 6.3000001907348632812,
          "deliveredWeight": 0.0,
          "cubeAtArrival": 13.0,
          "collectedCube": 7.5,
          "deliveredCube": 0.0,
          "traveledDistance": 26.967676162719726562,
          "distanceToNextOrder": 3.1248729228973388672,
          "revenueAtArrival": 29.699998855590820312,
          "visitTimestamp": 0
        },
        {
          "orderInfo": {
            "revenue": 7.5,
            "serviceTime": 600,
            "timeWindow": [
              1596802600000,
              1596823600000
            ],
            "creationTimestamp": 1742220613984,
            "cube": 8.3999996185302734375,
            "numberOfPackages": 9,
            "depotId": 0,
            "customData": "",
            "weight": 16.200000762939453125,
            "phoneNumber": "+12025550181",
            "lastName": "",
            "status": 1,
            "firstName": "",
            "alias": "",
            "state": 1,
            "type": 0,
            "priority": 0,
            "id": 876537,
            "location": [
              48.897162999999999045,
              2.2928649999999999309
            ],
            "address": {
              "streetNumber": "",
              "postalCode": "",
              "streetName": "",
              "county": "",
              "state": "",
              "extra": "",
              "city": "",
              "country": ""
            },
            "customerInfo": {
              "phoneNumber": "+12025550181",
              "email": "c4@yahoo.com",
              "lastName": "",
              "firstName": "",
              "alias": "",
              "customData": "",
              "id": 1786646,
              "location": [
                48.897162999999999045,
                2.2928649999999999309
              ],
              "address": {
                "streetNumber": "",
                "postalCode": "",
                "streetName": "",
                "county": "",
                "state": "",
                "extra": "",
                "city": "",
                "country": ""
              }
            }
          },
          "matchedLocation": [
            48.897063750000000937,
            2.2924699999999997857
          ],
          "actualLocation": [
            0.0,
            0.0
          ],
          "indexInRoute": 5,
          "indexInOptimization": 4,
          "arrivalTime": 1596813060000,
          "timeToNextOrder": 404,
          "waitTime": 0,
          "numberOfPackagesAtArrival": 25,
          "collectedNumberOfPackages": 9,
          "deliveredNumberOfPackages": 0,
          "weightAtArrival": 16.299999237060546875,
          "collectedWeight": 16.200000762939453125,
          "deliveredWeight": 0.0,
          "cubeAtArrival": 20.5,
          "collectedCube": 8.3999996185302734375,
          "deliveredCube": 0.0,
          "traveledDistance": 30.092548370361328125,
          "distanceToNextOrder": 2.4328789710998535156,
          "revenueAtArrival": 37.799999237060546875,
          "visitTimestamp": 0
        },
        {
          "orderInfo": {
            "revenue": 2.9000000953674316406,
            "serviceTime": 800,
            "timeWindow": [
              1596804600000,
              1596822600000
            ],
            "creationTimestamp": 1742220614132,
            "cube": 1.5,
            "numberOfPackages": 6,
            "depotId": 0,
            "customData": "",
            "weight": 5.1999998092651367188,
            "phoneNumber": "+12025550181",
            "lastName": "",
            "status": 1,
            "firstName": "",
            "alias": "",
            "state": 1,
            "type": 1,
            "priority": 0,
            "id": 876541,
            "location": [
              48.887095999999999663,
              2.283513000000000126
            ],
            "address": {
              "streetNumber": "",
              "postalCode": "",
              "streetName": "",
              "county": "",
              "state": "",
              "extra": "",
              "city": "",
              "country": ""
            },
            "customerInfo": {
              "phoneNumber": "+12025550181",
              "email": "c8@yahoo.com",
              "lastName": "",
              "firstName": "",
              "alias": "",
              "customData": "",
              "id": 1786650,
              "location": [
                48.887095999999999663,
                2.283513000000000126
              ],
              "address": {
                "streetNumber": "",
                "postalCode": "",
                "streetName": "",
                "county": "",
                "state": "",
                "extra": "",
                "city": "",
                "country": ""
              }
            }
          },
          "matchedLocation": [
            48.886898125000001869,
            2.2838078125000000895
          ],
          "actualLocation": [
            0.0,
            0.0
          ],
          "indexInRoute": 6,
          "indexInOptimization": 8,
          "arrivalTime": 1596814064000,
          "timeToNextOrder": 354,
          "waitTime": 0,
          "numberOfPackagesAtArrival": 34,
          "collectedNumberOfPackages": 0,
          "deliveredNumberOfPackages": 6,
          "weightAtArrival": 32.5,
          "collectedWeight": 0.0,
          "deliveredWeight": 5.1999998092651367188,
          "cubeAtArrival": 28.899999618530273438,
          "collectedCube": 0.0,
          "deliveredCube": 1.5,
          "traveledDistance": 32.52542877197265625,
          "distanceToNextOrder": 1.826871037483215332,
          "revenueAtArrival": 45.299999237060546875,
          "visitTimestamp": 0
        },
        {
          "orderInfo": {
            "revenue": 12.0,
            "serviceTime": 600,
            "timeWindow": [
              1596804600000,
              1596819600000
            ],
            "creationTimestamp": 1742220613899,
            "cube": 2.5,
            "numberOfPackages": 3,
            "depotId": 0,
            "customData": "",
            "weight": 5.0999999046325683594,
            "phoneNumber": "+12025550181",
            "lastName": "",
            "status": 1,
            "firstName": "",
            "alias": "",
            "state": 1,
            "type": 0,
            "priority": 0,
            "id": 876535,
            "location": [
              48.880249999999996646,
              2.2996010000000000062
            ],
            "address": {
              "streetNumber": "",
              "postalCode": "",
              "streetName": "",
              "county": "",
              "state": "",
              "extra": "",
              "city": "",
              "country": ""
            },
            "customerInfo": {
              "phoneNumber": "+12025550181",
              "email": "c2@yahoo.com",
              "lastName": "",
              "firstName": "",
              "alias": "",
              "customData": "",
              "id": 1786644,
              "location": [
                48.880249999999996646,
                2.2996010000000000062
              ],
              "address": {
                "streetNumber": "",
                "postalCode": "",
                "streetName": "",
                "county": "",
                "state": "",
                "extra": "",
                "city": "",
                "country": ""
              }
            }
          },
          "matchedLocation": [
            48.880213437499996587,
            2.2997093749999999446
          ],
          "actualLocation": [
            0.0,
            0.0
          ],
          "indexInRoute": 7,
          "indexInOptimization": 2,
          "arrivalTime": 1596815218000,
          "timeToNextOrder": 484,
          "waitTime": 0,
          "numberOfPackagesAtArrival": 28,
          "collectedNumberOfPackages": 3,
          "deliveredNumberOfPackages": 0,
          "weightAtArrival": 27.299999237060546875,
          "collectedWeight": 5.0999999046325683594,
          "deliveredWeight": 0.0,
          "cubeAtArrival": 27.399999618530273438,
          "collectedCube": 2.5,
          "deliveredCube": 0.0,
          "traveledDistance": 34.352298736572265625,
          "distanceToNextOrder": 3.1821730136871337891,
          "revenueAtArrival": 48.200000762939453125,
          "visitTimestamp": 0
        },
        {
          "orderInfo": {
            "revenue": 13.399999618530273438,
            "serviceTime": 500,
            "timeWindow": [
              1596807600000,
              1596819600000
            ],
            "creationTimestamp": 1742220614063,
            "cube": 2.5999999046325683594,
            "numberOfPackages": 5,
            "depotId": 0,
            "customData": "",
            "weight": 7.5,
            "phoneNumber": "+12025550181",
            "lastName": "",
            "status": 1,
            "firstName": "",
            "alias": "",
            "state": 1,
            "type": 0,
            "priority": 0,
            "id": 876539,
            "location": [
              48.860914000000001067,
              2.3106249999999999289
            ],
            "address": {
              "streetNumber": "",
              "postalCode": "",
              "streetName": "",
              "county": "",
              "state": "",
              "extra": "",
              "city": "",
              "country": ""
            },
            "customerInfo": {
              "phoneNumber": "+12025550181",
              "email": "c6@yahoo.com",
              "lastName": "",
              "firstName": "",
              "alias": "",
              "customData": "",
              "id": 1786648,
              "location": [
                48.860914000000001067,
                2.3106249999999999289
              ],
              "address": {
                "streetNumber": "",
                "postalCode": "",
                "streetName": "",
                "county": "",
                "state": "",
                "extra": "",
                "city": "",
                "country": ""
              }
            }
          },
          "matchedLocation": [
            48.861119999999999663,
            2.310630624999999938
          ],
          "actualLocation": [
            0.0,
            0.0
          ],
          "indexInRoute": 8,
          "indexInOptimization": 6,
          "arrivalTime": 1596816302000,
          "timeToNextOrder": 534,
          "waitTime": 0,
          "numberOfPackagesAtArrival": 31,
          "collectedNumberOfPackages": 5,
          "deliveredNumberOfPackages": 0,
          "weightAtArrival": 32.399997711181640625,
          "collectedWeight": 7.5,
          "deliveredWeight": 0.0,
          "cubeAtArrival": 29.899999618530273438,
          "collectedCube": 2.5999999046325683594,
          "deliveredCube": 0.0,
          "traveledDistance": 37.534473419189453125,
          "distanceToNextOrder": 3.1943759918212890625,
          "revenueAtArrival": 60.200000762939453125,
          "visitTimestamp": 0
        },
        {
          "orderInfo": {
            "revenue": 6.1999998092651367188,
            "serviceTime": 850,
            "timeWindow": [
              1596812600000,
              1596819600000
            ],
            "creationTimestamp": 1742220614205,
            "cube": 4.0999999046325683594,
            "numberOfPackages": 10,
            "depotId": 0,
            "customData": "",
            "weight": 8.0,
            "phoneNumber": "+12025550181",
            "lastName": "",
            "status": 1,
            "firstName": "",
            "alias": "",
            "state": 1,
            "type": 0,
            "priority": 0,
            "id": 876543,
            "location": [
              48.870449000000000694,
              2.3422040000000001747
            ],
            "address": {
              "streetNumber": "",
              "postalCode": "",
              "streetName": "",
              "county": "",
              "state": "",
              "extra": "",
              "city": "",
              "country": ""
            },
            "customerInfo": {
              "phoneNumber": "+12025550181",
              "email": "c10@yahoo.com",
              "lastName": "",
              "firstName": "",
              "alias": "",
              "customData": "",
              "id": 1786652,
              "location": [
                48.870449000000000694,
                2.3422040000000001747
              ],
              "address": {
                "streetNumber": "",
                "postalCode": "",
                "streetName": "",
                "county": "",
                "state": "",
                "extra": "",
                "city": "",
                "country": ""
              }
            }
          },
          "matchedLocation": [
            48.870181875000000105,
            2.3423449999999998994
          ],
          "actualLocation": [
            0.0,
            0.0
          ],
          "indexInRoute": 9,
          "indexInOptimization": 10,
          "arrivalTime": 1596817336000,
          "timeToNextOrder": 381,
          "waitTime": 0,
          "numberOfPackagesAtArrival": 36,
          "collectedNumberOfPackages": 10,
          "deliveredNumberOfPackages": 0,
          "weightAtArrival": 39.899997711181640625,
          "collectedWeight": 8.0,
          "deliveredWeight": 0.0,
          "cubeAtArrival": 32.5,
          "collectedCube": 4.0999999046325683594,
          "deliveredCube": 0.0,
          "traveledDistance": 40.728851318359375,
          "distanceToNextOrder": 2.1621670722961425781,
          "revenueAtArrival": 73.59999847412109375,
          "visitTimestamp": 0
        },
        {
          "orderInfo": {
            "revenue": 0.0,
            "serviceTime": 600,
            "timeWindow": [
              1596783600000,
              1596823600000
            ],
            "creationTimestamp": 1742220613815,
            "cube": 0.0,
            "numberOfPackages": 0,
            "depotId": 0,
            "customData": "",
            "weight": 0.0,
            "phoneNumber": "+12025550181",
            "lastName": "",
            "status": 1,
            "firstName": "",
            "alias": "",
            "state": 1,
            "type": 0,
            "priority": 0,
            "id": 876533,
            "location": [
              48.870851999999999293,
              2.3561480000000001311
            ],
            "address": {
              "streetNumber": "",
              "postalCode": "",
              "streetName": "",
              "county": "",
              "state": "",
              "extra": "",
              "city": "",
              "country": ""
            },
            "customerInfo": {
              "phoneNumber": "+12025550181",
              "email": "c0@yahoo.com",
              "lastName": "",
              "firstName": "",
              "alias": "",
              "customData": "",
              "id": 1786642,
              "location": [
                48.870851999999999293,
                2.3561480000000001311
              ],
              "address": {
                "streetNumber": "",
                "postalCode": "",
                "streetName": "",
                "county": "",
                "state": "",
                "extra": "",
                "city": "",
                "country": ""
              }
            }
          },
          "matchedLocation": [
            48.87077843750000028,
            2.3565665624999998506
          ],
          "actualLocation": [
            0.0,
            0.0
          ],
          "indexInRoute": 10,
          "indexInOptimization": 0,
          "arrivalTime": 1596818567000,
          "timeToNextOrder": 6,
          "waitTime": 0,
          "numberOfPackagesAtArrival": 46,
          "collectedNumberOfPackages": 0,
          "deliveredNumberOfPackages": 0,
          "weightAtArrival": 47.899997711181640625,
          "collectedWeight": 0.0,
          "deliveredWeight": 0.0,
          "cubeAtArrival": 36.59999847412109375,
          "collectedCube": 0.0,
          "deliveredCube": 0.0,
          "traveledDistance": 42.891017913818359375,
          "distanceToNextOrder": 0.025076000019907951355,
          "revenueAtArrival": 79.79999542236328125,
          "visitTimestamp": 0
        }
      ],
      "totalTime": 34409,
      "totalDistance": 42.916095733642578125,
      "id": 250805
    }
  ]
}

```

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

This example demonstrates how to reoptimize an existing optimization to generate a new and potentially better solution. By following the steps above, you can adapt this example to your specific use case and integrate it into your fleet management workflow.
