You need to define at least one depot. The depot is the location from which the route starts and where the route of a vehicle ends (if the route is defined as a round trip, i.e. ROUNDTRIP_TOUR = True).

Per default the first address in your addresses is your company address and it is set as depot per default. You can quickly check it with this call:

import requests

auth_header = {"Authorization": 'JWT ' + token}

api_url = "https://<your company name>.prod.smartlane.io/api/address/1"

response = requests.get(api_url, headers=auth_header)

This should return something like this, where "addresstype": "depot" is the information we are looking for:

{
  "additional": "",
  "addresstype": "depot",
  "city": "München",
  "code": null,
  "contactcompany": "Smartlane GmbH",
  "contactfirstname": "Max",
  "contactlastname": "Mustermann",
  "country": "DE",
  "customernr": null,
  "default_pdt_from": null,
  "default_pdt_to": null,
  "distances": null,
  "district": null,
  "email": your_email,
  "housenumber": "45",
  "id": 1,
  "location": {
    "coordinates": [
      11.52225,48.13735
    ],
    "type": "Point"
  },
  "phonenr": "00498990411930",
  "postalcode": "80687",
  "search_vector": null,
  "street": "Elsenheimerstraße 45"
}

To define a new depot, use the following call:

import requests

auth_header = {"Authorization": 'JWT ' + token}
api_url = "https://<your company name>.prod.smartlane.io/api/address"

data = {"contactcompany": "Smartlane GmbH",
        "street": "Elsenheimerstraße",
        "housenumber": "45",
        "city": "München",
        "postalcode": "80687",
        "addresstype": "depot"}

response = requests.post(api_url, headers=auth_header, json=data)