Products

Retrieve and manage product data with secure, RESTful API endpoints.

Overview

The Products API provides secure endpoints to retrieve and manage product data. Start by calling the Products endpoint to find products of interest, then use Get Product for complete product details.

Key Features
  • JSON formatted responses
  • Schema-based validation
  • Role-based permissions
  • Flexible data attributes

API Endpoints

Get detailed information for a specific product by providing its unique psid in the path.

Parameters

X-API-Key (header, string, Required) - Your API key for authentication. Handles JWT validation automatically.

psid (path, integer, Required) - Product Spec ID to fetch. Must provide a valid product psid in the URL path.

Test this endpoint
Your authentication key for API access
Enter a valid product ID (psid)

Response Examples

JSON Response
{
  "success": true,
  "data": {
    "psid": 123,
    "productname": "Professional Grade Laptop",
    "category": "Electronics",
    "brand": "TechCorp",
    "model": "TC-LP-2024",
    "sku": "TC24LP001",
    "description": "High-performance laptop for business professionals",
    "price": 1299.99,
    "currency": "USD",
    "instock": true,
    "stocklevel": 45,
    "weight": 1.8,
    "dimensions": "35.5 x 24.1 x 1.9 cm",
    "created": "2024-12-01 10:00:00",
    "lastupdated": "2025-01-15 14:30:00",
    "active": 1
  }
}
JSON Response
{
  "success": false,
  "error": "Missing API key"
}
JSON Response
{
  "success": false,
  "error": "Product not found"
}

Code Examples

Shell Command
curl -X GET "https://localhost/developer/api/v1/products/getProduct/123" \
  -H "X-API-Key: YOUR_API_KEY"
JavaScript Code
fetch('https://localhost/developer/api/v1/products/getProduct/123', {
  method: 'GET',
  headers: {
    'X-API-Key': 'YOUR_API_KEY'
  }
})
.then(response => response.json())
.then(data => console.log(data));
Python Code
import requests

url = "https://localhost/developer/api/v1/products/getProduct/123"
headers = {
    "X-API-Key": "YOUR_API_KEY"
}

response = requests.get(url, headers=headers)
data = response.json()
print(data)
Java Code
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://localhost/developer/api/v1/products/getProduct/123"))
    .header("X-API-Key", "YOUR_API_KEY")
    .GET()
    .build();

HttpResponse<String> response = client.send(request, 
    HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
PHP Code
<?php
$url = 'https://localhost/developer/api/v1/products/getProduct/123';
$headers = [
    'X-API-Key: YOUR_API_KEY'
];

$curl = curl_init();
curl_setopt_array($curl, [
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => $headers,
]);

$response = curl_exec($curl);
$data = json_decode($response, true);
curl_close($curl);

print_r($data);
?>

Update product specification details. Only the fields provided in the request body will be updated.

Parameters

X-API-Key (header, string, Required) - Your API key for authentication. Handles JWT validation automatically.

Content-Type (header, string, Required) - Must be set to "application/json".

X-HTTP-Method-Override (header, string, Optional) - Automatically handled by the API. Client can send PUT requests which are internally converted to POST for IIS compatibility.

psid (path, integer, Required) - Product specification ID to update. Must provide a valid product specification ID in the URL path.

Body (JSON) (object, Optional) - Fields to update. Any combination of the following:

  • productdescription (string)
  • version (integer)
  • fopdescription (string)
  • bopdescription (string)
  • preparation_instuctions (string)
  • weight (string)
  • uom (integer)
  • countryid (integer)
  • launchdate (datetime)
  • submissiondate (datetime)
  • totallife (string)
  • shelflife (string)
  • minlife (string)
  • supportingdocumentation (string)
  • suppliercomments (string)
  • supplierdeclarationname (string)
  • supplierdeclarationtitle (string)
  • supplierdeclarationdate (datetime)
  • buyingsignoffcomments (string)
  • buyingsignoffname (string)
  • buyingsignofftitle (string)
  • buyingsignoffdate (datetime)
  • technicalsignoffcomments (string)
  • technicalsignoffname (string)
  • technicalsignofftitle (string)
  • technicalsignoffdate (datetime)
  • readytoeat (boolean)
  • comments (string)
  • statusid (integer)
  • productname (string)
  • productcode (string)
  • description (string)
  • producttype (integer)
  • category (integer)
  • buyer (string)
  • buyercomments (string)
  • submitted (integer)
  • vendorcode (string)
  • companyname (string)
  • address1 (string)
  • address2 (string)
  • address3 (string)
  • city (string)
  • postcode (string)
  • companycountryid (integer)
  • technicalcontactname (string)
  • technicalcontactemail (string)
  • technicalmobileno (string)
  • commercialcontactname (string)
  • commercialcontactemail (string)
  • commercialmobileno (string)
  • suppliertype (integer)
  • companycomments (string)
  • enabled (integer)
  • active (integer, optional)
Sample JSON:
{
  "productdescription": "Updated Product Name",
  "version": 2,
  "comments": "Testing the update endpoint",
  "productname": "Updated Test Product",
  "productcode": "TEST00110001",
  "description": "This is an updated description",
  "category": 1,
  "buyer": "4"
}
Test this endpoint
Your authentication key for API access
Enter a valid product specification ID
Provide any fields to update as JSON

Response Examples

JSON Response
{
  "success": true,
  "message": "Product updated successfully",
  "data": {
    "newlineid": 1,
    "companyid": 2,
    "siteid": 2,
    "statusid": 1,
    "userid": 0,
    "productdescription": "Updated Product Name",
    "version": 2,
    "fopdescription": null,
    "bopdescription": null,
    "preparation_instuctions": null,
    "weight": null,
    "uom": null,
    "countryid": null,
    "launchdate": {
      "date": "1970-01-01 00:00:00.000000",
      "timezone_type": 3,
      "timezone": "Europe/London"
    },
    "submissiondate": null,
    "totallife": null,
    "shelflife": null,
    "minlife": null,
    "supportingdocumentation": null,
    "suppliercomments": null,
    "supplierdeclarationname": null,
    "supplierdeclarationtitle": null,
    "supplierdeclarationdate": null,
    "buyingsignoffcomments": null,
    "buyingsignoffname": null,
    "buyingsignofftitle": null,
    "buyingsignoffdate": null,
    "technicalsignoffcomments": null,
    "technicalsignoffname": null,
    "technicalsignofftitle": null,
    "technicalsignoffdate": null,
    "readytoeat": null,
    "comments": "Testing the update endpoint",
    "lastupdated": {
      "date": "2025-10-17 13:33:04.433000",
      "timezone_type": 3,
      "timezone": "Europe/London"
    },
    "created": {
      "date": "2025-09-22 11:27:48.920000",
      "timezone_type": 3,
      "timezone": "Europe/London"
    },
    "isactive": 1,
    "productname": "Updated Test Product",
    "productcode": "TEST00110001",
    "description": "This is an updated description",
    "producttype": 1,
    "category": 1,
    "alcoholic": 0,
    "cannedfish": 0,
    "cbd": 0,
    "chocolate": 0,
    "coffee": 0,
    "curedmeats": 0,
    "freshfish": 0,
    "freshfruit": 0,
    "freshmeat": 0,
    "honey": 0,
    "jam": 0,
    "oliveoil": 0,
    "smokedfish": 0,
    "supplements": 0,
    "cheese": 1,
    "fish": 0,
    "mcs": 0,
    "buyer": "4",
    "buyercomments": "",
    "copysupplierdeclarationdate": null,
    "copytechnicalsignoffdate": null,
    "statuslevel": "New",
    "companyname": "Test Supplier"
  },
  "accordionHeader": 1
}
JSON Response
{
  "success": false,
  "error": "Missing API key"
}
JSON Response
{
  "success": false,
  "error": "No valid fields provided for update"
}

Code Examples

Shell Command
curl -X POST "https://developer.traceallglobal.com/api/v1/products/updateProduct/{psid}" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "productdescription": "Updated Product Name",
    "version": 2,
    "productname": "Premium Product",
    "category": 1
  }'
JavaScript Code
fetch('https://developer.traceallglobal.com/api/v1/products/updateProduct/{psid}', {
  method: 'POST',
  headers: {
    'X-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    productdescription: 'Updated Product Name',
    version: 2,
    productname: 'Premium Product',
    category: 1
  })
})
.then(response => response.json())
.then(data => console.log(data));
Python Code
import requests
import json

url = "https://developer.traceallglobal.com/api/v1/products/updateProduct/{psid}"
headers = {
    "X-API-Key": "YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {
    "productdescription": "Updated Product Name",
    "version": 2,
    "productname": "Premium Product",
    "category": 1
}

response = requests.post(url, headers=headers, json=data)
result = response.json()
print(result)
Java Code
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;

String jsonData = """
{
  "productdescription": "Updated Product Name",
  "version": 2,
  "productname": "Premium Product",
  "category": 1
}
""";

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://developer.traceallglobal.com/api/v1/products/updateProduct/{psid}"))
    .header("X-API-Key", "YOUR_API_KEY")
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(jsonData))
    .build();

HttpResponse<String> response = client.send(request, 
    HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
PHP Code
<?php
$url = 'https://developer.traceallglobal.com/api/v1/products/updateProduct/{psid}';
$headers = [
    'X-API-Key: YOUR_API_KEY',
    'Content-Type: application/json'
];
$data = [
    'productdescription' => 'Updated Product Name',
    'version' => 2,
    'productname' => 'Premium Product',
    'category' => 1
];

$curl = curl_init();
curl_setopt_array($curl, [
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_POSTFIELDS => json_encode($data),
]);

$response = curl_exec($curl);
$data = json_decode($response, true);
curl_close($curl);

print_r($data);
?>

Get detailed information for a specific newline by providing its unique newlineid in the path.

Parameters

X-API-Key (header, string, Required) - Your API key for authentication. Handles JWT validation automatically.

newlineid (path, integer, Required) - Newline ID to fetch. Must provide a valid newline newlineid in the URL path.

Test this endpoint
Your authentication key for API access
Enter a valid newline ID (newlineid)

Response Examples

JSON Response
{
  "success": true,
  "data": {
    "newlineid": 123,
    "companyname": "Food Company Ltd",
    "technicaluser": "John Smith",
    "companyid": 1,
    "buyer": 4,
    "mcs": null,
    "active": 1,
    "created": "2024-12-01 10:00:00",
    "lastupdated": "2025-01-15 14:30:00"
  }
}
JSON Response
{
  "success": false,
  "error": "Missing API key"
}
JSON Response
{
  "success": false,
  "error": "Newline not found"
}

Code Examples

Shell Command
curl -X GET "https://localhost/developer/api/v1/products/getNewline/123" \
  -H "X-API-Key: YOUR_API_KEY"
JavaScript Code
fetch('https://localhost/developer/api/v1/products/getNewline/123', {
  method: 'GET',
  headers: {
    'X-API-Key': 'YOUR_API_KEY'
  }
})
.then(response => response.json())
.then(data => console.log(data));
Python Code
import requests

url = "https://localhost/developer/api/v1/products/getNewline/123"
headers = {
    "X-API-Key": "YOUR_API_KEY"
}

response = requests.get(url, headers=headers)
data = response.json()
print(data)
PHP Code
<?php
$url = 'https://localhost/developer/api/v1/products/getNewline/123';
$headers = [
    'X-API-Key: YOUR_API_KEY'
];

$curl = curl_init();
curl_setopt_array($curl, [
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => $headers,
]);

$response = curl_exec($curl);
$data = json_decode($response, true);
curl_close($curl);

print_r($data);
?>

Update fields for a specific newline by ID. Only provided fields are updated.

Parameters

X-API-Key (header, string, Required) - Your API key for authentication. Handles JWT validation automatically.

Content-Type (header, string, Required) - Must be set to "application/json".

X-HTTP-Method-Override (header, string, Optional) - Automatically handled by the API. Client can send PUT requests which are internally converted to POST for IIS compatibility.

newlineid (path, integer, Required) - Newline ID to update. Must provide a valid newline ID in the URL path.

Body (JSON) (object, Optional) - Fields to update. Any combination of the following:

  • companyid (integer)
  • productname (string)
  • productcode (string)
  • description (string)
  • producttype (string)
  • category (integer)
  • alcoholic (boolean)
  • cannedfish (boolean)
  • cbd (boolean)
  • chocolate (boolean)
  • coffee (boolean)
  • curedmeats (boolean)
  • freshfish (boolean)
  • freshfruit (boolean)
  • freshmeat (boolean)
  • honey (boolean)
  • jam (boolean)
  • oliveoil (boolean)
  • smokedfish (boolean)
  • supplements (boolean)
  • cheese (boolean)
  • fish (boolean)
  • mcs (string)
  • buyer (integer)
  • buyercomments (string)
  • isactive (boolean)
  • companyname (string)
  • technicaluser (string)
Sample JSON:
{
  "productname": "Updated Product Name",
  "productcode": "PROD-123-UPDATED",
  "description": "Updated product description",
  "category": 2,
  "chocolate": 1,
  "buyer": 4,
  "buyercomments": "Approved for distribution",
  "isactive": 1
}
Test this endpoint
Enter a valid newline ID

Response Examples

JSON Response
{
  "success": true,
  "message": "Newline updated successfully",
  "data": {
    "newlineid": 123,
    "companyid": 1,
    "productname": "Updated Product Name",
    "productcode": "PROD-123",
    "description": "Updated product description",
    "producttype": "Food",
    "category": 2,
    "alcoholic": 0,
    "cannedfish": 0,
    "cbd": 0,
    "chocolate": 1,
    "coffee": 0,
    "curedmeats": 0,
    "freshfish": 0,
    "freshfruit": 0,
    "freshmeat": 0,
    "honey": 0,
    "jam": 0,
    "oliveoil": 0,
    "smokedfish": 0,
    "supplements": 0,
    "cheese": 0,
    "fish": 0,
    "mcs": null,
    "buyer": 4,
    "buyercomments": "Approved for distribution",
    "lastupdated": "2025-10-24 14:30:00",
    "created": "2024-12-01 10:00:00",
    "isactive": 1,
    "companyname": "Food Company Ltd",
    "technicaluser": "John Smith"
  }
}
JSON Response
{
  "success": false,
  "error": "Missing API key"
}
JSON Response
{
  "success": false,
  "error": "No valid fields provided for update"
}

Code Examples

Shell Command
curl -X POST "https://localhost/developer/api/v1/products/updateNewline/123" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "productname": "Updated Product Name",
    "productcode": "PROD-123-UPDATED",
    "description": "Updated product description",
    "category": 2,
    "chocolate": 1,
    "buyer": 4,
    "buyercomments": "Approved for distribution",
    "isactive": 1
  }'
JavaScript Code
fetch('https://localhost/developer/api/v1/products/updateNewline/123', {
  method: 'POST',
  headers: {
    'X-API-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    productname: 'Updated Product Name',
    productcode: 'PROD-123-UPDATED',
    description: 'Updated product description',
    category: 2,
    chocolate: 1,
    buyer: 4,
    buyercomments: 'Approved for distribution',
    isactive: 1
  })
})
.then(response => response.json())
.then(data => console.log(data));
Python Code
import requests
import json

url = "https://localhost/developer/api/v1/products/updateNewline/123"
headers = {
    "X-API-Key": "YOUR_API_KEY",
    "Content-Type": "application/json"
}
data = {
    "productname": "Updated Product Name",
    "productcode": "PROD-123-UPDATED",
    "description": "Updated product description",
    "category": 2,
    "chocolate": 1,
    "buyer": 4,
    "buyercomments": "Approved for distribution",
    "isactive": 1
}

response = requests.post(url, headers=headers, json=data)
result = response.json()
print(result)
Java Code
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;

String jsonData = """
{
  "productname": "Updated Product Name",
  "productcode": "PROD-123-UPDATED",
  "description": "Updated product description",
  "category": 2,
  "chocolate": 1,
  "buyer": 4,
  "buyercomments": "Approved for distribution",
  "isactive": 1
}
""";

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://localhost/developer/api/v1/products/updateNewline/123"))
    .header("X-API-Key", "YOUR_API_KEY")
    .header("Content-Type", "application/json")
    .POST(HttpRequest.BodyPublishers.ofString(jsonData))
    .build();

HttpResponse<String> response = client.send(request, 
    HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
PHP Code
<?php
$url = 'https://localhost/developer/api/v1/products/updateNewline/123';
$headers = [
    'X-API-Key: YOUR_API_KEY',
    'Content-Type: application/json'
];
$data = [
    'productname' => 'Updated Product Name',
    'productcode' => 'PROD-123-UPDATED',
    'description' => 'Updated product description',
    'category' => 2,
    'chocolate' => 1,
    'buyer' => 4,
    'buyercomments' => 'Approved for distribution',
    'isactive' => 1
];

$curl = curl_init();
curl_setopt_array($curl, [
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_POSTFIELDS => json_encode($data),
]);

$response = curl_exec($curl);
$data = json_decode($response, true);
curl_close($curl);

print_r($data);
?>