POST api/v1/shipments/import

Import Shipments.

**Please note that when trying to upload more than one shipment at a time it is recommended to use the import endpoint not the POST shipment endpoint.

This API endpoint allows you to import shipments by making an HTTP POST request to the specified URL. The request should include a payload in the raw request body type,can contain an array of shipment objects containing details such as trip date, contact information, pickup and drop stop details, assigned team member, and item information etc. Refer to the POST Shipment endpoint to collect details about fields.

Input parameters:
skipInvalidShipments

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

processInBackground

Default value : false, boolean (query). When set to true, import will handle the geocoding of the shipment’s address in asynchronous way, thus dumping of the shipment data as a part of the import request will take place instantly and returns, and after that geocoding and processing continues in the background. Usually when set to false, it times out when the number of shipments is large.

forceImportInvalidShipments

Default value : false, boolean (query).
When set to true, import will push through the shipment even with the invalid data and that  data, 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 shipments 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.

This API endpoint allows you to import shipments by making an HTTP POST request to the specified URL. The request should include a payload in the raw request body type,can contain an array of shipment objects containing details such as trip date, contact information, pickup and drop stop details, assigned team member, and item information etc. Refer to the POST Shipment endpoint to collect details about fields.

Example Request Payload

[
  {
    "tripDate": "2024-02-07",
    "contact": {
      "name": "Matthew Robinson",
      "phone": "0123456789",
      "email": "matt.robinson@email.com"
    },
    "customFields": {
      "custom1": "value",
      "custom2": "value",
      "custom3": "value"
    },
    "load": {
      "quantity": 0,
      "volume": 0,
      "weight": 0,
      "length": 0,
      "width": 0,
      "height": 0
    },
    "pickupStop": {
      "status": "Pending",
      "contact": {
        "name": "Matthew Robinson",
        "phone": "0123456789",
        "email": "matt.robinson@email.com"
      },
      "name": "Locate2u Pickup Stop",
      "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,
      "tripDate": "2024-02-07T08:05:32.429Z",
      "durationMinutes": 10,
      "notes": "Please call before you deliver",
      "runNumber": null,
      "customerId": 0,
      "customerName": "",
      "brandId": null,
      "brandName": "Locate2u",
      "rateGroupId": null,
      "rateGroupName": "Rate Card 1",
      "oneTimePin": "0011",
      "lines": [
        {
          "barcode": "1234567890",
          "description": "Item A - Barcode scanning item",
          "currentLocation": "Warehouse",
          "serviceId": 0,
          "productVariantId": 0,
          "quantity": 1,
          "customFields": null
        }
      ]
    },
    "dropStop": {
      "status": "Pending",
      "contact": {
        "name": "Matthew Robinson",
        "phone": "0123456789",
        "email": "matt.robinson@email.com"
      },
      "name": "Locate2u Drop Stop",
      "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,
      "tripDate": "2024-02-07T08:05:32.429Z",
      "durationMinutes": 10,
      "notes": "Please call before you deliver",
      "runNumber": null,
      "customerId": 0,
      "customerName": "",
      "brandId": null,
      "brandName": "Locate2u",
      "rateGroupId": null,
      "rateGroupName": "Rate Card 1",
      "oneTimePin": "0012",
      "lines": [
        {
          "barcode": "1234567890",
          "description": "Item A - Barcode scanning item",
          "currentLocation": "Warehouse",
          "serviceId": 0,
          "productVariantId": 0,
          "quantity": 1,
          "customFields": null
        }
      ]
    },
    "assignedTeamMemberId": "ee59-b174-4698-ac55-81d9d",
    "assignedTeamMemberName": "John Doe",
    "notes": "Please call before you deliver",
    "source": null,
    "sourceReference": null,
    "row": 0,
    "customerId": 1930,
    "customerName": "Mango Ltd (Stephan Job)",
    "brandId": null,
    "brandName": "Locate2u",
    "rateGroupId": null,
    "rateGroupName": "Rate Card 1",
    "runNumber": 0,
    "teamRegionId": 0,
    "lines": [
      {
        "barcode": "1234567890",
        "description": "Item A - Barcode scanning item",
        "currentLocation": "Warehouse",
        "serviceId": 0,
        "productVariantId": 0,
        "quantity": 1,
        "customFields": null
      }
    ],
    "rawTeamRegion": "",
    "skills": [
      "Skill 1",
      "Skill 2",
      "Skill 3"
    ],
    "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/shipments/import");
request.Headers.Add("Authorization", "Bearer yourBearerTokenHere");
var content = new StringContent("[\r\n  {\r\n    \"tripDate\": \"2024-02-10\",\r\n    \"contact\": {\r\n      \"name\": \"Matthew Robinson\",\r\n      \"phone\": \"0123456789\",\r\n      \"email\": \"matt.robinson@email.com\"\r\n    },\r\n    \"customFields\": {},\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    \"pickupStop\": {\r\n      \"status\": \"Pending\",\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 Pickup Stop\",\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      \"tripDate\": \"2024-02-10T08:05:32.429Z\",\r\n      \"durationMinutes\": 10,\r\n      \"notes\": \"Please call before you deliver\",\r\n      \"runNumber\": null,\r\n      \"customerId\": 0,\r\n      \"customerName\": \"\",\r\n      \"brandId\": null,\r\n      \"brandName\": \"null\",\r\n      \"rateGroupId\": null,\r\n      \"rateGroupName\": null,\r\n      \"oneTimePin\": \"0011\",\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    },\r\n    \"dropStop\": {\r\n      \"status\": \"Pending\",\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 Drop Stop\",\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      \"tripDate\": \"2024-02-10T09:05:32.429Z\",\r\n      \"durationMinutes\": 10,\r\n      \"notes\": \"Please call before you deliver\",\r\n      \"runNumber\": null,\r\n      \"customerId\": null,\r\n      \"customerName\": \"\",\r\n      \"brandId\": null,\r\n      \"brandName\": \"null\",\r\n      \"rateGroupId\": null,\r\n      \"rateGroupName\": null,\r\n      \"oneTimePin\": \"0012\",\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    },\r\n    \"assignedTeamMemberId\": null,\r\n    \"assignedTeamMemberName\": null,\r\n    \"notes\": \"Please call before you deliver\",\r\n    \"source\": null,\r\n    \"sourceReference\": null,\r\n    \"row\": 0,\r\n    \"customerId\": null,\r\n    \"customerName\": null,\r\n    \"brandId\": null,\r\n    \"brandName\": null,\r\n    \"rateGroupId\": null,\r\n    \"rateGroupName\": null,\r\n    \"runNumber\": null,\r\n    \"teamRegionId\": null,\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    \"rawTeamRegion\": \"\",\r\n    \"skills\": [],\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    \"tripDate\": \"2024-02-10\",\r\n    \"contact\": {\r\n      \"name\": \"Matthew Robinson\",\r\n      \"phone\": \"0123456789\",\r\n      \"email\": \"matt.robinson@email.com\"\r\n    },\r\n    \"customFields\": {},\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    \"pickupStop\": {\r\n      \"status\": \"Pending\",\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 Pickup Stop\",\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      \"tripDate\": \"2024-02-10T08:05:32.429Z\",\r\n      \"durationMinutes\": 10,\r\n      \"notes\": \"Please call before you deliver\",\r\n      \"runNumber\": null,\r\n      \"customerId\": 0,\r\n      \"customerName\": \"\",\r\n      \"brandId\": null,\r\n      \"brandName\": \"null\",\r\n      \"rateGroupId\": null,\r\n      \"rateGroupName\": null,\r\n      \"oneTimePin\": \"0011\",\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    },\r\n    \"dropStop\": {\r\n      \"status\": \"Pending\",\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 Drop Stop\",\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      \"tripDate\": \"2024-02-10T09:05:32.429Z\",\r\n      \"durationMinutes\": 10,\r\n      \"notes\": \"Please call before you deliver\",\r\n      \"runNumber\": null,\r\n      \"customerId\": null,\r\n      \"customerName\": \"\",\r\n      \"brandId\": null,\r\n      \"brandName\": \"null\",\r\n      \"rateGroupId\": null,\r\n      \"rateGroupName\": null,\r\n      \"oneTimePin\": \"0012\",\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    },\r\n    \"assignedTeamMemberId\": null,\r\n    \"assignedTeamMemberName\": null,\r\n    \"notes\": \"Please call before you deliver\",\r\n    \"source\": null,\r\n    \"sourceReference\": null,\r\n    \"row\": 0,\r\n    \"customerId\": null,\r\n    \"customerName\": null,\r\n    \"brandId\": null,\r\n    \"brandName\": null,\r\n    \"rateGroupId\": null,\r\n    \"rateGroupName\": null,\r\n    \"runNumber\": null,\r\n    \"teamRegionId\": null,\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    \"rawTeamRegion\": \"\",\r\n    \"skills\": [],\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/shipments/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/shipments/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([
  {
    "tripDate": "2024-02-10",
    "contact": {
      "name": "Matthew Robinson",
      "phone": "0123456789",
      "email": "matt.robinson@email.com"
    },
    "customFields": {},
    "load": {
      "quantity": 0,
      "volume": 0,
      "weight": 0,
      "length": 0,
      "width": 0,
      "height": 0
    },
    "pickupStop": {
      "status": "Pending",
      "contact": {
        "name": "Matthew Robinson",
        "phone": "0123456789",
        "email": "matt.robinson@email.com"
      },
      "name": "Locate2u Pickup Stop",
      "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,
      "tripDate": "2024-02-10T08:05:32.429Z",
      "durationMinutes": 10,
      "notes": "Please call before you deliver",
      "runNumber": null,
      "customerId": 0,
      "customerName": "",
      "brandId": null,
      "brandName": "null",
      "rateGroupId": null,
      "rateGroupName": null,
      "oneTimePin": "0011",
      "lines": [
        {
          "barcode": "1234567890",
          "description": "Item A - Barcode scanning item",
          "currentLocation": "Warehouse",
          "serviceId": 0,
          "productVariantId": 0,
          "quantity": 1,
          "customFields": null
        }
      ]
    },
    "dropStop": {
      "status": "Pending",
      "contact": {
        "name": "Matthew Robinson",
        "phone": "0123456789",
        "email": "matt.robinson@email.com"
      },
      "name": "Locate2u Drop Stop",
      "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,
      "tripDate": "2024-02-10T09:05:32.429Z",
      "durationMinutes": 10,
      "notes": "Please call before you deliver",
      "runNumber": null,
      "customerId": null,
      "customerName": "",
      "brandId": null,
      "brandName": "null",
      "rateGroupId": null,
      "rateGroupName": null,
      "oneTimePin": "0012",
      "lines": [
        {
          "barcode": "1234567890",
          "description": "Item A - Barcode scanning item",
          "currentLocation": "Warehouse",
          "serviceId": 0,
          "productVariantId": 0,
          "quantity": 1,
          "customFields": null
        }
      ]
    },
    "assignedTeamMemberId": null,
    "assignedTeamMemberName": null,
    "notes": "Please call before you deliver",
    "source": null,
    "sourceReference": null,
    "row": 0,
    "customerId": null,
    "customerName": null,
    "brandId": null,
    "brandName": null,
    "rateGroupId": null,
    "rateGroupName": null,
    "runNumber": null,
    "teamRegionId": null,
    "lines": [
      {
        "barcode": "1234567890",
        "description": "Item A - Barcode scanning item",
        "currentLocation": "Warehouse",
        "serviceId": 0,
        "productVariantId": 0,
        "quantity": 1,
        "customFields": null
      }
    ],
    "rawTeamRegion": "",
    "skills": [],
    "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/shipments/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 =>'[
  {
    "tripDate": "2024-02-10",
    "contact": {
      "name": "Matthew Robinson",
      "phone": "0123456789",
      "email": "matt.robinson@email.com"
    },
    "customFields": {},
    "load": {
      "quantity": 0,
      "volume": 0,
      "weight": 0,
      "length": 0,
      "width": 0,
      "height": 0
    },
    "pickupStop": {
      "status": "Pending",
      "contact": {
        "name": "Matthew Robinson",
        "phone": "0123456789",
        "email": "matt.robinson@email.com"
      },
      "name": "Locate2u Pickup Stop",
      "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,
      "tripDate": "2024-02-10T08:05:32.429Z",
      "durationMinutes": 10,
      "notes": "Please call before you deliver",
      "runNumber": null,
      "customerId": 0,
      "customerName": "",
      "brandId": null,
      "brandName": "null",
      "rateGroupId": null,
      "rateGroupName": null,
      "oneTimePin": "0011",
      "lines": [
        {
          "barcode": "1234567890",
          "description": "Item A - Barcode scanning item",
          "currentLocation": "Warehouse",
          "serviceId": 0,
          "productVariantId": 0,
          "quantity": 1,
          "customFields": null
        }
      ]
    },
    "dropStop": {
      "status": "Pending",
      "contact": {
        "name": "Matthew Robinson",
        "phone": "0123456789",
        "email": "matt.robinson@email.com"
      },
      "name": "Locate2u Drop Stop",
      "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,
      "tripDate": "2024-02-10T09:05:32.429Z",
      "durationMinutes": 10,
      "notes": "Please call before you deliver",
      "runNumber": null,
      "customerId": null,
      "customerName": "",
      "brandId": null,
      "brandName": "null",
      "rateGroupId": null,
      "rateGroupName": null,
      "oneTimePin": "0012",
      "lines": [
        {
          "barcode": "1234567890",
          "description": "Item A - Barcode scanning item",
          "currentLocation": "Warehouse",
          "serviceId": 0,
          "productVariantId": 0,
          "quantity": 1,
          "customFields": null
        }
      ]
    },
    "assignedTeamMemberId": null,
    "assignedTeamMemberName": null,
    "notes": "Please call before you deliver",
    "source": null,
    "sourceReference": null,
    "row": 0,
    "customerId": null,
    "customerName": null,
    "brandId": null,
    "brandName": null,
    "rateGroupId": null,
    "rateGroupName": null,
    "runNumber": null,
    "teamRegionId": null,
    "lines": [
      {
        "barcode": "1234567890",
        "description": "Item A - Barcode scanning item",
        "currentLocation": "Warehouse",
        "serviceId": 0,
        "productVariantId": 0,
        "quantity": 1,
        "customFields": null
      }
    ],
    "rawTeamRegion": "",
    "skills": [],
    "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/shipments/import"


payload = json.dumps([
  {
    "tripDate": "2024-02-10",
    "contact": {
      "name": "Matthew Robinson",
      "phone": "0123456789",
      "email": "matt.robinson@email.com"
    },
    "customFields": {},
    "load": {
      "quantity": 0,
      "volume": 0,
      "weight": 0,
      "length": 0,
      "width": 0,
      "height": 0
    },
    "pickupStop": {
      "status": "Pending",
      "contact": {
        "name": "Matthew Robinson",
        "phone": "0123456789",
        "email": "matt.robinson@email.com"
      },
      "name": "Locate2u Pickup Stop",
      "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,
      "tripDate": "2024-02-10T08:05:32.429Z",
      "durationMinutes": 10,
      "notes": "Please call before you deliver",
      "runNumber": None,
      "customerId": 0,
      "customerName": "",
      "brandId": None,
      "brandName": "null",
      "rateGroupId": None,
      "rateGroupName": None,
      "oneTimePin": "0011",
      "lines": [
        {
          "barcode": "1234567890",
          "description": "Item A - Barcode scanning item",
          "currentLocation": "Warehouse",
          "serviceId": 0,
          "productVariantId": 0,
          "quantity": 1,
          "customFields": None
        }
      ]
    },
    "dropStop": {
      "status": "Pending",
      "contact": {
        "name": "Matthew Robinson",
        "phone": "0123456789",
        "email": "matt.robinson@email.com"
      },
      "name": "Locate2u Drop Stop",
      "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,
      "tripDate": "2024-02-10T09:05:32.429Z",
      "durationMinutes": 10,
      "notes": "Please call before you deliver",
      "runNumber": None,
      "customerId": None,
      "customerName": "",
      "brandId": None,
      "brandName": "null",
      "rateGroupId": None,
      "rateGroupName": None,
      "oneTimePin": "0012",
      "lines": [
        {
          "barcode": "1234567890",
          "description": "Item A - Barcode scanning item",
          "currentLocation": "Warehouse",
          "serviceId": 0,
          "productVariantId": 0,
          "quantity": 1,
          "customFields": None
        }
      ]
    },
    "assignedTeamMemberId": None,
    "assignedTeamMemberName": None,
    "notes": "Please call before you deliver",
    "source": None,
    "sourceReference": None,
    "row": 0,
    "customerId": None,
    "customerName": None,
    "brandId": None,
    "brandName": None,
    "rateGroupId": None,
    "rateGroupName": None,
    "runNumber": None,
    "teamRegionId": None,
    "lines": [
      {
        "barcode": "1234567890",
        "description": "Item A - Barcode scanning item",
        "currentLocation": "Warehouse",
        "serviceId": 0,
        "productVariantId": 0,
        "quantity": 1,
        "customFields": None
      }
    ],
    "rawTeamRegion": "",
    "skills": [],
    "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

Example response : 

 

The response to the request will be in JSON format with a status code of 200. It will include information about the imported shipment, such as shipment ID, shipment reference, validation errors, geocoding status, validity, trip date, contact details, custom fields, load details, pickup stop details, drop stop details, assigned team member details, notes, source, source reference, and item details.

[
    {
        "status": null,
        "shipmentId": 175382,
        "shipmentRef": "LSS00010101KCVR0Z",
        "validationErrors": [],
        "isGeocoded": true,
        "isValid": true,
        "tripDate": "2024-02-09",
        "contact": {
            "name": "Matthew Robinson",
            "phone": "0123456789",
            "email": "matt.robinson@email.com"
        },
        "customFields": null,
        "load": null,
        "pickupStop": {
            "status": "Pending",
            "contact": {
                "name": "Matthew Robinson",
                "phone": "0123456789",
                "email": "matt.robinson@email.com"
            },
            "name": "Locate2u Pickup Stop",
            "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.4673406725737965,
                "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": "14:00",
            "timeWindowStart": null,
            "timeWindowEnd": null,
            "tripDate": "2024-02-09T08:05:32.429Z",
            "durationMinutes": 10,
            "notes": "Please call before you deliver",
            "runNumber": null,
            "customerId": null,
            "customerName": null,
            "brandId": null,
            "brandName": null,
            "rateGroupId": null,
            "rateGroupName": null,
            "oneTimePin": null,
            "lines": []
        },
        "dropStop": {
            "status": "Pending",
            "contact": {
                "name": "Matthew Robinson",
                "phone": "0123456789",
                "email": "matt.robinson@email.com"
            },
            "name": "Locate2u Drop Stop",
            "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.4673406725737965,
                "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": "17:00",
            "timeWindowStart": null,
            "timeWindowEnd": null,
            "tripDate": "2024-02-09T08:05:32.429Z",
            "durationMinutes": 10,
            "notes": "Please call before you deliver",
            "runNumber": null,
            "customerId": null,
            "customerName": null,
            "brandId": null,
            "brandName": null,
            "rateGroupId": null,
            "rateGroupName": null,
            "oneTimePin": null,
            "lines": null
        },
        "assignedTeamMemberId": null,
        "assignedTeamMemberName": null,
        "notes": "Please call before you deliver",
        "source": null,
        "sourceReference": null,
        "row": 1,
        "customerId": null,
        "customerName": null,
        "brandId": null,
        "brandName": null,
        "rateGroupId": null,
        "rateGroupName": null,
        "runNumber": null,
        "teamRegionId": null,
        "lines": [],
        "rawTeamRegion": null,
        "skills": [],
        "item1Barcode": null,
        "item1Description": null,
        "item2Barcode": null,
        "item2Description": null,
        "item3Barcode": null,
        "item3Description": null,
        "item4Barcode": null,
        "item4Description": null,
        "item5Barcode": null,
        "item5Description": null
    }
]