POST /api/v1/stops/{id}/lines

This endpoint allows you to add a stop line for a specific stop by making an HTTP POST request to the specified URL. Lines as we say here are collections of Items and Services attached to a stop.

Input Parameters:

id

id * required integer($int32)(path). This id here is the unique stop id for stop in your Locate2u account. This is required in order to add Lines to a particular stop in the system.

Example Request Body:

The request body should be in raw format and should include the following parameters:

{
  "barcode": "1234567890",
  "description": "Item A - Barcode scanning item",
  "currentLocation": "Warehouse",
  "serviceId": 0,
  "productVariantId": 0,
  "quantity": 1
}
  • description (string, optional): A description for the stop line.
  • currentLocation (string, optional): The current location of the stop line.
  • itemId (integer): The ID of the item.
  • productVariantId (integer): The ID of the product variant.
  • quantity (integer): The quantity of the item.

Example requests:

Sample code

C#
Java
NodeJS
PHP
Python
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.locate2u.com/api/v1/stops/5176243/lines");
request.Headers.Add("Authorization", "Bearer yourBearerTokenHere");
var content = new StringContent(" {\r\n  \"description\": \"Item A - Barcode scanning item\",\r\n  \"currentLocation\": \"Warehouse\",\r\n  \"itemId\": 0,\r\n  \"productVariantId\": 0,\r\n  \"quantity\": 1\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  \"description\": \"Item A - Barcode scanning item\",\r\n  \"currentLocation\": \"Warehouse\",\r\n  \"itemId\": 0,\r\n  \"productVariantId\": 0,\r\n  \"quantity\": 1\r\n}");
Request request = new Request.Builder()
  .url("https://api.locate2u.com/api/v1/stops/5176243/lines")
  .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/5176243/lines',
  '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({
  "description": "Item A - Barcode scanning item",
  "currentLocation": "Warehouse",
  "itemId": 0,
  "productVariantId": 0,
  "quantity": 1
});


req.write(postData);


req.end();
 'https://api.locate2u.com/api/v1/stops/5176243/lines',
  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 =>' {
  "description": "Item A - Barcode scanning item",
  "currentLocation": "Warehouse",
  "itemId": 0,
  "productVariantId": 0,
  "quantity": 1
}',
  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/5176243/lines"


payload = json.dumps({
  "description": "Item A - Barcode scanning item",
  "currentLocation": "Warehouse",
  "itemId": 0,
  "productVariantId": 0,
  "quantity": 1
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer yourBearerTokenHere'
}
response = requests.request("POST", url, headers=headers, data=payload)


print(response.text)

Response

Upon a successful request, the server responds with a status code of 201 and a JSON object containing the following fields:
  • lineId (integer): The ID of the line.
  • itemId (integer): The ID of the item.
  • serviceId (integer): The ID of the service.
  • productVariantId (integer): The ID of the product variant.
  • barcode (string): The barcode associated with the line.
  • description (string): The description of the line.
  • quantity (integer): The quantity of the line.
  • status (string): The status of the line.
  • itemStatus (string): The status of the item.
  • unitPriceExTax (string): The unit price excluding tax.
  • priceCurrency (string): The currency of the price.
200 Success
Media type
application/json

Example Value

Schema
{
  "assignedTo": {
    "id": "ee59-b174-4698-ac55-81d9d",
    "name": "John Doe"
  },
  "stopId": 164557,
  "status": "Pending",
  "brandId": null,
  "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
  },
  "tripDate": "2024-01-29",
  "appointmentTime": "09:37",
  "timeWindowStart": null,
  "timeWindowEnd": null,
  "durationMinutes": 10,
  "notes": "Please call before you deliver",
  "lastModifiedDate": "2024-01-29T09:37:07.524Z",
  "customFields": {
    "custom1": "value",
    "custom2": "value",
    "custom3": "value"
  },
  "type": null,
  "shipmentId": 0,
  "load": {
    "quantity": 0,
    "volume": 0,
    "weight": 0,
    "length": 0,
    "width": 0,
    "height": 0
  },
  "source": null,
  "sourceReference": null,
  "customerId": 0,
  "runNumber": 0,
  "teamRegionId": 0,
  "teamMemberInvoiceId": 0,
  "customerInvoiceId": 0,
  "contents": null,
  "arrivalDate": "2024-01-29T09:37:07+00:00",
  "lines": [
    {
      "lineId": 201,
      "itemId": 101,
      "serviceId": null,
      "productVariantId": null,
      "barcode": "1234567890",
      "description": "Item A - Barcode scanning item",
      "quantity": 1,
      "status": "Created",
      "itemStatus": "",
      "unitPriceExTax": 0,
      "priceCurrency": ""
    }
  ],
  "driverInstructions": null,
  "oneTimePin": "0011"
}

401 Unauthorized

403 Forbidden