Directions

$ curl -H 'Authorization: Token ...' \
       -H 'Content-type: application/json' \
       -X POST \
       -d '{
              "services": [
                {
                  "name": "My Depot",
                  "serviceTime": 0,
                  "lat": 40.729567809139,
                  "lon": -73.899536132812,
                  "depot": {"id": "..."}
                },
                {
                  "name": "John Smith",
                  "lat": 40.713549215312,
                  "lon": -74.004024267197,
                  "orders": [
                    {"id": "..."}
                  ],
                  "client": {"id": "..."},
                }
              ],
              "departureTime": "2019-02-20T09:00:00+02:00",
              "returnToDepot": true,
              "serviceTime": 600,
              "weightLoadTime": 0.5,
              "volumeLoadTime": 30,
              "palletsLoadTime": 300
            }' \
       https://app.xfleet.io/api/v1/companies/{company}/routedirections
{
    "plannedDistance": 22400,
    "plannedStart": "2019-02-20T09:00:00+02:00",
    "plannedFinish": "2019-02-20T09:31:00+02:00",
    "plannedDuration": 1860,
    "services": [
        {
            "name": "My Depot",
            "plannedArrival": "2019-02-20T09:00:00+02:00",
            "plannedDeparture": "2019-02-20T09:00:00+02:00",
            "lat": 40.729567809139,
            "lon": -73.899536132812,
            "depot": {"id": "..."},
        },
        {
            "name": "John Smith",
            "plannedArrival": "2019-02-20T09:11:00+02:00",
            "plannedDeparture": "2019-02-20T09:21:00+02:00",
            "lat": 40.713549215312,
            "lon": -74.004024267197,
            "orders": [
                {"id": "..."}
            ],
            "client": {"id": "..."}
        },
        {
            "name": "My Depot",
            "plannedArrival": "2019-02-20T09:31:00+02:00",
            "plannedDeparture": "2019-02-20T09:31:00+02:00",
            "lat": 40.729567809139,
            "lon": -73.899536132812,
            "depot": {"id": "..."}
        }
    ],
    "directions": {
        "legs": [
            {
                "steps": [
                    {
                        "distance": 11300.0,
                        "duration": 660,
                        "startLocation": {"lat": 40.729559, "lon": -73.899246},
                        "endLocation": {"lat": 40.713437, "lon": -74.003804},
                        "polyLine": [
                            [-73.899246, 40.729559]
                        ]
                    }
                ],
                "distance": 11100.0,
                "duration": 600
            }
        ],
        "distance": 22400.0,
        "duration": 1860
    }
}