POST api/v1/stops/import

Import Stops

This endpoint allows you to import stops using an HTTP POST request to the specified URL.
***Please note that when trying to upload more than one stop at a time it is recommended to use this import endpoint.

Input parameters: 

skipInvalidStops

Default value : false
boolean (query)
When set to true will skip invalid stop’s data and process the next valid one so that your import process runs smoothly.

processInBackground

Default value : false
boolean (query)

When set to true import will handle the geocoding of the stop’s address in asynchronous way thus dumping of the stop data as a part of the import request will take place instantly and return, then geocoding and processing continues in the background. Usually when set to false it times out when the number of stops are on the higher side.

forceImportInvalidStops

Default value : false

boolean (query)

When set to true import will push through the stops even with the invalid data and that can later on be corrected from the User interface.

batchImportId

string (query)
Developers can pass a unique batchImportId as the identifier for each import of stop under their account. Please make sure that this id is unique for your account i.e. do not use already used import id twice. When left black system will automatically generate a unique identifier for the import and return it as a part of the response.

Request Body

The request body should be in the raw format and should contain an array of stop objects. Each stop object includes details such as contact information, name, address, location, appointment time, duration, custom fields, load details, assigned team member, source, order details, customer details, run details, team region, lines, contents, driver instructions, and item details.

Refer to POST stop endpoint for details about each field.

Example request body:
[
  {
    "contact": {
      "name": "Matthew Robinson",
      "phone": "0123456789",
      "email": "matt.robinson@email.com"
    },
    "name": "Locate2u",
    "address": "Level 4, Suite 4.11, 55 Miller St, Pyrmont NSW 2009, Australia",
    "location": {
      "latitude": -33.8706672,
      "longitude": 151.192487
    },
    "addressComponents": null,
    "appointmentTime": "12:00",
    "timeWindowStart": null,
    "timeWindowEnd": null,
    "durationMinutes": 10,
    "notes": "Please call before you deliver",
    "tripDate": "2024-03-04",
    "customFields": {
      "custom1": "value",
      "custom2": "value",
      "custom3": "value"
    },
    "load": {
      "quantity": 0,
      "volume": 0,
      "weight": 0,
      "length": 0,
      "width": 0,
      "height": 0
    },
    "assignedTeamMemberName": "John Doe",
    "assignedTeamMemberId": "ee59-b174-4698-ac55-81d9d",
    "source": null,
    "sourceReference": null,
    "order": 0,
    "row": 0,
    "type": null,
    "customerId": 1930,
    "brandId": null,
    "brandName": "Locate2u",
    "rateGroupId": null,
    "rateGroupName": "Rate Card 1",
    "customerName": "Mango Ltd (Stephan Job)",
    "runNumber": 0,
    "runName": null,
    "teamRegionId": 0,
    "lines": [
      {
        "barcode": "1234567890",
        "description": "Item A - Barcode scanning item",
        "currentLocation": "Warehouse",
        "serviceId": 0,
        "productVariantId": 0,
        "quantity": 1,
        "customFields": null
      }
    ],
    "contents": null,
    "driverInstructions": null,
    "rawTeamRegion": "",
    "skills": [
      "Skill 1",
      "Skill 2",
      "Skill 3"
    ],
    "oneTimePin": "0011",
    "item1Barcode": null,
    "item1Description": null,
    "item2Barcode": null,
    "item2Description": null,
    "item3Barcode": null,
    "item3Description": null,
    "item4Barcode": null,
    "item4Description": null,
    "item5Barcode": null,
    "item5Description": null
  }
]

Sample code

C#
Java
NodeJS
PHP
Python
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.locate2u.com/api/v1/stops/import");
request.Headers.Add("Authorization", "Bearer yourBearerTokenHere");
var content = new StringContent("[\r\n  {\r\n    \"contact\": {\r\n      \"name\": \"Matthew Robinson\",\r\n      \"phone\": \"0123456789\",\r\n      \"email\": \"matt.robinson@email.com\"\r\n    },\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    \"addressComponents\": null,\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    \"tripDate\": \"2024-02-02\",\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    \"assignedTeamMemberName\": \"\",\r\n    \"assignedTeamMemberId\": \"\",\r\n    \"source\": null,\r\n    \"sourceReference\": null,\r\n    \"order\": 0,\r\n    \"row\": 0,\r\n    \"type\": null,\r\n    \"customerId\": \"\",\r\n    \"brandId\": null,\r\n    \"brandName\": \"\",\r\n    \"rateGroupId\": null,\r\n    \"rateGroupName\": \"\",\r\n    \"customerName\": \"\",\r\n    \"runNumber\": 0,\r\n    \"runName\": null,\r\n    \"teamRegionId\": \"\",\r\n    \"lines\": [\r\n      {\r\n        \"barcode\": \"1234567890\",\r\n        \"description\": \"Item A - Barcode scanning item\",\r\n        \"currentLocation\": \"Warehouse\",\r\n        \"serviceId\": 0,\r\n        \"productVariantId\": 0,\r\n        \"quantity\": 1,\r\n        \"customFields\": null\r\n      }\r\n    ],\r\n    \"contents\": null,\r\n    \"driverInstructions\": null,\r\n    \"rawTeamRegion\": \"\",\r\n    \"skills\": [\r\n      \r\n    ],\r\n    \"oneTimePin\": \"\",\r\n    \"item1Barcode\": null,\r\n    \"item1Description\": null,\r\n    \"item2Barcode\": null,\r\n    \"item2Description\": null,\r\n    \"item3Barcode\": null,\r\n    \"item3Description\": null,\r\n    \"item4Barcode\": null,\r\n    \"item4Description\": null,\r\n    \"item5Barcode\": null,\r\n    \"item5Description\": null\r\n  }\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  {\r\n    \"contact\": {\r\n      \"name\": \"Matthew Robinson\",\r\n      \"phone\": \"0123456789\",\r\n      \"email\": \"matt.robinson@email.com\"\r\n    },\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    \"addressComponents\": null,\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    \"tripDate\": \"2024-02-02\",\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    \"assignedTeamMemberName\": \"\",\r\n    \"assignedTeamMemberId\": \"\",\r\n    \"source\": null,\r\n    \"sourceReference\": null,\r\n    \"order\": 0,\r\n    \"row\": 0,\r\n    \"type\": null,\r\n    \"customerId\": \"\",\r\n    \"brandId\": null,\r\n    \"brandName\": \"\",\r\n    \"rateGroupId\": null,\r\n    \"rateGroupName\": \"\",\r\n    \"customerName\": \"\",\r\n    \"runNumber\": 0,\r\n    \"runName\": null,\r\n    \"teamRegionId\": \"\",\r\n    \"lines\": [\r\n      {\r\n        \"barcode\": \"1234567890\",\r\n        \"description\": \"Item A - Barcode scanning item\",\r\n        \"currentLocation\": \"Warehouse\",\r\n        \"serviceId\": 0,\r\n        \"productVariantId\": 0,\r\n        \"quantity\": 1,\r\n        \"customFields\": null\r\n      }\r\n    ],\r\n    \"contents\": null,\r\n    \"driverInstructions\": null,\r\n    \"rawTeamRegion\": \"\",\r\n    \"skills\": [\r\n      \r\n    ],\r\n    \"oneTimePin\": \"\",\r\n    \"item1Barcode\": null,\r\n    \"item1Description\": null,\r\n    \"item2Barcode\": null,\r\n    \"item2Description\": null,\r\n    \"item3Barcode\": null,\r\n    \"item3Description\": null,\r\n    \"item4Barcode\": null,\r\n    \"item4Description\": null,\r\n    \"item5Barcode\": null,\r\n    \"item5Description\": null\r\n  }\r\n]");
Request request = new Request.Builder()
  .url("https://api.locate2u.com/api/v1/stops/import")
  .method("POST", 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': 'POST',
  'hostname': 'api.locate2u.com',
  'path': '/api/v1/stops/import',
  '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"
    },
    "name": "Locate2u",
    "address": "Level 4, Suite 4.11, 55 Miller St, Pyrmont NSW 2009, Australia",
    "location": {
      "latitude": -33.8706672,
      "longitude": 151.192487
    },
    "addressComponents": null,
    "appointmentTime": "12:00",
    "timeWindowStart": null,
    "timeWindowEnd": null,
    "durationMinutes": 10,
    "notes": "Please call before you deliver",
    "tripDate": "2024-02-02",
    "customFields": {
      "custom1": "value",
      "custom2": "value",
      "custom3": "value"
    },
    "load": {
      "quantity": 0,
      "volume": 0,
      "weight": 0,
      "length": 0,
      "width": 0,
      "height": 0
    },
    "assignedTeamMemberName": "",
    "assignedTeamMemberId": "",
    "source": null,
    "sourceReference": null,
    "order": 0,
    "row": 0,
    "type": null,
    "customerId": "",
    "brandId": null,
    "brandName": "",
    "rateGroupId": null,
    "rateGroupName": "",
    "customerName": "",
    "runNumber": 0,
    "runName": null,
    "teamRegionId": "",
    "lines": [
      {
        "barcode": "1234567890",
        "description": "Item A - Barcode scanning item",
        "currentLocation": "Warehouse",
        "serviceId": 0,
        "productVariantId": 0,
        "quantity": 1,
        "customFields": null
      }
    ],
    "contents": null,
    "driverInstructions": null,
    "rawTeamRegion": "",
    "skills": [],
    "oneTimePin": "",
    "item1Barcode": null,
    "item1Description": null,
    "item2Barcode": null,
    "item2Description": null,
    "item3Barcode": null,
    "item3Description": null,
    "item4Barcode": null,
    "item4Description": null,
    "item5Barcode": null,
    "item5Description": null
  }
]);


req.write(postData);


req.end();
 'https://api.locate2u.com/api/v1/stops/import',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'[
  {
    "contact": {
      "name": "Matthew Robinson",
      "phone": "0123456789",
      "email": "matt.robinson@email.com"
    },
    "name": "Locate2u",
    "address": "Level 4, Suite 4.11, 55 Miller St, Pyrmont NSW 2009, Australia",
    "location": {
      "latitude": -33.8706672,
      "longitude": 151.192487
    },
    "addressComponents": null,
    "appointmentTime": "12:00",
    "timeWindowStart": null,
    "timeWindowEnd": null,
    "durationMinutes": 10,
    "notes": "Please call before you deliver",
    "tripDate": "2024-02-02",
    "customFields": {
      "custom1": "value",
      "custom2": "value",
      "custom3": "value"
    },
    "load": {
      "quantity": 0,
      "volume": 0,
      "weight": 0,
      "length": 0,
      "width": 0,
      "height": 0
    },
    "assignedTeamMemberName": "",
    "assignedTeamMemberId": "",
    "source": null,
    "sourceReference": null,
    "order": 0,
    "row": 0,
    "type": null,
    "customerId": "",
    "brandId": null,
    "brandName": "",
    "rateGroupId": null,
    "rateGroupName": "",
    "customerName": "",
    "runNumber": 0,
    "runName": null,
    "teamRegionId": "",
    "lines": [
      {
        "barcode": "1234567890",
        "description": "Item A - Barcode scanning item",
        "currentLocation": "Warehouse",
        "serviceId": 0,
        "productVariantId": 0,
        "quantity": 1,
        "customFields": null
      }
    ],
    "contents": null,
    "driverInstructions": null,
    "rawTeamRegion": "",
    "skills": [
     
    ],
    "oneTimePin": "",
    "item1Barcode": null,
    "item1Description": null,
    "item2Barcode": null,
    "item2Description": null,
    "item3Barcode": null,
    "item3Description": null,
    "item4Barcode": null,
    "item4Description": null,
    "item5Barcode": null,
    "item5Description": 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/import"


payload = json.dumps([
  {
    "contact": {
      "name": "Matthew Robinson",
      "phone": "0123456789",
      "email": "matt.robinson@email.com"
    },
    "name": "Locate2u",
    "address": "Level 4, Suite 4.11, 55 Miller St, Pyrmont NSW 2009, Australia",
    "location": {
      "latitude": -33.8706672,
      "longitude": 151.192487
    },
    "addressComponents": None,
    "appointmentTime": "12:00",
    "timeWindowStart": None,
    "timeWindowEnd": None,
    "durationMinutes": 10,
    "notes": "Please call before you deliver",
    "tripDate": "2024-02-02",
    "customFields": {
      "custom1": "value",
      "custom2": "value",
      "custom3": "value"
    },
    "load": {
      "quantity": 0,
      "volume": 0,
      "weight": 0,
      "length": 0,
      "width": 0,
      "height": 0
    },
    "assignedTeamMemberName": "",
    "assignedTeamMemberId": "",
    "source": None,
    "sourceReference": None,
    "order": 0,
    "row": 0,
    "type": None,
    "customerId": "",
    "brandId": None,
    "brandName": "",
    "rateGroupId": None,
    "rateGroupName": "",
    "customerName": "",
    "runNumber": 0,
    "runName": None,
    "teamRegionId": "",
    "lines": [
      {
        "barcode": "1234567890",
        "description": "Item A - Barcode scanning item",
        "currentLocation": "Warehouse",
        "serviceId": 0,
        "productVariantId": 0,
        "quantity": 1,
        "customFields": None
      }
    ],
    "contents": None,
    "driverInstructions": None,
    "rawTeamRegion": "",
    "skills": [],
    "oneTimePin": "",
    "item1Barcode": None,
    "item1Description": None,
    "item2Barcode": None,
    "item2Description": None,
    "item3Barcode": None,
    "item3Description": None,
    "item4Barcode": None,
    "item4Description": None,
    "item5Barcode": None,
    "item5Description": None
  }
])
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer yourBearerTokenHere'
}


response = requests.request("POST", url, headers=headers, data=payload)


print(response.text)

Response

Response

Upon successful execution, the endpoint returns a status code of 200 along with an array of stop objects in JSON format. Each stop object in the response includes details such as status, stop ID, stop reference, validation errors, geocoding information, contact details, name, address, location, appointment time, duration, custom fields, load details, assigned team member, source, order details, customer details, run details, team region, lines, contents, driver instructions, and item details.

Example response :

[
    {
        "status": null,
        "stopId": 5218562,
        "stopRef": "L20240102GABX41",
        "validationErrors": [],
        "isGeocoded": true,
        "isValid": true,
        "contact": {
            "name": "Matthew Robinson",
            "phone": "0123456789",
            "email": "matt.robinson@email.com"
        },
        "name": "Locate2u",
        "address": "Level 4, Suite 4.11, 55 Miller St, Pyrmont NSW 2009, Australia",
        "location": {
            "latitude": -33.8706672,
            "longitude": 151.192487
        },
        "addressComponents": {
            "geocoder": "Azure Maps",
            "type": "Cross Street",
            "confidenceScore": 0.4673339820126472,
            "address": "Western Distributor Freeway & Miller Street, Pyrmont, NSW, 2009",
            "location": {
                "latitude": -33.87089,
                "longitude": 151.19157
            },
            "line1": "Western Distributor Freeway, A 4 & Miller Street",
            "line2": null,
            "city": "Pyrmont",
            "province": "New South Wales",
            "provinceCode": "NSW",
            "postcode": "2009",
            "country": "Australia",
            "countryCode": "AU"
        },
        "appointmentTime": "12:00",
        "timeWindowStart": null,
        "timeWindowEnd": null,
        "durationMinutes": 10,
        "notes": "Please call before you deliver",
        "tripDate": "2024-02-02",
        "customFields": {
            "custom1": "value",
            "custom2": "value",
            "custom3": "value"
        },
        "load": {
            "quantity": 0,
            "volume": 0,
            "weight": 0,
            "length": 0,
            "width": 0,
            "height": 0
        },
        "assignedTeamMemberName": "",
        "assignedTeamMemberId": "",
        "source": null,
        "sourceReference": null,
        "order": 0,
        "row": 1,
        "type": null,
        "customerId": null,
        "brandId": null,
        "brandName": "",
        "rateGroupId": null,
        "rateGroupName": "",
        "customerName": "",
        "runNumber": 0,
        "runName": null,
        "teamRegionId": null,
        "lines": [
            {
                "barcode": "1234567890",
                "description": "Item A - Barcode scanning item",
                "currentLocation": "Warehouse",
                "serviceId": 0,
                "productVariantId": 0,
                "quantity": 1.0,
                "customFields": null
            }
        ],
        "contents": null,
        "driverInstructions": null,
        "rawTeamRegion": "",
        "skills": [],
        "oneTimePin": "",
        "item1Barcode": null,
        "item1Description": null,
        "item2Barcode": null,
        "item2Description": null,
        "item3Barcode": null,
        "item3Description": null,
        "item4Barcode": null,
        "item4Description": null,
        "item5Barcode": null,
        "item5Description": null
    }
]