NAV
JSON XML SOAP

Introduction

Welcome to the SquareRoute API! You can use our API to optimize routes for multiple vehicles and answer other geo-related questions.

We support API-calls using REST (JSON and XML) and SOAP! You can view request examples in the dark area to the right, and you can switch the format of the examples with the tabs in the top right.

Authentication

SquareRoute uses API keys to allow access to the API. You can register a new SquareRoute API key at our customer portal.

SquareRoute expects for the API key to be included in all API requests to the server in a header that looks like the following:

Authorization: API your-auth-key

Alternatively, you can use basic authentication. If you use this, you should set both the username and password to your personal API key.

Route Optimalization

SolveProblem endpoint

A simple example:
{
   "Type": "TSPRound",
   "Vehicles": [
      {
         "Type": "Car",
         "StartPoint": {
            "Latitude": "52.032901763916",
            "Longitude": "4.37117338180542"
         },
         "EndPoint": null
      },
      {
         "Type": "Car",
         "StartPoint": {
            "Latitude": "52.032901763916",
            "Longitude": "4.37117338180542"
         },
         "EndPoint": null
      }
   ],
   "Services": [
      {
         "Pickup": {
            "Location": {
               "Latitude": "51.8990516662598",
               "Longitude": "4.51681232452393"
            },
            "ServiceTime": "0",
            "Id": "136746",
            "StartTime": null,
            "EndTime": null
         },
         "Delivery": {
            "Location": {
               "Latitude": "51.9385261535645",
               "Longitude": "4.4946403503418"
            },
            "ServiceTime": "0",
            "Id": "133698",
            "StartTime": null,
            "EndTime": null
         }
      },
      {
         "Pickup": {
            "Location": {
               "Latitude": "51.9239044189453",
               "Longitude": "4.49264860153198"
            },
            "ServiceTime": "0",
            "Id": "136739",
            "StartTime": null,
            "EndTime": null
         },
         "Delivery": {
            "Location": {
               "Latitude": "51.9237289428711",
               "Longitude": "4.49560308456421"
            },
            "ServiceTime": "0",
            "Id": "136376",
            "StartTime": null,
            "EndTime": null
         }
      },
      {
         "Pickup": {
            "Location": {
               "Latitude": "51.954029083252",
               "Longitude": "4.57091188430786"
            },
            "ServiceTime": "0",
            "Id": "136744",
            "StartTime": null,
            "EndTime": null
         }
      },
      {
         "Pickup": {
            "Location": {
               "Latitude": "51.9494514465332",
               "Longitude": "4.54136419296265"
            },
            "ServiceTime": "0",
            "Id": "136742",
            "StartTime": null,
            "EndTime": null
         }
      },
      {
         "Delivery": {
            "Location": {
               "Latitude": "51.9578971862793",
               "Longitude": "4.54369306564331"
            },
            "ServiceTime": "0",
            "Id": "133646",
            "StartTime": null,
            "EndTime": null
         }
      }
   ],
   "CalculateTotalDistance": "false",
   "CalculateStopDistance": "false",
   "CalculateTotalTime": "false",
   "CalculateStopTime": "false",
   "TimeLimit": "10"
}
        
<Problem>
	<Type>TSPRound</Type>
	<Vehicles>
	   <Vehicle>
		  <Type>Car</Type>
		  <StartPoint>
			 <Latitude>52.032901763916</Latitude>
			 <Longitude>4.37117338180542</Longitude>
		  </StartPoint>
		  <EndPoint xsi:nil="true" />
	   </Vehicle>
	   <Vehicle>
		  <Type>Car</Type>
		  <StartPoint>
			 <Latitude>52.032901763916</Latitude>
			 <Longitude>4.37117338180542</Longitude>
		  </StartPoint>
		  <EndPoint xsi:nil="true" />
	   </Vehicle>
	</Vehicles>
	<Services>
	   <Service>
		  <Pickup>
			 <Location>
				<Latitude>51.8990516662598</Latitude>
				<Longitude>4.51681232452393</Longitude>
			 </Location>
			 <ServiceTime>0</ServiceTime>
			 <Id>136746</Id>
			 <StartTime xsi:nil="true" />
			 <EndTime xsi:nil="true" />
		  </Pickup>
		  <Delivery>
			 <Location>
				<Latitude>51.9385261535645</Latitude>
				<Longitude>4.4946403503418</Longitude>
			 </Location>
			 <ServiceTime>0</ServiceTime>
			 <Id>133698</Id>
			 <StartTime xsi:nil="true" />
			 <EndTime xsi:nil="true" />
		  </Delivery>
	   </Service>
	   <Service>
		  <Pickup>
			 <Location>
				<Latitude>51.9239044189453</Latitude>
				<Longitude>4.49264860153198</Longitude>
			 </Location>
			 <ServiceTime>0</ServiceTime>
			 <Id>136739</Id>
			 <StartTime xsi:nil="true" />
			 <EndTime xsi:nil="true" />
		  </Pickup>
		  <Delivery>
			 <Location>
				<Latitude>51.9237289428711</Latitude>
				<Longitude>4.49560308456421</Longitude>
			 </Location>
			 <ServiceTime>0</ServiceTime>
			 <Id>136376</Id>
			 <StartTime xsi:nil="true" />
			 <EndTime xsi:nil="true" />
		  </Delivery>
	   </Service>
	   <Service>
		  <Pickup>
			 <Location>
				<Latitude>51.954029083252</Latitude>
				<Longitude>4.57091188430786</Longitude>
			 </Location>
			 <ServiceTime>0</ServiceTime>
			 <Id>136744</Id>
			 <StartTime xsi:nil="true" />
			 <EndTime xsi:nil="true" />
		  </Pickup>
	   </Service>
	   <Service>
		  <Pickup>
			 <Location>
				<Latitude>51.9494514465332</Latitude>
				<Longitude>4.54136419296265</Longitude>
			 </Location>
			 <ServiceTime>0</ServiceTime>
			 <Id>136742</Id>
			 <StartTime xsi:nil="true" />
			 <EndTime xsi:nil="true" />
		  </Pickup>
	   </Service>
	   <Service>                  
		  <Delivery>
			 <Location>
				<Latitude>51.9578971862793</Latitude>
				<Longitude>4.54369306564331</Longitude>
			 </Location>
			 <ServiceTime>0</ServiceTime>
			 <Id>133646</Id>
			 <StartTime xsi:nil="true" />
			 <EndTime xsi:nil="true" />
		  </Delivery>
	   </Service>               
	</Services>
	<CalculateTotalDistance>false</CalculateTotalDistance>
	<CalculateStopDistance>false</CalculateStopDistance>
	<CalculateTotalTime>false</CalculateTotalTime>
	<CalculateStopTime>false</CalculateStopTime>
	<TimeLimit>10</TimeLimit>
 </Problem>
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Body>
      <SolveProblem xmlns="http://optimization.squareroute.nl/V1/">
         <problem>
            <Type>TSPRound</Type>
            <Vehicles>
               <Vehicle>
                  <Type>Car</Type>
                  <StartPoint>
                     <Latitude>52.032901763916</Latitude>
                     <Longitude>4.37117338180542</Longitude>
                  </StartPoint>
                  <EndPoint xsi:nil="true" />
               </Vehicle>
               <Vehicle>
                  <Type>Car</Type>
                  <StartPoint>
                     <Latitude>52.032901763916</Latitude>
                     <Longitude>4.37117338180542</Longitude>
                  </StartPoint>
                  <EndPoint xsi:nil="true" />
               </Vehicle>
            </Vehicles>
            <Services>
               <Service>
                  <Pickup>
                     <Location>
                        <Latitude>51.8990516662598</Latitude>
                        <Longitude>4.51681232452393</Longitude>
                     </Location>
                     <ServiceTime>0</ServiceTime>
                     <Id>136746</Id>
                     <StartTime xsi:nil="true" />
                     <EndTime xsi:nil="true" />
                  </Pickup>
                  <Delivery>
                     <Location>
                        <Latitude>51.9385261535645</Latitude>
                        <Longitude>4.4946403503418</Longitude>
                     </Location>
                     <ServiceTime>0</ServiceTime>
                     <Id>133698</Id>
                     <StartTime xsi:nil="true" />
                     <EndTime xsi:nil="true" />
                  </Delivery>
               </Service>
               <Service>
                  <Pickup>
                     <Location>
                        <Latitude>51.9239044189453</Latitude>
                        <Longitude>4.49264860153198</Longitude>
                     </Location>
                     <ServiceTime>0</ServiceTime>
                     <Id>136739</Id>
                     <StartTime xsi:nil="true" />
                     <EndTime xsi:nil="true" />
                  </Pickup>
                  <Delivery>
                     <Location>
                        <Latitude>51.9237289428711</Latitude>
                        <Longitude>4.49560308456421</Longitude>
                     </Location>
                     <ServiceTime>0</ServiceTime>
                     <Id>136376</Id>
                     <StartTime xsi:nil="true" />
                     <EndTime xsi:nil="true" />
                  </Delivery>
               </Service>
               <Service>
                  <Pickup>
                     <Location>
                        <Latitude>51.954029083252</Latitude>
                        <Longitude>4.57091188430786</Longitude>
                     </Location>
                     <ServiceTime>0</ServiceTime>
                     <Id>136744</Id>
                     <StartTime xsi:nil="true" />
                     <EndTime xsi:nil="true" />
                  </Pickup>
               </Service>
               <Service>
                  <Pickup>
                     <Location>
                        <Latitude>51.9494514465332</Latitude>
                        <Longitude>4.54136419296265</Longitude>
                     </Location>
                     <ServiceTime>0</ServiceTime>
                     <Id>136742</Id>
                     <StartTime xsi:nil="true" />
                     <EndTime xsi:nil="true" />
                  </Pickup>
               </Service>
               <Service>                  
                  <Delivery>
                     <Location>
                        <Latitude>51.9578971862793</Latitude>
                        <Longitude>4.54369306564331</Longitude>
                     </Location>
                     <ServiceTime>0</ServiceTime>
                     <Id>133646</Id>
                     <StartTime xsi:nil="true" />
                     <EndTime xsi:nil="true" />
                  </Delivery>
               </Service>               
            </Services>
            <CalculateTotalDistance>false</CalculateTotalDistance>
            <CalculateStopDistance>false</CalculateStopDistance>
            <CalculateTotalTime>false</CalculateTotalTime>
            <CalculateStopTime>false</CalculateStopTime>
            <TimeLimit>10</TimeLimit>
         </problem>
      </SolveProblem>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
        
The response to this request is:
{
   "Success": "true",
   "Vehicles": [
      {
         "Stops": [
            {
               "Location": {
                  "Latitude": "52.032901763916",
                  "Longitude": "4.37117338180542"
               },
               "Pickups": {
                  "int": "4"
               },
               "Deliveries": [],
               "Arrival": null,
               "Departure": null,
               "Distance": null
            },
            {
               "Location": {
                  "Latitude": "51.954029083252",
                  "Longitude": "4.57091188430786"
               },
               "Pickups": {
                  "int": "2"
               },
               "Deliveries": [],
               "Arrival": null,
               "Departure": null,
               "Distance": null
            },
            {
               "Location": {
                  "Latitude": "51.9578971862793",
                  "Longitude": "4.54369306564331"
               },
               "Pickups": [],
               "Deliveries": {
                  "int": "4"
               },
               "Arrival": null,
               "Departure": null,
               "Distance": null
            },
            {
               "Location": {
                  "Latitude": "51.9494514465332",
                  "Longitude": "4.54136419296265"
               },
               "Pickups": {
                  "int": "3"
               },
               "Deliveries": [],
               "Arrival": null,
               "Departure": null,
               "Distance": null
            },
            {
               "Location": {
                  "Latitude": "51.8990516662598",
                  "Longitude": "4.51681232452393"
               },
               "Pickups": {
                  "int": "0"
               },
               "Deliveries": [],
               "Arrival": null,
               "Departure": null,
               "Distance": null
            },
            {
               "Location": {
                  "Latitude": "51.9239044189453",
                  "Longitude": "4.49264860153198"
               },
               "Pickups": {
                  "int": "1"
               },
               "Deliveries": [],
               "Arrival": null,
               "Departure": null,
               "Distance": null
            },
            {
               "Location": {
                  "Latitude": "51.9237289428711",
                  "Longitude": "4.49560308456421"
               },
               "Pickups": [],
               "Deliveries": {
                  "int": "1"
               },
               "Arrival": null,
               "Departure": null,
               "Distance": null
            },
            {
               "Location": {
                  "Latitude": "51.9385261535645",
                  "Longitude": "4.4946403503418"
               },
               "Pickups": [],
               "Deliveries": {
                  "int": "0"
               },
               "Arrival": null,
               "Departure": null,
               "Distance": null
            },
            {
               "Location": {
                  "Latitude": "52.032901763916",
                  "Longitude": "4.37117338180542"
               },
               "Pickups": [],
               "Deliveries": [],
               "Arrival": null,
               "Departure": null,
               "Distance": null
            }
         ],
         "Start": null,
         "End": null,
         "Duration": null,
         "Distance": null
      },
      {
         "Stops": {
            "ResultStop": {
               "Location": {
                  "Latitude": "52.032901763916",
                  "Longitude": "4.37117338180542"
               },
               "Pickups": {
                  "int": "4"
               },
               "Deliveries": [],
               "Arrival": null,
               "Departure": null,
               "Distance": null
            }
         },
         "Start": null,
         "End": null,
         "Duration": null,
         "Distance": null
      }
   ]
}
        
<SolveProblemResult>
	<Success>true</Success>
	<Vehicles>
	   <ResultVehicle>
		  <Stops>
			 <ResultStop>
				<Location>
				   <Latitude>52.032901763916</Latitude>
				   <Longitude>4.37117338180542</Longitude>
				</Location>
				<Pickups>
				   <int>4</int>
				</Pickups>
				<Deliveries/>
				<Arrival xsi:nil="true"/>
				<Departure xsi:nil="true"/>
				<Distance xsi:nil="true"/>
			 </ResultStop>
			 <ResultStop>
				<Location>
				   <Latitude>51.954029083252</Latitude>
				   <Longitude>4.57091188430786</Longitude>
				</Location>
				<Pickups>
				   <int>2</int>
				</Pickups>
				<Deliveries/>
				<Arrival xsi:nil="true"/>
				<Departure xsi:nil="true"/>
				<Distance xsi:nil="true"/>
			 </ResultStop>
			 <ResultStop>
				<Location>
				   <Latitude>51.9578971862793</Latitude>
				   <Longitude>4.54369306564331</Longitude>
				</Location>
				<Pickups/>
				<Deliveries>
				   <int>4</int>
				</Deliveries>
				<Arrival xsi:nil="true"/>
				<Departure xsi:nil="true"/>
				<Distance xsi:nil="true"/>
			 </ResultStop>
			 <ResultStop>
				<Location>
				   <Latitude>51.9494514465332</Latitude>
				   <Longitude>4.54136419296265</Longitude>
				</Location>
				<Pickups>
				   <int>3</int>
				</Pickups>
				<Deliveries/>
				<Arrival xsi:nil="true"/>
				<Departure xsi:nil="true"/>
				<Distance xsi:nil="true"/>
			 </ResultStop>
			 <ResultStop>
				<Location>
				   <Latitude>51.8990516662598</Latitude>
				   <Longitude>4.51681232452393</Longitude>
				</Location>
				<Pickups>
				   <int>0</int>
				</Pickups>
				<Deliveries/>
				<Arrival xsi:nil="true"/>
				<Departure xsi:nil="true"/>
				<Distance xsi:nil="true"/>
			 </ResultStop>
			 <ResultStop>
				<Location>
				   <Latitude>51.9239044189453</Latitude>
				   <Longitude>4.49264860153198</Longitude>
				</Location>
				<Pickups>
				   <int>1</int>
				</Pickups>
				<Deliveries/>
				<Arrival xsi:nil="true"/>
				<Departure xsi:nil="true"/>
				<Distance xsi:nil="true"/>
			 </ResultStop>
			 <ResultStop>
				<Location>
				   <Latitude>51.9237289428711</Latitude>
				   <Longitude>4.49560308456421</Longitude>
				</Location>
				<Pickups/>
				<Deliveries>
				   <int>1</int>
				</Deliveries>
				<Arrival xsi:nil="true"/>
				<Departure xsi:nil="true"/>
				<Distance xsi:nil="true"/>
			 </ResultStop>
			 <ResultStop>
				<Location>
				   <Latitude>51.9385261535645</Latitude>
				   <Longitude>4.4946403503418</Longitude>
				</Location>
				<Pickups/>
				<Deliveries>
				   <int>0</int>
				</Deliveries>
				<Arrival xsi:nil="true"/>
				<Departure xsi:nil="true"/>
				<Distance xsi:nil="true"/>
			 </ResultStop>
			 <ResultStop>
				<Location>
				   <Latitude>52.032901763916</Latitude>
				   <Longitude>4.37117338180542</Longitude>
				</Location>
				<Pickups/>
				<Deliveries/>
				<Arrival xsi:nil="true"/>
				<Departure xsi:nil="true"/>
				<Distance xsi:nil="true"/>
			 </ResultStop>
		  </Stops>
		  <Start xsi:nil="true"/>
		  <End xsi:nil="true"/>
		  <Duration xsi:nil="true"/>
		  <Distance xsi:nil="true"/>
	   </ResultVehicle>
	   <ResultVehicle>
		  <Stops>
			 <ResultStop>
				<Location>
				   <Latitude>52.032901763916</Latitude>
				   <Longitude>4.37117338180542</Longitude>
				</Location>
				<Pickups>
				   <int>4</int>
				</Pickups>
				<Deliveries/>
				<Arrival xsi:nil="true"/>
				<Departure xsi:nil="true"/>
				<Distance xsi:nil="true"/>
			 </ResultStop>
		  </Stops>
		  <Start xsi:nil="true"/>
		  <End xsi:nil="true"/>
		  <Duration xsi:nil="true"/>
		  <Distance xsi:nil="true"/>
	   </ResultVehicle>
	</Vehicles>
 </SolveProblemResult>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <SolveProblemResponse xmlns="http://optimization.squareroute.nl/V1/">
         <SolveProblemResult>
            <Success>true</Success>
            <Vehicles>
               <ResultVehicle>
                  <Stops>
                     <ResultStop>
                        <Location>
                           <Latitude>52.032901763916</Latitude>
                           <Longitude>4.37117338180542</Longitude>
                        </Location>
                        <Pickups>
                           <int>4</int>
                        </Pickups>
                        <Deliveries/>
                        <Arrival xsi:nil="true"/>
                        <Departure xsi:nil="true"/>
                        <Distance xsi:nil="true"/>
                     </ResultStop>
                     <ResultStop>
                        <Location>
                           <Latitude>51.954029083252</Latitude>
                           <Longitude>4.57091188430786</Longitude>
                        </Location>
                        <Pickups>
                           <int>2</int>
                        </Pickups>
                        <Deliveries/>
                        <Arrival xsi:nil="true"/>
                        <Departure xsi:nil="true"/>
                        <Distance xsi:nil="true"/>
                     </ResultStop>
                     <ResultStop>
                        <Location>
                           <Latitude>51.9578971862793</Latitude>
                           <Longitude>4.54369306564331</Longitude>
                        </Location>
                        <Pickups/>
                        <Deliveries>
                           <int>4</int>
                        </Deliveries>
                        <Arrival xsi:nil="true"/>
                        <Departure xsi:nil="true"/>
                        <Distance xsi:nil="true"/>
                     </ResultStop>
                     <ResultStop>
                        <Location>
                           <Latitude>51.9494514465332</Latitude>
                           <Longitude>4.54136419296265</Longitude>
                        </Location>
                        <Pickups>
                           <int>3</int>
                        </Pickups>
                        <Deliveries/>
                        <Arrival xsi:nil="true"/>
                        <Departure xsi:nil="true"/>
                        <Distance xsi:nil="true"/>
                     </ResultStop>
                     <ResultStop>
                        <Location>
                           <Latitude>51.8990516662598</Latitude>
                           <Longitude>4.51681232452393</Longitude>
                        </Location>
                        <Pickups>
                           <int>0</int>
                        </Pickups>
                        <Deliveries/>
                        <Arrival xsi:nil="true"/>
                        <Departure xsi:nil="true"/>
                        <Distance xsi:nil="true"/>
                     </ResultStop>
                     <ResultStop>
                        <Location>
                           <Latitude>51.9239044189453</Latitude>
                           <Longitude>4.49264860153198</Longitude>
                        </Location>
                        <Pickups>
                           <int>1</int>
                        </Pickups>
                        <Deliveries/>
                        <Arrival xsi:nil="true"/>
                        <Departure xsi:nil="true"/>
                        <Distance xsi:nil="true"/>
                     </ResultStop>
                     <ResultStop>
                        <Location>
                           <Latitude>51.9237289428711</Latitude>
                           <Longitude>4.49560308456421</Longitude>
                        </Location>
                        <Pickups/>
                        <Deliveries>
                           <int>1</int>
                        </Deliveries>
                        <Arrival xsi:nil="true"/>
                        <Departure xsi:nil="true"/>
                        <Distance xsi:nil="true"/>
                     </ResultStop>
                     <ResultStop>
                        <Location>
                           <Latitude>51.9385261535645</Latitude>
                           <Longitude>4.4946403503418</Longitude>
                        </Location>
                        <Pickups/>
                        <Deliveries>
                           <int>0</int>
                        </Deliveries>
                        <Arrival xsi:nil="true"/>
                        <Departure xsi:nil="true"/>
                        <Distance xsi:nil="true"/>
                     </ResultStop>
                     <ResultStop>
                        <Location>
                           <Latitude>52.032901763916</Latitude>
                           <Longitude>4.37117338180542</Longitude>
                        </Location>
                        <Pickups/>
                        <Deliveries/>
                        <Arrival xsi:nil="true"/>
                        <Departure xsi:nil="true"/>
                        <Distance xsi:nil="true"/>
                     </ResultStop>
                  </Stops>
                  <Start xsi:nil="true"/>
                  <End xsi:nil="true"/>
                  <Duration xsi:nil="true"/>
                  <Distance xsi:nil="true"/>
               </ResultVehicle>
               <ResultVehicle>
                  <Stops>
                     <ResultStop>
                        <Location>
                           <Latitude>52.032901763916</Latitude>
                           <Longitude>4.37117338180542</Longitude>
                        </Location>
                        <Pickups>
                           <int>4</int>
                        </Pickups>
                        <Deliveries/>
                        <Arrival xsi:nil="true"/>
                        <Departure xsi:nil="true"/>
                        <Distance xsi:nil="true"/>
                     </ResultStop>
                  </Stops>
                  <Start xsi:nil="true"/>
                  <End xsi:nil="true"/>
                  <Duration xsi:nil="true"/>
                  <Distance xsi:nil="true"/>
               </ResultVehicle>
            </Vehicles>
         </SolveProblemResult>
      </SolveProblemResponse>
   </soap:Body>
</soap:Envelope>
        

SquareRoute's main feature is to optimize the routes your vehicles will drive in order to service all stops (whether they be pickups, deliveries or something else entirely, such as repairs).

You pass in the information you have available and SquareRoute will compute both the distribution of stops over vehicles as well as the order which it considers most optimal for each vehicle.

HTTP Request

REST: POST https://api.squareroute.nl/RouteOptimization/V1/RouteOptimization/SolveProblem

SOAP: POST https://api.squareroute.nl/RouteOptimization/V1/RouteOptimization.asmx/SolveProblem

WSDL: GET https://api.squareroute.nl/RouteOptimization/V1/RouteOptimization.asmx?wsdl

Problem-object

You pass in a single Problem object. This object contains all information about the routing problem you are trying to solve. The objects field look like this:

Field name Type Required? Description
Type Enum Yes The type of routes you want. Currently, only one value is supported:
  • TSPRound: Unless otherwise specified, vehicles will always return to their starting point
Vehicles Array of Vehicle objects Yes A description of the available vehicles.
Services Array of Service objects Yes A description of all stops that need to be serviced by your vehicles
CalculateTotalDistance boolean Yes If true, SquareRoute will calculate and return the total distance of the returned route
CalculateStopDistance boolean Yes If true, SquareRoute will calculate and return the distance of each stop
CalculateTotalDistance boolean Yes If true, SquareRoute will calculate and return the total travel time of the returned route
CalculateTotalDistance boolean Yes If true, SquareRoute will calculate and return the travel time of each stop
TimeLimit boolean No Number of seconds before a result will be returned.
If set, will work until the specified value OR until optimum result is achieved.
If not set, will use heuristics to determine when good result is achieved.

Vehicle-object

Field name Type Required? Description
Type Enum Yes The type of car you are driving. Currently, only one value is supported:
  • Car: A regular car or van without special restrictions on speed or height
StartPoint Location-object No The point at which this vehicle starts travelling.
If this field is not set, the vehicle can start at any point.
It is recommended to set this field to the depot, as the SquareRoute algorithm will always try to return the vehicle to this point unless EndPoint is set.
EndPoint Location-object No The point to which the vehicle must return at the end of its route.
If this field is not set, the vehicle can start at any point.
StartTime DateTime No The moment this vehicle can start its shift
EndTime DateTime No The moment this vehicle should have ended its shift

Service-object

Field name Type Required? Description
Pickup Stop-object No Where to pickup this shipment. If left blank, the starting point is assumed to be the pickup point.
Delivery Stop-object No Where to deliver this shipment. If left blank, the end-point or last point is assumed to be the delivery point.

Stop-object

Field name Type Required? Description
Location Location-object Yes The location of this stop
ServiceTime integer Yes The amount of time (in seconds) that this stop will take. Zero means no time is taken.
Id int No Optional unique (per request) number to be set by the client to recognize failed locations, for example when SquareRoute can't find a way to route to this location.
StartTime DateTime No The moment from which this stop can be serviced (time window start)
EndTime DateTime No The moment from which this stop can no longer be serviced (time window end)

Location-object

Field name Type Required? Description
Latitude double (decimal) Yes Latitude of location
Latitude double (decimal) Yes Longitude of location

Geocoding

Search

This endpoint helps you search for places by freetext, returning full address info and latitude-longitude coordinates.

An example request:
{
   "Query": "Goudsesingel, Rotterdam",
   "Options": {
      "Language": "nl",
      "CountryCodes": [
         "nl"
      ],
      "AddressDetails": "true",
      "Limit": "1"
   }
}
<Search>
	<Query>Goudsesingel, Rotterdam</Query>
	<Options>
		<Language>nl</Language>
		<CountryCodes>
			<CountryCode>nl</CountryCode>
		</CountryCodes>
		<AddressDetails>true</AddressDetails>
		<Limit>1</Limit>
	</Options>
</Search>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:geoc="http://geocoding.squareroute.nl/">
   <soapenv:Header/>
   <soapenv:Body>
      <geoc:Search>
         <geoc:query>Goudsesingel, Rotterdam</geoc:query>
         <geoc:options>
            <geoc:Language>nl</geoc:Language>
            <geoc:CountryCodes>
               <!--Zero or more repetitions:-->
               <geoc:string>nl</geoc:string>
            </geoc:CountryCodes>
            <geoc:AddressDetails>true</geoc:AddressDetails>
            <geoc:Limit>1</geoc:Limit>
         </geoc:options>
      </geoc:Search>
   </soapenv:Body>
</soapenv:Envelope>
The response to this request is:
{
   "SearchResult": {
      "Latitude": "51.9249177",
      "Longitude": "4.4863094",
      "DisplayName": "Goudsesingel, Rotterdam, MRDH, Zuid-Holland, Nederland, 3031AS, Koninkrijk der Nederlanden",
      "Address": {
         "Country": "Koninkrijk der Nederlanden",
         "CountryCode": "nl",
         "Postcode": "3031AS",
         "State": "Zuid-Holland",
         "Suburb": "Rotterdam"
      }
   }
}
 <SearchResult>
	<SearchResult>
	   <Latitude>51.9249177</Latitude>
	   <Longitude>4.4863094</Longitude>
	   <DisplayName>Goudsesingel, Rotterdam, MRDH, Zuid-Holland, Nederland, 3031AS, Koninkrijk der Nederlanden</DisplayName>
	   <Address>
		  <Country>Koninkrijk der Nederlanden</Country>
		  <CountryCode>nl</CountryCode>
		  <Postcode>3031AS</Postcode>
		  <State>Zuid-Holland</State>
		  <Suburb>Rotterdam</Suburb>
	   </Address>
	</SearchResult>
 </SearchResult>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <SearchResponse xmlns="http://geocoding.squareroute.nl/">
         <SearchResult>
            <SearchResult>
               <Latitude>51.9249177</Latitude>
               <Longitude>4.4863094</Longitude>
               <DisplayName>Goudsesingel, Rotterdam, MRDH, Zuid-Holland, Nederland, 3031AS, Koninkrijk der Nederlanden</DisplayName>
               <Address>
                  <Country>Koninkrijk der Nederlanden</Country>
                  <CountryCode>nl</CountryCode>
                  <Postcode>3031AS</Postcode>
                  <State>Zuid-Holland</State>
                  <Suburb>Rotterdam</Suburb>
               </Address>
            </SearchResult>
         </SearchResult>
      </SearchResponse>
   </soap:Body>
</soap:Envelope>

HTTP Request

REST: POST https://api.squareroute.nl/Geocoding/V1/Geocoding/Search

SOAP: POST https://api.squareroute.nl/Geocoding/V1/Geocoding.asmx/Search

WSDL: GET https://api.squareroute.nl/Geocoding/V1/Geocoding.asmx?wsdl

POST Parameters

Parameter Type Required? Description
query string Yes The text to search for. Can be a single city name, but also a complete address.
Examples:
  • Goudsesingel 8d, Rotterdam
  • Rotterdam
  • Marylebone Rd, Marylebone, London NW1 5LR, United Kingdom
  • 150 London Wall, London
options Options-object Yes Various options

Options

Parameter Type Required? Description
Language string No The language (or languages) you would like your response to be in.
For multiple languages see the accept-language http header for the correct format.
CountryCodes Array of string No Limit search results to a specific country (or a list of countries).
CountryCode should be the ISO 3166-1alpha2 code, e.g.gb for the United Kingdom, nl for The Netherlands, etc.
AddressDetails boolean No If true, whether to include structured address details if available

SearchAddress

This endpoint helps you search for places by structured query, returning full address info and latitude-longitude coordinates.

An example request:
{
   "Address": {
      "Street": "Goudsesingel",
      "City": "Rotterdam",
      "Country": "The Netherlands"
   },
   "Options": {
      "Language": "nl",
      "CountryCodes": [],
      "AddressDetails": "true",
      "Limit": "1"
   }
}
<SearchAddress>
	<Address>
		<Street>Goudsesingel</Street>
		<City>Rotterdam</City>
		<Country>The Netherlands</Country>
	</Address>
	<Options>
		<Language>nl</Language>
		<CountryCodes></CountryCodes>
		<AddressDetails>true</AddressDetails>
		<Limit>1</Limit>
	</Options>
</SearchAddress>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:geoc="http://geocoding.squareroute.nl/">
   <soapenv:Header/>
   <soapenv:Body>
      <geoc:SearchAddress>
         <geoc:address>
            <geoc:Street>Goudsesingel</geoc:Street>
            <geoc:City>Rotterdam</geoc:City>
            <geoc:Country>The Netherlands</geoc:Country>
         </geoc:address>
         <geoc:options>
            <geoc:Language>nl</geoc:Language>
            <geoc:CountryCodes></geoc:CountryCodes>
            <geoc:AddressDetails>true</geoc:AddressDetails>
            <geoc:Limit>1</geoc:Limit>
         </geoc:options>
      </geoc:SearchAddress>
   </soapenv:Body>
</soapenv:Envelope>
The response to this request is:
{
   "SearchResult": {
      "Latitude": "51.9247058",
      "Longitude": "4.4862511",
      "DisplayName": "Goudsesingel, Rotterdam, MRDH, Zuid-Holland, Nederland, 3011 JA, Koninkrijk der Nederlanden",
      "Address": {
         "Country": "Koninkrijk der Nederlanden",
         "CountryCode": "nl",
         "Postcode": "3011 JA",
         "State": "Zuid-Holland",
         "Suburb": "Rotterdam"
      }
   }
}
<SearchAddressResult>
	<SearchResult>
		<Latitude>51.9247058</Latitude>
		<Longitude>4.4862511</Longitude>
		<DisplayName>Goudsesingel, Rotterdam, MRDH, Zuid-Holland, Nederland, 3011 JA, Koninkrijk der Nederlanden</DisplayName>
		<Address>
			<Country>Koninkrijk der Nederlanden</Country>
			<CountryCode>nl</CountryCode>
			<Postcode>3011 JA</Postcode>
			<State>Zuid-Holland</State>
			<Suburb>Rotterdam</Suburb>
		</Address>
	</SearchResult>
</SearchAddressResult>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <SearchAddressResponse xmlns="http://geocoding.squareroute.nl/">
         <SearchAddressResult>
            <SearchResult>
               <Latitude>51.9247058</Latitude>
               <Longitude>4.4862511</Longitude>
               <DisplayName>Goudsesingel, Rotterdam, MRDH, Zuid-Holland, Nederland, 3011 JA, Koninkrijk der Nederlanden</DisplayName>
               <Address>
                  <Country>Koninkrijk der Nederlanden</Country>
                  <CountryCode>nl</CountryCode>
                  <Postcode>3011 JA</Postcode>
                  <State>Zuid-Holland</State>
                  <Suburb>Rotterdam</Suburb>
               </Address>
            </SearchResult>
         </SearchAddressResult>
      </SearchAddressResponse>
   </soap:Body>
</soap:Envelope>

HTTP Request

REST: POST https://api.squareroute.nl/Geocoding/V1/Geocoding/SearchAddress

SOAP: POST https://api.squareroute.nl/Geocoding/V1/Geocoding.asmx/SearchAddress

WSDL: GET https://api.squareroute.nl/Geocoding/V1/Geocoding.asmx?wsdl

POST Parameters

Parameter Type Required? Description
address Address search parameters Yes The structured address to search for
options Options-object Yes Various options

Address Search Parameters

Parameter Type Required? Description
Housenumber string No The housenumber to search for. Only valid if Street-parameter is also included.
Street string No The streetname to search for.
City string No The city to search for.
County string No The county to search for.
State string No The state to search for.
Country string No The country to search for.
Postalcode string No The postalcode to search for.

Options

Parameter Type Required? Description
Language string No The language (or languages) you would like your response to be in.
For multiple languages see the accept-language http header for the correct format.
CountryCodes Array of string No Limit search results to a specific country (or a list of countries).
CountryCode should be the ISO 3166-1alpha2 code, e.g.gb for the United Kingdom, nl for The Netherlands, etc.
AddressDetails boolean No If true, whether to include structured address details if available

Reverse

This endpoint helps you convert coordinates into a full address.

HTTP Request

REST: POST https://api.squareroute.nl/Geocoding/V1/Geocoding/Reverse

SOAP: POST https://api.squareroute.nl/Geocoding/V1/Geocoding.asmx/Reverse

WSDL: GET https://api.squareroute.nl/Geocoding/V1/Geocoding.asmx?wsdl

POST Parameters

Parameter Type Required? Description
latitude double (decimal) Yes The latitude of the coordinate to reverse geocode.
longitude double (decimal) Yes The longitude of the coordinate to reverse geocode.
options ReverseSearchOptions-object Yes Various options

Reverse Search Options

Parameter Type Required? Description
Language string No The language (or languages) you would like your response to be in.
For multiple languages see the accept-language http header for the correct format.
AddressDetails boolean No If true, whether to include structured address details if available