API Reference
API Reference

Get your token

Routific API v3.0 is currently in private beta, which means that we are only granting access to select users.

📘

V3 API Token

Reach out to our Support Team to request access and to get set up with an account.

Make a Request

Once you have a token provisioned, you can authenticate to the API by sending a Bearer Token in the request headers.

Here's a cURL example to show you how to make an API call to Routific:

curl https://routific.com/v3demo.json | \
curl https://planning-service.beta.routific.com/optimize/create \
      -X POST \
      -H "Content-Type: application/json" \
      -H "Authorization: bearer {{your-token-here}}" \
      -d @-

Sample Request & Response

Here's a sample request and response payload for the example above.

{
  "routeScenario": {
    "stops": [
      {
        "name": "order1",
        "location": {
          "address": "6800 Cambie",
          "latitude": 49.227107,
          "longitude": -123.1163085
        },
        "timeWindows": [{"startTime": "9:00", "endTime": "12:00"}],
        "duration": 600
      },
      {
        "name": "order2",
        "location": {
          "address": "3780 Arbutus",
          "latitude": 49.2474624,
          "longitude": -123.1532338
        },
        "timeWindows": [{"startTime": "9:00", "endTime": "12:00"}],
        "duration": 600
      },
      {
        "name": "order3",
        "location": {
          "address": "800 Robson",
          "latitude": 49.2819229,
          "longitude": -123.1211844
        },
        "timeWindows": [{"startTime": "8:00", "endTime": "9:00"}],
        "duration": 600
      }
    ],
    "routes": [
      {
        "name": "driver1",
        "constraints": {
          "startLocation": {
            "address": "800 Kingsway",
            "latitude": 49.2553636,
            "longitude": -123.0873365
          },
          "endLocation": {
            "address": "800 Kingsway",
            "latitude": 49.2553636,
            "longitude": -123.0873365
          },
          "startTime": "08:00",
          "endTime": "12:00"
        }
      }
    ]
  }
}
{
    "actionUuid": "c22fcf15-831f-46e3-97ee-927n7c3df4d1",
    "error": null,
    "status": "finished",
    "routeScenario": {
        "stops": [
            {
                "name": "order3",
                "duration": 600,
                "eventUuid": "c599e714-1334-4114-8071-a1daab7c3546",
                "isScheduled": true,
                "locations": [
                    {
                        "address": "800 Robson",
                        "latitude": 49.2819229,
                        "longitude": -123.1211844
                    }
                ],
                "timeWindows": [
                    {
                        "startTime": "08:00",
                        "endTime": "09:00"
                    }
                ],
                "loads": []
            },
            {
                "name": "order2",
                "duration": 600,
                "eventUuid": "7fa6d3dc-cd0e-413e-912b-da5c907a2e8e",
                "isScheduled": true,
                "locations": [
                    {
                        "address": "3780 Arbutus",
                        "latitude": 49.2474624,
                        "longitude": -123.1532338
                    }
                ],
                "timeWindows": [
                    {
                        "startTime": "09:00",
                        "endTime": "12:00"
                    }
                ],
                "loads": []
            },
            {
                "name": "order1",
                "duration": 600,
                "eventUuid": "3e78e09d-b1ce-4c40-ba86-bfdbf5ea898c",
                "isScheduled": true,
                "locations": [
                    {
                        "address": "6800 Cambie",
                        "latitude": 49.227107,
                        "longitude": -123.1163085
                    }
                ],
                "timeWindows": [
                    {
                        "startTime": "09:00",
                        "endTime": "12:00"
                    }
                ],
                "loads": []
            }
        ],
        "routes": [
            {
                "uuid": "19dcf4a3-733c-4de1-b332-4426b2f382c2",
                "name": "driver1",
                "transportationMode": "car",
                "constraints": {
                    "startTime": "08:00",
                    "duration": 14400,
                    "startLocations": [
                        {
                            "address": "800 Kingsway",
                            "latitude": 49.2553636,
                            "longitude": -123.0873365
                        }
                    ],
                    "endLocations": [
                        {
                            "address": "800 Kingsway",
                            "latitude": 49.2553636,
                            "longitude": -123.0873365
                        }
                    ],
                    "capacities": [],
                    "endTime": "12:00"
                }
            }
        ],
        "options": {
            "transportationMode": "car",
            "minimizeRoutes": false,
            "excludeTolls": false,
            "timeBalance": false,
            "excludeFerry": true,
            "visitBalance": false
        }
    },
    "routeSchedule": {
        "unscheduledStops": [],
        "scheduledRoutes": [
            {
                "uuid": "19dcf4a3-733c-4de1-b332-4426b2f382c2",
                "activeRouteSolution": {
                    "drivingTime": 2723,
                    "distance": 20654,
                    "stopsCount": 3,
                    "polyline": "_`i}|AnwswiFjM{^n_@wcAoFS{r@znBsl@~}A_Nz^sDnK{@jCwBbGcBzEwVns@kCzJwBnKkCnPcBvQ_Dz^cBzJ{E~R_DnK_DrIkCbG_g@reAgOnZkHzOwVjf@gJbQkHnKwGjH{EvGwG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hAbBzORzE?~C?~CRvrAbBbo@?b[nAvVf@rD??cGRwcAf@sg@Rs`Af@c~@?oF?gEnAc_C?gE?kH?cLRw`@Rgm@f@wj@Rkk@Ros@R_q@?cG?oFnA{xBRco@R_I?wGf@we@RsIbB{zA~CglCR{E?gE~Cw_C?oF?gEbBstAz@kk@z@oi@z@gw@f@_b@RkHRwGz@gc@~C{bCbBwmA?oFRgERce@?{Jz@_]vBgzA?oF?{EnAct@R_Xf@sb@?{@RoF~CRbG?jCSvBSrD{@rDoAfEwBrDkC~sAk}AbBwBnUkWnF{EjH_DvGoAvGSrl@nAjC?~C?ziBvBjC?vBRvG?jMRzc@z@~H?b`@z@~C?nFRrDRnA?ziBjCrb@bBnF?faAz@jC?~C?vt@z@zYf@zc@f@jp@z@~C??wQkC?oA?giBoA_DSct@{@_D?kC?ct@oAwLSsNS{YS_v@oAsD?gm@oA??cB?_DSoF?_DSsq@wB{r@{@kC?_DSos@{@wt@{@_D?kC?_Xg@sSSgJf@oKjCwGrDkHjH{TnUcBvBkRzTcQrSoZ~\\_IfJwGbG_DvBsDbBkCz@kCf@gEf@gER{@?_D?sD?s{@cBgO{@gOkCgOcGkM{J_IsI_IwLwGkMsSod@gJkRkH_N_NoPsNoKkRsI{EoAoFg@_q@{@kC?kp@{@wBSkC?ct@oAkC?os@nA_D??sD?{@f@{r@RksA?gERcB?we@RgEf@gpASgY{@sS{@ox@z@kgBnAspCRwG?gERs]f@_jAf@w|AR_]R_I?_IR{Y?kHf@olA?gTf@g_BRkR?{E?gERgc@Rgh@f@knA?{E?gEf@kqB?kk@Rwe@?g^R_IgE?w[?os@{@kCSkC?os@g@sv@cB{w@{@os@{@wBS_D?{r@{@gw@{@kCwBoZ{@kM?gEsD{@kCg@sDg@_I~H{T~k@o`BnFsN",
                    "workingTime": 6031,
                    "load": 0,
                    "transportationMode": "car",
                    "totalIdleTime": 1508,
                    "routeTimeline": [
                        {
                            "eventType": "leaving_start_location",
                            "departureTime": "2023-02-08T08:00:00-08:00",
                            "sequence": 0,
                            "eventUuid": "dc13f712-8aaa-521f-b145-8964933b2e07",
                            "distance": 0,
                            "stopSequence": null,
                            "eta": {
                                "id": 47673311
                            }
                        },
                        {
                            "eventType": "delivering_stop",
                            "startTime": "2023-02-08T08:12:24-08:00",
                            "endTime": "2023-02-08T08:22:24-08:00",
                            "arrivalTime": "2023-02-08T08:12:24-08:00",
                            "sequence": 1,
                            "eventUuid": "c599e714-1334-4114-8071-a1daab7c3546",
                            "distance": 4952,
                            "stopSequence": 1,
                            "logs": [],
                            "eta": {
                                "id": 47673312,
                                "expectedArrivalTime": "2023-02-08T08:12:24-08:00",
                                "expectedFinishTime": "2023-02-08T08:22:24-08:00",
                                "originalArrivalTime": "2023-02-08T08:12:24-08:00",
                                "originalFinishTime": "2023-02-08T08:22:24-08:00"
                            }
                        },
                        {
                            "eventType": "idling",
                            "startTime": "2023-02-08T08:34:52-08:00",
                            "endTime": "2023-02-08T09:00:00-08:00",
                            "sequence": 2,
                            "eventUuid": "a3cf397a-0f7a-591f-a9e0-587e0cdb47e4",
                            "distance": null,
                            "stopSequence": null,
                            "eta": {
                                "id": 47673313,
                                "expectedFinishTime": "2023-02-08T09:00:00-08:00",
                                "originalFinishTime": "2023-02-08T09:00:00-08:00"
                            }
                        },
                        {
                            "eventType": "delivering_stop",
                            "startTime": "2023-02-08T09:00:00-08:00",
                            "endTime": "2023-02-08T09:10:00-08:00",
                            "arrivalTime": "2023-02-08T09:00:00-08:00",
                            "sequence": 3,
                            "eventUuid": "7fa6d3dc-cd0e-413e-912b-da5c907a2e8e",
                            "distance": 5408,
                            "stopSequence": 2,
                            "eta": {
                                "id": 47673314,
                                "expectedArrivalTime": "2023-02-08T09:00:00-08:00",
                                "expectedFinishTime": "2023-02-08T09:10:00-08:00",
                                "originalArrivalTime": "2023-02-08T09:00:00-08:00",
                                "originalFinishTime": "2023-02-08T09:10:00-08:00"
                            }
                        },
                        {
                            "eventType": "delivering_stop",
                            "startTime": "2023-02-08T09:19:35-08:00",
                            "endTime": "2023-02-08T09:29:35-08:00",
                            "arrivalTime": "2023-02-08T09:19:35-08:00",
                            "sequence": 4,
                            "eventUuid": "3e78e09d-b1ce-4c40-ba86-bfdbf5ea898c",
                            "distance": 4837,
                            "stopSequence": 3,
                            "eta": {
                                "id": 47673315,
                                "expectedArrivalTime": "2023-02-08T09:19:35-08:00",
                                "expectedFinishTime": "2023-02-08T09:29:35-08:00",
                                "originalArrivalTime": "2023-02-08T09:19:35-08:00",
                                "originalFinishTime": "2023-02-08T09:29:35-08:00"
                            }
                        },
                        {
                            "eventType": "reaching_end_location",
                            "arrivalTime": "2023-02-08T09:40:31-08:00",
                            "sequence": 5,
                            "eventUuid": "11c0093b-6322-5fea-8329-b58048958ddf",
                            "distance": 5457,
                            "stopSequence": null,
                            "eta": {
                                "id": 47673316,
                                "expectedArrivalTime": "2023-02-08T09:40:31-08:00",
                                "originalArrivalTime": "2023-02-08T09:40:31-08:00"
                            }
                        }
                    ]
                }
            }
        ]
    }
}

Check out our reference docs for detailed information on how to make an optimization request and to fetch the solution generated by Routific.

📘

Switching over from an older version?

Check out our migration guide on how to switch over to the latest version of v3 API