PUT /api/v1/stops
Developers can update existing stops data like update stop address, notes, assignee etc by using this endpoint . Full details are available under the schema (in swagger). Please refer below to understand the details and description of stop’s each field.
Request parameters:
id
id * integer ($int32) (path) Pass the ID of the stop to update. Update stop request body fields : UpdateStopRequest {
contact: {
name
phone
email
}
All three are strings and nullable: true. Holds the information about Contact details of a stop. Developers can update the contact details for a particular stop like name, phone and email of the contact person.
assignedTeammeberId
Type string & nullable: true. This is the id of the assigned team member/driver for the stop. Developers can supply in the ID (teamMemberId) of the desired team member to update the assignee of a stop. For details about team members please visit team member endpoint documentation.
Please note: Consuming the Assigned team member field will require tripDate to be supplied manadatorily with the stop request. Otherwise tripdate is an optional field on stops object.
brandId
An integer ($int32) nullable field for supplying a brandId to be associated with a Stop. You can get the details of all Brands associated with your Locate2u account by calling api/v1/brands. For more information on Brands end point refer to Brands end point link.
name
String (nullable) representing the name of the address for a stop. Eg. here is the address:
“address”: “Manly Beach, New South Wales, Australia” and it’s “name”: “Manly Beach”
addressComponents
GeocodingComponents {
geocoder string
type string
confidenceScore number($double)
address string
location
Location
{
latitude
longitude
}
line1 string
line2 string
city string
province string
provinceCode string
postcode string
country string
countryCode string
}
Address component object containing the fields for different geocoding data for stop’s address. All fields are nullable: true.
location
Location {
latitude
longitude
}
Data (number, $double) of the stop location containing latitude and longitude.
type
Type string & nullable: true. Defines the type of the stop i.e. Pickup type or Drop type.
tripDate
Type string($date) nullable: true with a format “yyyy-MM-dd”. Trip date is the scheduled date of the stop in a given trip.
appointmentTime
Type string ($time) & nullable: true with a format “HH-mm”. Appointment time is the scheduled time of the stop.
timeWindowStart
Type string ($time)& nullable: true with a format “HH-mm”. Time windows are used when you want to schedule a fixed start and end time for the stop duration. Time window start defines the starting time of the stop.
timeWindowEnd
Type string ($time)& nullable: true with a format “HH-mm”. Time window end defines the finishing time of the stop.
durationMinutes
Type integer($int32). Allows Developers to set the duration of the stop in minutes.
customFields
These are additional (nullable) input fields that you can add to gather specific information beyond standard details which are available by default of the stop’s form. They allow you to tailor the Stop details form to collect data relevant to your specific needs, such as preferences, comments, or any other information pertinent to the stop’s purpose. For example a delivery company can set specific pre delivery questions for a driver to confirm before picking up the item OR a HVAC company would like to confirm the quality of service after the completion of the service. These are the available options for custom field types : Text, Date, Multi line text and Checkbox field.
load
Load is the amount or weight or volume of parcel that vehicle is going to carry for the particular stop. Developers can set this using the load field on the stop.
customerId
Type integer & nullable: true. Unique id of the customer records specific to your Locate2u account. Developers can use this to directly set the Stop for a particular customer. For details about customers please also see Customers endpoint documentation.
runNumber
Type integer & nullable: true. A number representing the run to which this stop belongs to. Usually customers with a large number of deliveries batch multiple stops into a single run which then can be assigned to particular drivers for smoother delivery. Developers can use runNumber to set it on a stop record which then binds the stop to a particular run for a given trip.
teamRegionId
Type integer & nullable: true. Team regions are defined geographical areas or a territory assigned to a team of delivery personnel. Each member under a team region is responsible for handling deliveries and work orders within their designated region . This is mostly used around organizations to optimize deliveries and streamline logistics and services, and improve efficiency in the overall process. Developers can use teamRegionId to assign a particular team region to a stop and rest all team region based functionality will be handled by the system.
For more details on Team region please see team region id endpoint documentation.
contents
ShipmentContents
{
isAlcohol boolean
nullable: true
isTobacco boolean
nullable: true
isPrescriptionMedication boolean
nullable: true
isDangerousGoods boolean
nullable: true
isMeat boolean
nullable: true
isPork boolean
nullable: true
isBeef boolean
nullable: true
isFragile boolean
nullable: true
isFlowers boolean
nullable: true
isCake boolean
nullable: true
isFood boolean
nullable: true
isLiquid boolean
nullable: true
isNotRotatable boolean
nullable: true
isGlass boolean
nullable: true
isBaked boolean
nullable: true
mustBeUpright boolean
nullable: true
}
Object containing boolean fields to define the type of the shipment content of a delivery stop. For example a Delivery company would like to specify if it is a package containing Alcohol or prescription Medication or a dangerous goods. And all these fields are nullable.
driverInstructions
DriverInstructions
{
hasAuthorityToLeave boolean
mustCheckRecipientId boolean
mustWearHighVisibilityVest boolean
isContactlessDelivery boolean
doorCode string
instructions string
leaveAtLocation string
}
Driver instructions can be set at a stop level to let users define a variety of delivery instructions which are required to be kept in mind by the Driver to complete a delivery. All the fields are nullable.
Example Request body:
The request body should be in raw format and should include the following parameters:
{
"contact": {
"name": "Matthew Robinson",
"phone": "0123456789",
"email": "matt.robinson@email.com"
},
"assignedTeamMemberId": "ee59-b174-4698-ac55-81d9d",
"brandId": null,
"name": "Locate2u",
"address": "Level 4, Suite 4.11, 55 Miller St, Pyrmont NSW 2009, Australia",
"location": {
"latitude": -33.8706672,
"longitude": 151.192487
},
"type": null,
"tripDate": "2024-03-04",
"appointmentTime": "12:00",
"timeWindowStart": null,
"timeWindowEnd": null,
"durationMinutes": 10,
"notes": "Please call before you deliver",
"customFields": {
"custom1": "value",
"custom2": "value",
"custom3": "value"
},
"load": {
"quantity": 0,
"volume": 0,
"weight": 0,
"length": 0,
"width": 0,
"height": 0
},
"customerId": 0,
"runNumber": 0,
"teamRegionId": 0,
"contents": null,
"driverInstructions": null
}
Example requests:
Sample code
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://api.locate2u.com/api/v1/stops/4275437");
request.Headers.Add("Authorization", "Bearer yourBearerTokenHere");
var content = new StringContent("{\r\n \"contact\": {\r\n \"name\": \"Matthew Robinson\",\r\n \"phone\": \"0123456789\",\r\n \"email\": \"matt.robinson@email.com\"\r\n },\r\n \"assignedTeamMemberId\": \"ee59-b174-4698-ac55-81d9d\",\r\n \"brandId\": null,\r\n \"name\": \"Locate2u\",\r\n \"address\": \"Level 4, Suite 4.11, 55 Miller St, Pyrmont NSW 2009, Australia\",\r\n \"location\": {\r\n \"latitude\": -33.8706672,\r\n \"longitude\": 151.192487\r\n },\r\n \"type\": null,\r\n \"tripDate\": \"2024-01-29\",\r\n \"appointmentTime\": \"12:00\",\r\n \"timeWindowStart\": null,\r\n \"timeWindowEnd\": null,\r\n \"durationMinutes\": 10,\r\n \"notes\": \"Please call before you deliver\",\r\n \"customFields\": {\r\n \"custom1\": \"value\",\r\n \"custom2\": \"value\",\r\n \"custom3\": \"value\"\r\n },\r\n \"load\": {\r\n \"quantity\": 0,\r\n \"volume\": 0,\r\n \"weight\": 0,\r\n \"length\": 0,\r\n \"width\": 0,\r\n \"height\": 0\r\n },\r\n \"customerId\": 0,\r\n \"runNumber\": 0,\r\n \"teamRegionId\": 0,\r\n \"contents\": null,\r\n \"driverInstructions\": null\r\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n \"contact\": {\r\n \"name\": \"Matthew Robinson\",\r\n \"phone\": \"0123456789\",\r\n \"email\": \"matt.robinson@email.com\"\r\n },\r\n \"assignedTeamMemberId\": \"ee59-b174-4698-ac55-81d9d\",\r\n \"brandId\": null,\r\n \"name\": \"Locate2u\",\r\n \"address\": \"Level 4, Suite 4.11, 55 Miller St, Pyrmont NSW 2009, Australia\",\r\n \"location\": {\r\n \"latitude\": -33.8706672,\r\n \"longitude\": 151.192487\r\n },\r\n \"type\": null,\r\n \"tripDate\": \"2024-01-29\",\r\n \"appointmentTime\": \"12:00\",\r\n \"timeWindowStart\": null,\r\n \"timeWindowEnd\": null,\r\n \"durationMinutes\": 10,\r\n \"notes\": \"Please call before you deliver\",\r\n \"customFields\": {\r\n \"custom1\": \"value\",\r\n \"custom2\": \"value\",\r\n \"custom3\": \"value\"\r\n },\r\n \"load\": {\r\n \"quantity\": 0,\r\n \"volume\": 0,\r\n \"weight\": 0,\r\n \"length\": 0,\r\n \"width\": 0,\r\n \"height\": 0\r\n },\r\n \"customerId\": 0,\r\n \"runNumber\": 0,\r\n \"teamRegionId\": 0,\r\n \"contents\": null,\r\n \"driverInstructions\": null\r\n}");
Request request = new Request.Builder()
.url("https://api.locate2u.com/api/v1/stops/4275437")
.method("PUT", body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer YourBearerTokenHere")
.build();
Response response = client.newCall(request).execute();
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'PUT',
'hostname': 'api.locate2u.com',
'path': '/api/v1/stops/4275437',
'headers': {
'Content-Type': 'application/json',
'Authorization': 'Bearer YourBearerTokenHere'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({
"contact": {
"name": "Matthew Robinson",
"phone": "0123456789",
"email": "matt.robinson@email.com"
},
"assignedTeamMemberId": "ee59-b174-4698-ac55-81d9d",
"brandId": null,
"name": "Locate2u",
"address": "Level 4, Suite 4.11, 55 Miller St, Pyrmont NSW 2009, Australia",
"location": {
"latitude": -33.8706672,
"longitude": 151.192487
},
"type": null,
"tripDate": "2024-01-29",
"appointmentTime": "12:00",
"timeWindowStart": null,
"timeWindowEnd": null,
"durationMinutes": 10,
"notes": "Please call before you deliver",
"customFields": {
"custom1": "value",
"custom2": "value",
"custom3": "value"
},
"load": {
"quantity": 0,
"volume": 0,
"weight": 0,
"length": 0,
"width": 0,
"height": 0
},
"customerId": 0,
"runNumber": 0,
"teamRegionId": 0,
"contents": null,
"driverInstructions": null
});
req.write(postData);
req.end();
'https://api.locate2u.com/api/v1/stops/4275437',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_POSTFIELDS =>'{
"contact": {
"name": "Matthew Robinson",
"phone": "0123456789",
"email": "matt.robinson@email.com"
},
"assignedTeamMemberId": "ee59-b174-4698-ac55-81d9d",
"brandId": null,
"name": "Locate2u",
"address": "Level 4, Suite 4.11, 55 Miller St, Pyrmont NSW 2009, Australia",
"location": {
"latitude": -33.8706672,
"longitude": 151.192487
},
"type": null,
"tripDate": "2024-01-29",
"appointmentTime": "12:00",
"timeWindowStart": null,
"timeWindowEnd": null,
"durationMinutes": 10,
"notes": "Please call before you deliver",
"customFields": {
"custom1": "value",
"custom2": "value",
"custom3": "value"
},
"load": {
"quantity": 0,
"volume": 0,
"weight": 0,
"length": 0,
"width": 0,
"height": 0
},
"customerId": 0,
"runNumber": 0,
"teamRegionId": 0,
"contents": null,
"driverInstructions": null
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: Bearer YourBearerTokenHere'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
import json
url = "https://api.locate2u.com/api/v1/stops/4275437"
payload = json.dumps({
"contact": {
"name": "Matthew Robinson",
"phone": "0123456789",
"email": "matt.robinson@email.com"
},
"assignedTeamMemberId": "ee59-b174-4698-ac55-81d9d",
"brandId": None,
"name": "Locate2u",
"address": "Level 4, Suite 4.11, 55 Miller St, Pyrmont NSW 2009, Australia",
"location": {
"latitude": -33.8706672,
"longitude": 151.192487
},
"type": None,
"tripDate": "2024-01-29",
"appointmentTime": "12:00",
"timeWindowStart": None,
"timeWindowEnd": None,
"durationMinutes": 10,
"notes": "Please call before you deliver",
"customFields": {
"custom1": "value",
"custom2": "value",
"custom3": "value"
},
"load": {
"quantity": 0,
"volume": 0,
"weight": 0,
"length": 0,
"width": 0,
"height": 0
},
"customerId": 0,
"runNumber": 0,
"teamRegionId": 0,
"contents": None,
"driverInstructions": None
})
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer YourBearerTokenHere'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
Response
200 Success
401 Unauthorized
403 Forbidden