API Reference
API Reference
https://api.routific.com/v1/vrp-long

The vrp-long and pdp-long endpoints will trigger a long-running background task on our servers, while we give you a URL to ping to fetch the results. This is necessary for larger requests that take longer than 20 seconds. Here are some processing times to give you a rough idea:

Number of visitsAverage Processing times
< 100< 2s
2008s
30020s
40030s
50090s
1000250s (~4 mins)
1500500s (~8 mins)
20001070s (~18 mins)
25001330s (~22 mins)

Disclaimer: These processing times are related to an upcoming Major version release of the Engine API

🚧

Processing times may vary

Keep in mind that the above processing times are averages; exact processing times may vary depending on problem complexity and number of constraints enforced.
Enabling the option min_vehicles will have significant impact on the processing time, which could be up to 3X the average.

❗️

Visit Limit

Please note that the vrp-long and pdp-long endpoints have a hard limit of 2500 visits per optimization call. If you need to optimize more than 2500 visits, please contact us at [email protected] to discuss your use case.

When you POST to the above URL, it will return immediately with a 202 HTTP code and a job_id:

{ "job_id": "[someID]" }

With this job_id you can query the status with a GET request to the following URL:

https://api.routific.com/jobs/[someID]

When the job is still busy, the status will be pending or processing. Once it is finished, the status is finished. The response that you would normally get directly from the synchronous endpoint, is now in output.

If there was an error during processing, the status will be error and the error message will be a string in the output.

{
  "visits": {
    "order_1": {
      "location": {
        "name": "6800 Cambie",
        "lat": 49.227107,
        "lng": -123.1163085
      }
    },
    "order_2": {
      "location": {
        "name": "3780 Arbutus",
        "lat": 49.2474624,
        "lng": -123.1532338
      }
    },
    "order_3": {
      "location": {
        "name": "800 Robson",
        "lat": 49.2819229,
        "lng": -123.1211844
      }
    }
  },
  "fleet": {
    "vehicle_1": {
      "start_location": {
        "id": "depot",
        "name": "800 Kingsway",
        "lat": 49.2553636,
        "lng": -123.0873365
      }
    }
  }
}
{ "job_id": "[someID]" }
{
  "status": "pending",
  "input": { ... },
  "id": "[someID]",
  "started_at": [timestamp]
}
{
  "status": "finished",
  "output": {
    "status": "success",
    "fitness": 31,
    "unserved:": null,
    "solution": { ... }
  },
  "id": "[someID]",
  "started_at": [timestamp],
  "finished_at": [timestamp],
  "input": { ... }
}
{
  "status": "error",
  "input": { ... },
  "id": "[someID]",
  "started_at": [timestamp],
  "output": "Sorry - we couldn't find a route for you today. Can you check your driver/stop inputs?"
}