Actions

Synchronous Solve

Changed on

Synchronous solve operation for low latency results

post/v2/vrp/sync/solve

Request

  • Base URL
    https://api.solvice.io
  • URL
    https://api.solvice.io/v2/vrp/sync/solve
  • Auth
    API key in header Authorization

Query parameters

millisstring nullable required

Request body

hookstring uri nullable

Optional webhook URL that will receive a POST request with the job ID when the optimization is complete. This enables asynchronous processing where you can submit a request and be notified when results are ready, rather than waiting for the synchronous response.

labelstring nullable
metadataobject nullable

Example request

{
  "jobs": [
    {
      "name": "1",
      "duration": 3600,
      "initialResource": "1",
      "initialArrival": "2023-01-13T09:00:00"
    },
    {
      "name": "2",
      "duration": 3600
    }
  ],
  "resources": [
    {
      "name": "1",
      "shifts": [
        {
          "from": "2023-01-13T08:00:00",
          "to": "2023-01-13T17:00:00"
        }
      ]
    }
  ]
}

Response

Solution

idstring nullable

Id of the solve job

status'ERROR' | 'QUEUED' | 'SOLVING' | 'SOLVED' nullable

Status of the solve job.

totalWaitTimeInSecondsinteger nullable

Wait time for all resources

occupancynumber double nullable

How full this schedule is in terms of work time (incl travel) over capacity. Eg 80%

totalTravelDistanceInMetersinteger nullable

Travel distance for all resources in meters

totalTravelTimeInSecondsinteger nullable

Travel time for all resources

totalServiceTimeInSecondsinteger nullable

Service time for all resources

unservedstring[] nullable

Unserved jobs

unservedReasonsobject nullable

Reasons why jobs could not be served, mapped by job name

messagesstring[] nullable

Events and warnings generated during the solver execution

workloadFairnessnumber double nullable

Example response

{
  "id": "0000-00000-00000-0000",
  "status": "SOLVED",
  "score": {
    "hardScore": 0,
    "mediumScore": 0,
    "softScore": -12345,
    "feasible": true
  },
  "trips": [
    {
      "resource": "vehicle-1",
      "date": "2023-01-13T00:00:00Z",
      "departureTime": "2023-01-13T08:00:00Z",
      "visits": [
        {
          "job": "Job-1",
          "arrival": "2023-01-13T08:30:00Z",
          "serviceTime": 600,
          "travelTime": 1800,
          "distance": 15000,
          "location": {
            "latitude": 51.0543,
            "longitude": 3.7174
          },
          "waitTime": 0
        }
      ],
      "waitTime": 0,
      "travelTime": 3600,
      "distance": 30000,
      "workTime": 4200,
      "serviceTime": 600,
      "occupancy": 0.47
    }
  ],
  "totalWaitTimeInSeconds": 0,
  "totalTravelTimeInSeconds": 3600,
  "totalTravelDistanceInMeters": 30000,
  "totalServiceTimeInSeconds": 600,
  "occupancy": 0.47,
  "workloadFairness": 0.95,
  "unserved": [],
  "suggestions": [],
  "messages": [
    "Solution found in 2.5 seconds"
  ]
}

Changes

    • breaking

      the query request parameter millis became required

    • breaking

      added the pattern ^(?!.*\$\{)[^<>"';\\\x00]*$ to the request property jobs/items/initialResource

    • breaking

      added the pattern ^(?!.*\$\{)[^<>"';\\\x00]*$ to the request property jobs/items/plannedResource

    • breaking

      added the pattern ^(?!.*\$\{)[^<>"';\\\x00]*$ to the request property jobs/items/proficiency/items/resource

    • breaking

      added the pattern ^(?!.*\$\{)[^<>"';\\\x00]*$ to the request property relations/items/resource

    • breaking

      the response property became optional for the status

    • warning

      the // request property's maxLength was set to 255

    • warning

      the // request property's maxLength was set to 255

    • warning

      the //// request property's maxLength was set to 255

    • warning

      the // request property's maxLength was set to 255

    • warning

      changed the pattern of the request property // from ^(?!.*\$\{)[^<>"';\\]*$ to ^(?!.*\$\{)[^<>"';\\\x00]*$

    • warning

      changed the pattern of the request property //// from ^(?!.*\$\{)[^<>"';\\]*$ to ^(?!.*\$\{)[^<>"';\\\x00]*$

    • warning

      changed the pattern of the request property //// from ^(?!.*\$\{)[^<>"';\\]*$ to ^(?!.*\$\{)[^<>"';\\\x00]*$

    • warning

      changed the pattern of the request property // from ^(?!.*\$\{)[^<>"';\\]*$ to ^(?!.*\$\{)[^<>"';\\\x00]*$

    • warning

      removed the optional property //// from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      added the new DEPOT_CAPACITY enum value to the ////// response property for the response status

    • warning

      added the new DEPOT_COST enum value to the ////// response property for the response status

    • warning

      added the new DEPOT_TIME_WINDOW enum value to the ////// response property for the response status

    • warning

      added the new END_DEPOT enum value to the ////// response property for the response status

    • warning

      added the new LOAD_COMPATIBILITY enum value to the ////// response property for the response status

    • warning

      added the new MAX_DRIVE_DISTANCE enum value to the ////// response property for the response status

    • warning

      added the new SAME_DAY enum value to the ////// response property for the response status

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property //

    • info

      added the new optional request property

    • info

      added the new optional request property /////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property //////////

    • info

      added the new optional request property /////

    • info

      added the new optional request property //

    • info

      added the new optional request property ////

    • info

      added the new optional request property ////

    • info

      added the new optional request property ////

    • info

      added the new optional request property /////

    • info

      added the new optional request property /////

    • info

      added the new optional request property /////

    • info

      added the new optional request property /////

    • info

      added the new optional request property /////

    • info

      added the new optional request property /////

    • info

      added the new optional request property /////

    • info

      added the new optional request property /////

    • info

      added the new optional request property /////

    • info

      the request property // became optional

    • info

      added the new DUTY enum value to the request property //////

    • info

      added the new TOMTOM_REAL_TIME enum value to the request property /////////

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property //// to the response with the status

    • info

      added the optional property //// to the response with the status

    • info

      the response property //// became required for the status

    • info

      the response property //// became required for the status

    • info

      the response property // became required for the status

    • warning

      the // request property's min was set to 0.00

    • warning

      changed the pattern of the request property // from ^[^<>"';\\]*$ to ^(?!.*\$\{)[^<>"';\\]*$

    • warning

      changed the pattern of the request property //// from ^[^<>"';\\]*$ to ^(?!.*\$\{)[^<>"';\\]*$

    • warning

      changed the pattern of the request property //// from ^[^<>"';\\]*$ to ^(?!.*\$\{)[^<>"';\\]*$

    • warning

      changed the pattern of the request property // from ^[^<>"';\\]*$ to ^(?!.*\$\{)[^<>"';\\]*$