GET /api/v1/shipments
Retrieve shipments data.
This API endpoint makes an HTTP GET request to retrieve information about a specific shipment with the ID supplied. The response returns details about the shipment, including its ID, brand ID, status, shipment reference, contact information, trip date, custom fields, pickup stop details, drop stop details, contents, charge lines, and cost lines.
Input parameters:
id
id * required integer($int32)(path)
This is the unique shipment ID for the shipment in your Locate2U account. This is required in order to get the details of a particular shipment in the system.
includeCostAndChargeLines
includeCostAndChargeLines boolean (query)
Default value : false
This boolean flag allows developers to decide whether or not they want to retrieve cost and charge details attached to a shipment while fetching shipment details.
Cost and charge lines can be goods, services, or equipment associated with or required with the booking, work order, or delivery stops. They may be subject to billing and invoicing based on the company’s working policies.
Example requests:
Sample code
C# - HTTP Client :
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.locate2u.com/api/v1/shipments/174495");
request.Headers.Add("Authorization", "Bearer yourBearerTokenHere”
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://api.locate2u.com/api/v1/shipments/174495")
.method("GET", body)
.addHeader("Authorization", "Bearer yourBearerTokenHere")
.build();
Response response = client.newCall(request).execute();
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'GET',
'hostname': 'api.locate2u.com',
'path': '/api/v1/shipments/174495',
'headers': {
'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);
});
});
req.end();
'https://api.locate2u.com/api/v1/shipments/174495',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer yourBearerTokenHere'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
import requests
url = "https://api.locate2u.com/api/v1/shipments/174495"
payload = {}
headers = {
'Authorization': 'Bearer yourBearerTokenHere'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
Response
{
"shipmentId": 164557,
"brandId": null,
"status": "Pending",
"shipmentRef": "LSS00010101JMAXHE",
"contact": {
"name": "Matthew Robinson",
"phone": "0123456789",
"email": "matt.robinson@email.com"
},
"tripDate": "2024-01-29",
"skills": "skills1, skills2, skills3",
"customFields": {
"custom1": "value",
"custom2": "value",
"custom3": "value"
},
"lastModifiedDate": "2024-01-29T09:37:07.511Z",
"notes": "Please call before you deliver",
"source": null,
"sourceReference": null,
"load": {
"quantity": 0,
"volume": 0,
"weight": 0,
"length": 0,
"width": 0,
"height": 0
},
"customerId": 0,
"runNumber": 0,
"teamRegionId": 0,
"pickupStopId": 158969,
"pickupStop": {
"stopId": 164557,
"brandId": null,
"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
},
"tripDate": "2024-01-29",
"tripId": 0,
"appointmentTime": "09:37",
"timeWindowStart": null,
"timeWindowEnd": null,
"durationMinutes": 10,
"notes": "Please call before you deliver",
"lastModifiedDate": "2024-01-29T09:37:07.511Z",
"customFields": {
"custom1": "value",
"custom2": "value",
"custom3": "value"
},
"arrivalDate": "2024-01-29T09:37:07.511Z",
"customerId": 0,
"teamRegionId": 0,
"driverInstructions": null,
"lines": [
{
"lineId": 201,
"itemId": 101,
"barcode": "1234567890",
"description": "Item A - Barcode scanning item",
"status": "Created",
"itemStatus": "",
"serviceId": 0,
"productVariantId": 0,
"quantity": 1,
"unitPriceExTax": 0,
"priceCurrency": ""
}
]
},
"dropStopId": 158970,
"dropStop": {
"stopId": 164557,
"brandId": null,
"status": "Pending",
"contact": {
"name": "Matthew Robinson",
"phone": "0123456789",
"email": "matt.robinson@email.com"
},
"name": "Locate2u Drop Stop",
"address": "1 William St, Darlinghurst NSW 2010, Australia",
"location": {
"latitude": -33.8743446,
"longitude": 151.2131667
},
"tripDate": "2024-01-29",
"tripId": 0,
"appointmentTime": "09:37",
"timeWindowStart": null,
"timeWindowEnd": null,
"durationMinutes": 10,
"notes": "Please call before you deliver",
"lastModifiedDate": "2024-01-29T09:37:07.511Z",
"customFields": {
"custom1": "value",
"custom2": "value",
"custom3": "value"
},
"arrivalDate": "2024-01-29T09:37:07.511Z",
"customerId": 0,
"teamRegionId": 0,
"driverInstructions": null,
"lines": [
{
"lineId": 201,
"itemId": 101,
"barcode": "1234567890",
"description": "Item A - Barcode scanning item",
"status": "Created",
"itemStatus": "",
"serviceId": 0,
"productVariantId": 0,
"quantity": 1,
"unitPriceExTax": 0,
"priceCurrency": ""
}
]
},
"contents": null,
"chargeLines": null,
"costLines": null
}