POST /api/v1/orders/import
Bulk Import Orders
This endpoint is designed to accept a batch of orders along with their associated details such as order lines, items, and pickup/drop locations. It processes this information to create the necessary pickup and drop stops, as well as attach the respective items to these stops. This allows seamless execution of delivery or pickup logistics based on the provided order data.
Request Body Structure
The request body for this endpoint supports importing bulk orders, allowing you to include comprehensive order details in a single request. The payload should be in raw JSON format and adhere to the following structure.
Required Fields
- orderDate (string): The date when the order was placed.
Request Body Parameters
Order-Level Fields
- orderNumber (string): Unique identifier for the order.
- source (string): Source of the order, e.g., “API” or “Manual”.
- sourceReference (string): Reference ID from the source system.
- sourceStatus (string): Status of the order in the source system, e.g., “unfulfilled”.
- customerId (integer): Identifier for the customer (nullable).
Contact Details
- contact(object): Information about the primary contact for the order.
- name (string): Full name of the contact.
- phone (string): Phone number of the contact.
- email (string): Email address of the contact.
Address Fields
Pickup Address
- pickupAddress(object): Details of the pickup location.
- contact(object): Information about the pickup contact.
- name (string): Name of the pickup contact.
- phone (string): Phone number of the pickup contact.
- email (string): Email address of the pickup contact.
- address (string): Full address of the pickup location.
- location(object): GPS coordinates of the pickup location.
- latitude (number): Latitude of the location.
- longitude (number): Longitude of the location.
- name (string): Name of the pickup location.
- line1 (string): First line of the address.
- line2 (string): Second line of the address (optional).
- city (string): City of the pickup location.
- province (string): State or province of the pickup location.
- provinceCode (string): Code for the province or state.
- postcode (string): Postal code of the pickup location.
- country (string): Country of the pickup location.
- countryCode (string): ISO code for the country.
- contact(object): Information about the pickup contact.
Shipping Address
- shippingAddress (object): Similar structure to the pickupAddress, but for the delivery destination.
Order Details
- orderDate (string): Date when the order was created.
- expectedDeliveryDate (string): Expected delivery date for the order.
- readyPickupAvailableDate (string, nullable): Date when the pickup becomes available.
- deliveryInstructions (string): Instructions specific to the delivery.
- notes (string): General notes regarding the order.
- timeWindowStart (string, nullable): Start time for the delivery window.
- timeWindowEnd (string, nullable): End time for the delivery window.
Load Information
- load(object): Specifications of the load.
- quantity (integer): Number of items in the order.
- volume (number): Total volume of the load.
- weight (number): Total weight of the load.
- length (number): Length of the load.
- width (number): Width of the load.
- height (number): Height of the load.
Skills
- skills (array of strings): List of specific skills required for handling the order.
Order Line Details
- orderLines(array of objects): Individual order lines within the order.
- quantity (integer): Quantity of the product in the order.
- productReference (string): Unique reference ID for the product.
- load (object): Load details for the product (same structure as the order-level load).
Items
- items(array of objects): Item-specific details within the order.
- barcode (string): Unique barcode for the item.
- description (string): Description of the item.
- readyPickupAvailableDate (string): Date when the item is ready for pickup.
- readyDeliveryAvailableDate (string): Date when the item is ready for delivery.
- expectedDeliveryDate (string): Expected delivery date for the item.
- sourceReference (string): Internal reference ID.
- warehouseId (integer, nullable): ID of the warehouse where the item is stored.
- currentLocationName (string): Name of the item’s current location.
- pickupContact(object): Details of the contact at the pickup location.
- name (string): Name of the pickup contact.
- phone (string): Phone number of the pickup contact.
- email (string): Email address of the pickup contact.
- itemLines(array of objects): Sub-items within the main item.
- quantity (integer): Quantity of the sub-item.
- description (string): Description of the sub-item.
- productReference (string): Reference ID for the sub-item.
createPickupStop: Specifies whether a pickup stop should be created for the order.
createDropStop: Specifies whether a drop-off stop should be created for the order.
Example Request Body :
[
{
"orderNumber": "101",
"source": "Api",
"sourceReference": "1234567890",
"sourceStatus": "unfulfilled",
"customerId": null,
"contact": {
"name": "Matthew Robinson",
"phone": "0123456789",
"email": "matt.robinson@email.com"
},
"readyPickupAvailableDate": null,
"pickupAddress": {
"contact": {
"name": "Peter Downing",
"phone": "2222222222",
"email": "peter.downing@email.com"
},
"address": "102 George St, The Rocks NSW 2000, Australia",
"location": {
"latitude": -33.858314,
"longitude": 151.209102
},
"name": "The Rocks",
"line1": "102 George St",
"line2": "",
"city": "Sydney",
"province": "New South Wales",
"provinceCode": "NSW",
"postcode": "2000",
"country": "Australia",
"countryCode": "AU"
},
"shippingAddress": {
"contact": {
"name": "Victor Grass",
"phone": "3333333333",
"email": "victor.grass@email.com"
},
"address": "Level 4, Suite 4.11, 55 Miller St, Pyrmont NSW 2009, Australia",
"location": {
"latitude": -33.8706672,
"longitude": 151.192487
},
"name": "55 Miller Street, Pyrmont, 2009, AU",
"line1": "55 Miller Street",
"line2": "",
"city": "Pyrmont",
"province": "Pyrmont New South Wales",
"provinceCode": "NSW",
"postcode": "2009",
"country": "Australia",
"countryCode": "AU"
},
"orderDate": "2024-11-23T00:00:00.000Z",
"expectedDeliveryDate": "2024-11-25T00:00:00.000Z",
"createPickupStop": "2024-11-25T00:00:00.000Z",
"createDropStop": "2024-11-25T00:00:00.000Z",
"pickupTimeWindowStart": null,
"pickupTimeWindowEnd": null,
"timeWindowStart": null,
"timeWindowEnd": null,
"load": {
"quantity": 0,
"volume": 0,
"weight": 0,
"length": 0,
"width": 0,
"height": 0
},
"customFields": {
"custom1": "value",
"custom2": "value",
"custom3": "value"
},
"skills": [
"Skill 1",
"Skill 2",
"Skill 3"
],
"deliveryInstructions": "Test delivery instructions",
"notes": "Happy Notes",
"orderLines": [
{
"quantity": 1,
"productReference": "PR-000001",
"load": {
"quantity": 0,
"volume": 0,
"weight": 0,
"length": 0,
"width": 0,
"height": 0
}
}
],
"items": [
{
"readyPickupAvailableDate": "2024-11-23T00:00:00.000Z",
"readyDeliveryAvailableDate": "2024-11-24T00:00:00.000Z",
"expectedDeliveryDate": "2024-11-25T00:00:00.000Z",
"barcode": "000000000AABB",
"description": "Item Description",
"sourceReference": "Internal Reference",
"warehouseId": null,
"currentLocationName": "Sydney Warehouse",
"load": {
"quantity": 1,
"volume": 0,
"weight": 0,
"length": 0,
"width": 0,
"height": 0
},
"location": {
"latitude": 0,
"longitude": 0
},
"pickupContact": {
"name": "Luke Stanley",
"phone": "4444444444",
"email": "luke.stanley@email.com"
},
"itemLines": [
{
"quantity": 4,
"description": "Bag of red apples",
"productReference": "PR-0000001"
},
{
"quantity": 7,
"description": "Bag of green apples",
"productReference": "PR-0000002"
}
]
}
]
}
]
Sample code
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api-test.locate2u.com/api/v1/orders/import");
request.Headers.Add("Authorization", "Bearer yourBearerTokenHere");
var content = new StringContent("[\r\n {\r\n \"orderNumber\": \"0070\",\r\n \"source\": \"Api\",\r\n \"sourceReference\": \"KaushalTest1ingOrders\",\r\n \"contact\": {\r\n \"name\": \"Matthew Robinson\",\r\n \"phone\": \"0123456789\",\r\n \"email\": \"matt.robinson@email.com\"\r\n },\r\n \"readyPickupAvailableDate\": \"2025-01-11T00:00:00.000Z\",\r\n \"pickupAddress\": {\r\n \"contact\": {\r\n \"name\": \"Peter Downing\",\r\n \"phone\": \"2222222222\",\r\n \"email\": \"peter.downing@email.com\"\r\n },\r\n \"address\": \"102 George St, The Rocks NSW 2000, Australia\",\r\n \"location\": {\r\n \"latitude\": -33.858314,\r\n \"longitude\": 151.209102\r\n },\r\n \"name\": \"The Rocks\",\r\n \"line1\": \"102 George St\",\r\n \"line2\": \"\",\r\n \"city\": \"Sydney\",\r\n \"province\": \"New South Wales\",\r\n \"provinceCode\": \"NSW\",\r\n \"postcode\": \"2000\",\r\n \"country\": \"Australia\",\r\n \"countryCode\": \"AU\"\r\n },\r\n \"shippingAddress\": {\r\n \"contact\": {\r\n \"name\": \"Victor Grass\",\r\n \"phone\": \"3333333333\",\r\n \"email\": \"victor.grass@email.com\"\r\n },\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 \"name\": \"55 Miller Street, Pyrmont, 2009, AU\",\r\n \"line1\": \"55 Miller Street\",\r\n \"line2\": \"\",\r\n \"city\": \"Pyrmont\",\r\n \"province\": \"Pyrmont New South Wales\",\r\n \"provinceCode\": \"NSW\",\r\n \"postcode\": \"2009\",\r\n \"country\": \"Australia\",\r\n \"countryCode\": \"AU\"\r\n },\r\n \"orderDate\": \"2025-01-10T00:00:00.000Z\",\r\n \"expectedDeliveryDate\": \"2025-01-12T00:00:00.000Z\",\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 \r\n \"deliveryInstructions\": \"Test delivery instructions\",\r\n \"notes\": \"Happy Notes\",\r\n \"orderLines\": [\r\n {\r\n \"quantity\": 1,\r\n \"productReference\": \"PR-000001\",\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 }\r\n ],\r\n \"items\": [\r\n {\r\n \"barcode\": \"000000000AABB\",\r\n \"description\": \"Item Description\",\r\n \"sourceReference\": \"Internal Reference\",\r\n \"warehouseId\": null,\r\n \"currentLocationName\": \"Sydney Warehouse\",\r\n \"load\": {\r\n \"quantity\": 1,\r\n \"volume\": 0,\r\n \"weight\": 0,\r\n \"length\": 0,\r\n \"width\": 0,\r\n \"height\": 0\r\n },\r\n \"location\": {\r\n \"latitude\": 0,\r\n \"longitude\": 0\r\n },\r\n \"itemLines\": [\r\n {\r\n \"quantity\": 4,\r\n \"description\": \"Bag of red apples\",\r\n \"productReference\": \"PR-0000001\"\r\n },\r\n {\r\n \"quantity\": 7,\r\n \"description\": \"Bag of green apples\",\r\n \"productReference\": \"PR-0000002\"\r\n }\r\n ]\r\n }\r\n ]\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 \"orderNumber\": \"0070\",\r\n \"source\": \"Api\",\r\n \"sourceReference\": \"KaushalTest1ingOrders\",\r\n \"contact\": {\r\n \"name\": \"Matthew Robinson\",\r\n \"phone\": \"0123456789\",\r\n \"email\": \"matt.robinson@email.com\"\r\n },\r\n \"readyPickupAvailableDate\": \"2025-01-11T00:00:00.000Z\",\r\n \"pickupAddress\": {\r\n \"contact\": {\r\n \"name\": \"Peter Downing\",\r\n \"phone\": \"2222222222\",\r\n \"email\": \"peter.downing@email.com\"\r\n },\r\n \"address\": \"102 George St, The Rocks NSW 2000, Australia\",\r\n \"location\": {\r\n \"latitude\": -33.858314,\r\n \"longitude\": 151.209102\r\n },\r\n \"name\": \"The Rocks\",\r\n \"line1\": \"102 George St\",\r\n \"line2\": \"\",\r\n \"city\": \"Sydney\",\r\n \"province\": \"New South Wales\",\r\n \"provinceCode\": \"NSW\",\r\n \"postcode\": \"2000\",\r\n \"country\": \"Australia\",\r\n \"countryCode\": \"AU\"\r\n },\r\n \"shippingAddress\": {\r\n \"contact\": {\r\n \"name\": \"Victor Grass\",\r\n \"phone\": \"3333333333\",\r\n \"email\": \"victor.grass@email.com\"\r\n },\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 \"name\": \"55 Miller Street, Pyrmont, 2009, AU\",\r\n \"line1\": \"55 Miller Street\",\r\n \"line2\": \"\",\r\n \"city\": \"Pyrmont\",\r\n \"province\": \"Pyrmont New South Wales\",\r\n \"provinceCode\": \"NSW\",\r\n \"postcode\": \"2009\",\r\n \"country\": \"Australia\",\r\n \"countryCode\": \"AU\"\r\n },\r\n \"orderDate\": \"2025-01-10T00:00:00.000Z\",\r\n \"expectedDeliveryDate\": \"2025-01-12T00:00:00.000Z\",\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 \r\n \"deliveryInstructions\": \"Test delivery instructions\",\r\n \"notes\": \"Happy Notes\",\r\n \"orderLines\": [\r\n {\r\n \"quantity\": 1,\r\n \"productReference\": \"PR-000001\",\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 }\r\n ],\r\n \"items\": [\r\n {\r\n \"barcode\": \"000000000AABB\",\r\n \"description\": \"Item Description\",\r\n \"sourceReference\": \"Internal Reference\",\r\n \"warehouseId\": null,\r\n \"currentLocationName\": \"Sydney Warehouse\",\r\n \"load\": {\r\n \"quantity\": 1,\r\n \"volume\": 0,\r\n \"weight\": 0,\r\n \"length\": 0,\r\n \"width\": 0,\r\n \"height\": 0\r\n },\r\n \"location\": {\r\n \"latitude\": 0,\r\n \"longitude\": 0\r\n },\r\n \"itemLines\": [\r\n {\r\n \"quantity\": 4,\r\n \"description\": \"Bag of red apples\",\r\n \"productReference\": \"PR-0000001\"\r\n },\r\n {\r\n \"quantity\": 7,\r\n \"description\": \"Bag of green apples\",\r\n \"productReference\": \"PR-0000002\"\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n]");
Request request = new Request.Builder()
.url("https://api-test.locate2u.com/api/v1/orders/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-test.locate2u.com',
'path': '/api/v1/orders/import',
'headers': {
'Content-Type': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjI0RDcyQjQ0RTczODhCMjRFMTg3NjA1MDdENEEzMzc5NUQ3QTdGMUUiLCJ0eXAiOiJhdCtqd3QiLCJ4NXQiOiJKTmNyUk9jNGl5VGhoMkJRZlVvemVWMTZmeDQifQ.eyJuYmYiOjE3MzY0OTY2ODUsImV4cCI6MTczNjUwMDI4NSwiaXNzIjoiaHR0cHM6Ly9pZC5sb2NhdGUydS5jb20iLCJhdWQiOiJsb2NhdGUydS5hcGkiLCJjbGllbnRfaWQiOiIzM2NiNTc1NS02OTE4LTQ4YTctODQ3Ni04NWNkNTk1NWI5OGMiLCJzY29wZSI6WyJsb2NhdGUydS5hcGkiXX0.ZUpIyUrzfLi9N9RvpvICqhg5rFhQ0_Gi-Q0f3pChzNkL9dJvLSt30Dmyx8DOv9eeX36Y90Anp3fq_ooTUaB2bk-73iY5bSJi4aXRKY2U1WKWsJhMZ_nZgk_tlTGSBrgEebMUEmzVbp_fFSN_xsxTNGlQQYWxgVTluodxH6KB8eT-yJOeYYAovWr9Yy3kvgEyupBW2vgGrN6Zcs8QpZ13Fa4ToNc4P2Zg5pNqFuFCDZEAdmauvcIQIkOeRQr4n9a9zjH9w5oDKtq-HmwT3IRCcOUH1UrSX1OHS0dc6Zv3xTtbBPDsQFulvtF7_RklDk8HVfvrVTS_umUjI1OmXxJnaw'
},
'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([
{
"orderNumber": "0070",
"source": "Api",
"sourceReference": "KaushalTest1ingOrders",
"contact": {
"name": "Matthew Robinson",
"phone": "0123456789",
"email": "matt.robinson@email.com"
},
"readyPickupAvailableDate": "2025-01-11T00:00:00.000Z",
"pickupAddress": {
"contact": {
"name": "Peter Downing",
"phone": "2222222222",
"email": "peter.downing@email.com"
},
"address": "102 George St, The Rocks NSW 2000, Australia",
"location": {
"latitude": -33.858314,
"longitude": 151.209102
},
"name": "The Rocks",
"line1": "102 George St",
"line2": "",
"city": "Sydney",
"province": "New South Wales",
"provinceCode": "NSW",
"postcode": "2000",
"country": "Australia",
"countryCode": "AU"
},
"shippingAddress": {
"contact": {
"name": "Victor Grass",
"phone": "3333333333",
"email": "victor.grass@email.com"
},
"address": "Level 4, Suite 4.11, 55 Miller St, Pyrmont NSW 2009, Australia",
"location": {
"latitude": -33.8706672,
"longitude": 151.192487
},
"name": "55 Miller Street, Pyrmont, 2009, AU",
"line1": "55 Miller Street",
"line2": "",
"city": "Pyrmont",
"province": "Pyrmont New South Wales",
"provinceCode": "NSW",
"postcode": "2009",
"country": "Australia",
"countryCode": "AU"
},
"orderDate": "2025-01-10T00:00:00.000Z",
"expectedDeliveryDate": "2025-01-12T00:00:00.000Z",
"load": {
"quantity": 0,
"volume": 0,
"weight": 0,
"length": 0,
"width": 0,
"height": 0
},
"deliveryInstructions": "Test delivery instructions",
"notes": "Happy Notes",
"orderLines": [
{
"quantity": 1,
"productReference": "PR-000001",
"load": {
"quantity": 0,
"volume": 0,
"weight": 0,
"length": 0,
"width": 0,
"height": 0
}
}
],
"items": [
{
"barcode": "000000000AABB",
"description": "Item Description",
"sourceReference": "Internal Reference",
"warehouseId": null,
"currentLocationName": "Sydney Warehouse",
"load": {
"quantity": 1,
"volume": 0,
"weight": 0,
"length": 0,
"width": 0,
"height": 0
},
"location": {
"latitude": 0,
"longitude": 0
},
"itemLines": [
{
"quantity": 4,
"description": "Bag of red apples",
"productReference": "PR-0000001"
},
{
"quantity": 7,
"description": "Bag of green apples",
"productReference": "PR-0000002"
}
]
}
]
}
]);
req.write(postData);
req.end();
'https://api-test.locate2u.com/api/v1/orders/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 =>'[
{
"orderNumber": "0070",
"source": "Api",
"sourceReference": "KaushalTest1ingOrders",
"contact": {
"name": "Matthew Robinson",
"phone": "0123456789",
"email": "matt.robinson@email.com"
},
"readyPickupAvailableDate": "2025-01-11T00:00:00.000Z",
"pickupAddress": {
"contact": {
"name": "Peter Downing",
"phone": "2222222222",
"email": "peter.downing@email.com"
},
"address": "102 George St, The Rocks NSW 2000, Australia",
"location": {
"latitude": -33.858314,
"longitude": 151.209102
},
"name": "The Rocks",
"line1": "102 George St",
"line2": "",
"city": "Sydney",
"province": "New South Wales",
"provinceCode": "NSW",
"postcode": "2000",
"country": "Australia",
"countryCode": "AU"
},
"shippingAddress": {
"contact": {
"name": "Victor Grass",
"phone": "3333333333",
"email": "victor.grass@email.com"
},
"address": "Level 4, Suite 4.11, 55 Miller St, Pyrmont NSW 2009, Australia",
"location": {
"latitude": -33.8706672,
"longitude": 151.192487
},
"name": "55 Miller Street, Pyrmont, 2009, AU",
"line1": "55 Miller Street",
"line2": "",
"city": "Pyrmont",
"province": "Pyrmont New South Wales",
"provinceCode": "NSW",
"postcode": "2009",
"country": "Australia",
"countryCode": "AU"
},
"orderDate": "2025-01-10T00:00:00.000Z",
"expectedDeliveryDate": "2025-01-12T00:00:00.000Z",
"load": {
"quantity": 0,
"volume": 0,
"weight": 0,
"length": 0,
"width": 0,
"height": 0
},
"deliveryInstructions": "Test delivery instructions",
"notes": "Happy Notes",
"orderLines": [
{
"quantity": 1,
"productReference": "PR-000001",
"load": {
"quantity": 0,
"volume": 0,
"weight": 0,
"length": 0,
"width": 0,
"height": 0
}
}
],
"items": [
{
"barcode": "000000000AABB",
"description": "Item Description",
"sourceReference": "Internal Reference",
"warehouseId": null,
"currentLocationName": "Sydney Warehouse",
"load": {
"quantity": 1,
"volume": 0,
"weight": 0,
"length": 0,
"width": 0,
"height": 0
},
"location": {
"latitude": 0,
"longitude": 0
},
"itemLines": [
{
"quantity": 4,
"description": "Bag of red apples",
"productReference": "PR-0000001"
},
{
"quantity": 7,
"description": "Bag of green apples",
"productReference": "PR-0000002"
}
]
}
]
}
]',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjI0RDcyQjQ0RTczODhCMjRFMTg3NjA1MDdENEEzMzc5NUQ3QTdGMUUiLCJ0eXAiOiJhdCtqd3QiLCJ4NXQiOiJKTmNyUk9jNGl5VGhoMkJRZlVvemVWMTZmeDQifQ.eyJuYmYiOjE3MzY0OTY2ODUsImV4cCI6MTczNjUwMDI4NSwiaXNzIjoiaHR0cHM6Ly9pZC5sb2NhdGUydS5jb20iLCJhdWQiOiJsb2NhdGUydS5hcGkiLCJjbGllbnRfaWQiOiIzM2NiNTc1NS02OTE4LTQ4YTctODQ3Ni04NWNkNTk1NWI5OGMiLCJzY29wZSI6WyJsb2NhdGUydS5hcGkiXX0.ZUpIyUrzfLi9N9RvpvICqhg5rFhQ0_Gi-Q0f3pChzNkL9dJvLSt30Dmyx8DOv9eeX36Y90Anp3fq_ooTUaB2bk-73iY5bSJi4aXRKY2U1WKWsJhMZ_nZgk_tlTGSBrgEebMUEmzVbp_fFSN_xsxTNGlQQYWxgVTluodxH6KB8eT-yJOeYYAovWr9Yy3kvgEyupBW2vgGrN6Zcs8QpZ13Fa4ToNc4P2Zg5pNqFuFCDZEAdmauvcIQIkOeRQr4n9a9zjH9w5oDKtq-HmwT3IRCcOUH1UrSX1OHS0dc6Zv3xTtbBPDsQFulvtF7_RklDk8HVfvrVTS_umUjI1OmXxJnaw'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
import json
url = "https://api-test.locate2u.com/api/v1/orders/import"
payload = json.dumps([
{
"orderNumber": "0070",
"source": "Api",
"sourceReference": "KaushalTest1ingOrders",
"contact": {
"name": "Matthew Robinson",
"phone": "0123456789",
"email": "matt.robinson@email.com"
},
"readyPickupAvailableDate": "2025-01-11T00:00:00.000Z",
"pickupAddress": {
"contact": {
"name": "Peter Downing",
"phone": "2222222222",
"email": "peter.downing@email.com"
},
"address": "102 George St, The Rocks NSW 2000, Australia",
"location": {
"latitude": -33.858314,
"longitude": 151.209102
},
"name": "The Rocks",
"line1": "102 George St",
"line2": "",
"city": "Sydney",
"province": "New South Wales",
"provinceCode": "NSW",
"postcode": "2000",
"country": "Australia",
"countryCode": "AU"
},
"shippingAddress": {
"contact": {
"name": "Victor Grass",
"phone": "3333333333",
"email": "victor.grass@email.com"
},
"address": "Level 4, Suite 4.11, 55 Miller St, Pyrmont NSW 2009, Australia",
"location": {
"latitude": -33.8706672,
"longitude": 151.192487
},
"name": "55 Miller Street, Pyrmont, 2009, AU",
"line1": "55 Miller Street",
"line2": "",
"city": "Pyrmont",
"province": "Pyrmont New South Wales",
"provinceCode": "NSW",
"postcode": "2009",
"country": "Australia",
"countryCode": "AU"
},
"orderDate": "2025-01-10T00:00:00.000Z",
"expectedDeliveryDate": "2025-01-12T00:00:00.000Z",
"load": {
"quantity": 0,
"volume": 0,
"weight": 0,
"length": 0,
"width": 0,
"height": 0
},
"deliveryInstructions": "Test delivery instructions",
"notes": "Happy Notes",
"orderLines": [
{
"quantity": 1,
"productReference": "PR-000001",
"load": {
"quantity": 0,
"volume": 0,
"weight": 0,
"length": 0,
"width": 0,
"height": 0
}
}
],
"items": [
{
"barcode": "000000000AABB",
"description": "Item Description",
"sourceReference": "Internal Reference",
"warehouseId": None,
"currentLocationName": "Sydney Warehouse",
"load": {
"quantity": 1,
"volume": 0,
"weight": 0,
"length": 0,
"width": 0,
"height": 0
},
"location": {
"latitude": 0,
"longitude": 0
},
"itemLines": [
{
"quantity": 4,
"description": "Bag of red apples",
"productReference": "PR-0000001"
},
{
"quantity": 7,
"description": "Bag of green apples",
"productReference": "PR-0000002"
}
]
}
]
}
])
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjI0RDcyQjQ0RTczODhCMjRFMTg3NjA1MDdENEEzMzc5NUQ3QTdGMUUiLCJ0eXAiOiJhdCtqd3QiLCJ4NXQiOiJKTmNyUk9jNGl5VGhoMkJRZlVvemVWMTZmeDQifQ.eyJuYmYiOjE3MzY0OTY2ODUsImV4cCI6MTczNjUwMDI4NSwiaXNzIjoiaHR0cHM6Ly9pZC5sb2NhdGUydS5jb20iLCJhdWQiOiJsb2NhdGUydS5hcGkiLCJjbGllbnRfaWQiOiIzM2NiNTc1NS02OTE4LTQ4YTctODQ3Ni04NWNkNTk1NWI5OGMiLCJzY29wZSI6WyJsb2NhdGUydS5hcGkiXX0.ZUpIyUrzfLi9N9RvpvICqhg5rFhQ0_Gi-Q0f3pChzNkL9dJvLSt30Dmyx8DOv9eeX36Y90Anp3fq_ooTUaB2bk-73iY5bSJi4aXRKY2U1WKWsJhMZ_nZgk_tlTGSBrgEebMUEmzVbp_fFSN_xsxTNGlQQYWxgVTluodxH6KB8eT-yJOeYYAovWr9Yy3kvgEyupBW2vgGrN6Zcs8QpZ13Fa4ToNc4P2Zg5pNqFuFCDZEAdmauvcIQIkOeRQr4n9a9zjH9w5oDKtq-HmwT3IRCcOUH1UrSX1OHS0dc6Zv3xTtbBPDsQFulvtF7_RklDk8HVfvrVTS_umUjI1OmXxJnaw'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
Response
Response Structure
The response contains details about the batch import process, including the status of the operation and the outcomes for individual orders.
Response Body Parameters
- batchImportId (string): Unique identifier for the batch import process.
Example:"53c27a26-8e57-4cfa-a1fa-a074da6b817e"
- status (string): Current status of the batch import process. Possible values include:
"Importing"
: The import process is ongoing."Completed"
: The import process has finished.
- results (array): An array containing the processing results for individual orders. Each object in the array includes:
- sourceReference (string): The reference ID of the order from the source system.
Example:"1234567890"
- orderId (integer): Unique identifier for the created order in the system.
Example:1
- orderStatus (string): The status of the order creation process.
Possible values include"Created"
,"Failed"
, etc. - itemsStatus (string): The status of the items within the order.
Example:"Created"
- pickupStopStatus (string): The status of the pickup stop creation.
Example:"Created"
- deliveryStopStatus (string): The status of the delivery stop creation.
Example:"Created"
- sourceReference (string): The reference ID of the order from the source system.
{
"batchImportId": "53c27a26-8e57-4cfa-a1fa-a074da6b817e",
"status": "Importing",
"results": [
{
"sourceReference": "1234567890",
"orderId": 1,
"orderStatus": "Created",
"itemsStatus": "Created",
"pickupStopStatus": "Created",
"deliveryStopStatus": "Created"
}
]
}