Suppliers
Create and manage supplier accounts via secure, RESTful API endpoints.
Overview
The Suppliers API provides secure endpoints to create and manage supplier accounts. Use Create Supplier to register a new supplier company, generate a vendor code, and automatically provision a default site, SAQ entry, and supplier user account.
https://developer.traceallglobal.com/api/v1
Permission Required
Creating a supplier requires API permission level 2 (Editor) or higher. A welcome email is sent automatically to the new supplier user.
Key Features
- Auto-generated vendor codes
- Default site & SAQ provisioned
- Supplier user account created
- Welcome email dispatched
Bulk Upload CSV Template
Download the ready-to-use CSV template to prepare your supplier data. Fill in the required columns and upload via POST /suppliers/createSupplierBulk.
API Endpoints
Create a new supplier company. A vendor code is generated automatically from the company name. The endpoint also provisions a default site, an SAQ record, and a supplier user account. A welcome email with credentials is sent to the supplier contact if email is configured. Requires API permission level 2 (Editor) or higher.
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.
Body (JSON) (object, Required) - All fields marked Required must be present:
companyname(string, Required)address1(string, Required)address2(string, Optional)address3(string, Optional)city(string, Required)postcode(string, Required)country(integer, Required) — country IDtechcontactname(string, Required) — technical contact full nametechcontactemail(string, Required) — valid email addresstechmobileno(string, Required)tracealluserfirstname(string, Required) — supplier portal user first nametraceallusersurname(string, Required) — supplier portal user last nametracealluseremail(string, Required) — supplier portal user email (must be unique)traceallusermobileno(string, Required)comcontactname(string, Required) — commercial contact full namecomcontactemail(string, Required) — valid email addresscommobileno(string, Required)supplier_type(integer, Required) — supplier type IDrisk(integer, Required) — risk level IDcomments(string, Optional)
{
"companyname": "Acme Foods Ltd",
"address1": "10 Industrial Way",
"address2": "",
"address3": "",
"city": "Manchester",
"postcode": "M1 1AB",
"country": 1,
"techcontactname": "John Smith",
"techcontactemail": "john.smith@acmefoods.co.uk",
"techmobileno": "+44 7700 900001",
"tracealluserfirstname": "John",
"traceallusersurname": "Smith",
"tracealluseremail": "john.smith@acmefoods.co.uk",
"traceallusermobileno": "+44 7700 900001",
"comcontactname": "Sarah Jones",
"comcontactemail": "sarah.jones@acmefoods.co.uk",
"commobileno": "+44 7700 900002",
"supplier_type": 1,
"risk": 1,
"comments": "New supplier onboarded via API"
}
Test this endpoint
Response Examples
{
"success": true,
"message": "Supplier created successfully",
"supplierid": 456,
"siteid": 789,
"vendorcode": "ACME001"
}
{
"success": false,
"error": "Missing API key"
}
{
"success": false,
"error": "Missing required field: companyname"
}
{
"success": false,
"error": "Supplier not added, email already exists"
}
{
"success": false,
"error": "Database error during supplier creation"
}
Code Examples
curl -X POST "https://developer.traceallglobal.com/api/v1/suppliers/createSupplier" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"companyname": "Acme Foods Ltd",
"address1": "10 Industrial Way",
"address2": "",
"address3": "",
"city": "Manchester",
"postcode": "M1 1AB",
"country": 1,
"techcontactname": "John Smith",
"techcontactemail": "john.smith@acmefoods.co.uk",
"techmobileno": "+44 7700 900001",
"tracealluserfirstname": "John",
"traceallusersurname": "Smith",
"tracealluseremail": "john.smith@acmefoods.co.uk",
"traceallusermobileno": "+44 7700 900001",
"comcontactname": "Sarah Jones",
"comcontactemail": "sarah.jones@acmefoods.co.uk",
"commobileno": "+44 7700 900002",
"supplier_type": 1,
"risk": 1,
"comments": "New supplier onboarded via API"
}'
fetch('https://developer.traceallglobal.com/api/v1/suppliers/createSupplier', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
companyname: 'Acme Foods Ltd',
address1: '10 Industrial Way',
address2: '',
address3: '',
city: 'Manchester',
postcode: 'M1 1AB',
country: 1,
techcontactname: 'John Smith',
techcontactemail: 'john.smith@acmefoods.co.uk',
techmobileno: '+44 7700 900001',
tracealluserfirstname: 'John',
traceallusersurname: 'Smith',
tracealluseremail: 'john.smith@acmefoods.co.uk',
traceallusermobileno: '+44 7700 900001',
comcontactname: 'Sarah Jones',
comcontactemail: 'sarah.jones@acmefoods.co.uk',
commobileno: '+44 7700 900002',
supplier_type: 1,
risk: 1,
comments: 'New supplier onboarded via API'
})
})
.then(response => response.json())
.then(data => console.log(data));
import requests
url = "https://developer.traceallglobal.com/api/v1/suppliers/createSupplier"
headers = {
"X-API-Key": "YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"companyname": "Acme Foods Ltd",
"address1": "10 Industrial Way",
"address2": "",
"address3": "",
"city": "Manchester",
"postcode": "M1 1AB",
"country": 1,
"techcontactname": "John Smith",
"techcontactemail": "john.smith@acmefoods.co.uk",
"techmobileno": "+44 7700 900001",
"tracealluserfirstname": "John",
"traceallusersurname": "Smith",
"tracealluseremail": "john.smith@acmefoods.co.uk",
"traceallusermobileno": "+44 7700 900001",
"comcontactname": "Sarah Jones",
"comcontactemail": "sarah.jones@acmefoods.co.uk",
"commobileno": "+44 7700 900002",
"supplier_type": 1,
"risk": 1,
"comments": "New supplier onboarded via API"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
String jsonData = """
{
"companyname": "Acme Foods Ltd",
"address1": "10 Industrial Way",
"address2": "",
"address3": "",
"city": "Manchester",
"postcode": "M1 1AB",
"country": 1,
"techcontactname": "John Smith",
"techcontactemail": "john.smith@acmefoods.co.uk",
"techmobileno": "+44 7700 900001",
"tracealluserfirstname": "John",
"traceallusersurname": "Smith",
"tracealluseremail": "john.smith@acmefoods.co.uk",
"traceallusermobileno": "+44 7700 900001",
"comcontactname": "Sarah Jones",
"comcontactemail": "sarah.jones@acmefoods.co.uk",
"commobileno": "+44 7700 900002",
"supplier_type": 1,
"risk": 1,
"comments": "New supplier onboarded via API"
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://developer.traceallglobal.com/api/v1/suppliers/createSupplier"))
.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
$url = 'https://developer.traceallglobal.com/api/v1/suppliers/createSupplier';
$headers = [
'X-API-Key: YOUR_API_KEY',
'Content-Type: application/json'
];
$data = [
'companyname' => 'Acme Foods Ltd',
'address1' => '10 Industrial Way',
'address2' => '',
'address3' => '',
'city' => 'Manchester',
'postcode' => 'M1 1AB',
'country' => 1,
'techcontactname' => 'John Smith',
'techcontactemail' => 'john.smith@acmefoods.co.uk',
'techmobileno' => '+44 7700 900001',
'tracealluserfirstname' => 'John',
'traceallusersurname' => 'Smith',
'tracealluseremail' => 'john.smith@acmefoods.co.uk',
'traceallusermobileno' => '+44 7700 900001',
'comcontactname' => 'Sarah Jones',
'comcontactemail' => 'sarah.jones@acmefoods.co.uk',
'commobileno' => '+44 7700 900002',
'supplier_type' => 1,
'risk' => 1,
'comments' => 'New supplier onboarded via API',
];
$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);
$result = json_decode($response, true);
curl_close($curl);
print_r($result);
?>
Create multiple supplier accounts in a single request. Accepts either a JSON array
of supplier objects (application/json) or a CSV file upload
(multipart/form-data, field name file).
Each row is processed independently — failures are collected and returned with a
retry_payload so failed rows can be resubmitted without reprocessing successes.
Requires API permission level 2 (Editor) or higher.
Parameters
X-API-Key (header, string, Required) - Your API key for authentication. Handles JWT validation automatically.
Content-Type (header, string, Required) - Either application/json for a JSON array body, or multipart/form-data for a CSV file upload.
Body (Required) - One of:
- JSON array: An array of supplier objects. Each object uses the same fields as
createSupplier. A single object is also accepted. - CSV file: A
.csvfile in form fieldfile. Headers must match the template fromgetSupplierCsvTemplate(case-insensitive).
[
{
"companyname": "Acme Foods Ltd",
"address1": "10 Industrial Way",
"address2": "",
"address3": "",
"city": "Manchester",
"postcode": "M1 1AB",
"country": 1,
"techcontactname": "John Smith",
"techcontactemail": "john.smith@acmefoods.co.uk",
"techmobileno": "+44 7700 900001",
"tracealluserfirstname": "John",
"traceallusersurname": "Smith",
"tracealluseremail": "john.smith@acmefoods.co.uk",
"traceallusermobileno": "+44 7700 900001",
"comcontactname": "Sarah Jones",
"comcontactemail": "sarah.jones@acmefoods.co.uk",
"commobileno": "+44 7700 900002",
"supplier_type": 1,
"risk": 1,
"comments": ""
},
{
"companyname": "Beta Ingredients Ltd",
"address1": "22 Logistics Road",
"address2": "",
"address3": "",
"city": "Birmingham",
"postcode": "B1 1BB",
"country": 1,
"techcontactname": "Alice Brown",
"techcontactemail": "alice.brown@betaingredients.co.uk",
"techmobileno": "+44 7700 900010",
"tracealluserfirstname": "Alice",
"traceallusersurname": "Brown",
"tracealluseremail": "alice.brown@betaingredients.co.uk",
"traceallusermobileno": "+44 7700 900010",
"comcontactname": "Mark Taylor",
"comcontactemail": "mark.taylor@betaingredients.co.uk",
"commobileno": "+44 7700 900011",
"supplier_type": 1,
"risk": 2,
"comments": ""
}
]
Test this endpoint (JSON array)
Response Examples
{
"success": true,
"total": 2,
"created": 1,
"failed": 1,
"results": [
{
"row": 1,
"companyname": "Acme Foods Ltd",
"status": "success",
"supplierid": 456,
"siteid": 789,
"vendorcode": "ACME001"
},
{
"row": 2,
"companyname": "Beta Ingredients Ltd",
"status": "error",
"message": "Email already exists: alice.brown@betaingredients.co.uk"
}
],
"retry_payload": [
{
"companyname": "Beta Ingredients Ltd",
"tracealluseremail": "alice.brown@betaingredients.co.uk"
}
]
}
{
"success": false,
"error": "Missing API key"
}
{
"success": false,
"error": "Request body must be a non-empty JSON array of supplier objects"
}
{
"success": false,
"error": "Unsupported content type. Use application/json or multipart/form-data with a CSV file."
}
Code Examples
# JSON array
curl -X POST "https://developer.traceallglobal.com/api/v1/suppliers/createSupplierBulk" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '[{"companyname":"Acme Foods Ltd","address1":"10 Industrial Way","city":"Manchester","postcode":"M1 1AB","country":1,"techcontactname":"John Smith","techcontactemail":"john@acme.co.uk","techmobileno":"+44 7700 900001","tracealluserfirstname":"John","traceallusersurname":"Smith","tracealluseremail":"john@acme.co.uk","traceallusermobileno":"+44 7700 900001","comcontactname":"Sarah Jones","comcontactemail":"sarah@acme.co.uk","commobileno":"+44 7700 900002","supplier_type":1,"risk":1}]'
# CSV file upload
curl -X POST "https://developer.traceallglobal.com/api/v1/suppliers/createSupplierBulk" \
-H "X-API-Key: YOUR_API_KEY" \
-F "file=@supplier_upload_template.csv"
const suppliers = [
{
companyname: 'Acme Foods Ltd',
address1: '10 Industrial Way',
city: 'Manchester',
postcode: 'M1 1AB',
country: 1,
techcontactname: 'John Smith',
techcontactemail: 'john@acme.co.uk',
techmobileno: '+44 7700 900001',
tracealluserfirstname: 'John',
traceallusersurname: 'Smith',
tracealluseremail: 'john@acme.co.uk',
traceallusermobileno: '+44 7700 900001',
comcontactname: 'Sarah Jones',
comcontactemail: 'sarah@acme.co.uk',
commobileno: '+44 7700 900002',
supplier_type: 1,
risk: 1
}
];
fetch('https://developer.traceallglobal.com/api/v1/suppliers/createSupplierBulk', {
method: 'POST',
headers: { 'X-API-Key': 'YOUR_API_KEY', 'Content-Type': 'application/json' },
body: JSON.stringify(suppliers)
})
.then(response => response.json())
.then(data => {
console.log(`Created: ${data.created}, Failed: ${data.failed}`);
if (data.retry_payload.length > 0) {
console.log('Retry these rows:', data.retry_payload);
}
});
import requests
url = "https://developer.traceallglobal.com/api/v1/suppliers/createSupplierBulk"
headers = {"X-API-Key": "YOUR_API_KEY"}
# JSON array
suppliers = [
{
"companyname": "Acme Foods Ltd",
"address1": "10 Industrial Way",
"city": "Manchester",
"postcode": "M1 1AB",
"country": 1,
"techcontactname": "John Smith",
"techcontactemail": "john@acme.co.uk",
"techmobileno": "+44 7700 900001",
"tracealluserfirstname": "John",
"traceallusersurname": "Smith",
"tracealluseremail": "john@acme.co.uk",
"traceallusermobileno": "+44 7700 900001",
"comcontactname": "Sarah Jones",
"comcontactemail": "sarah@acme.co.uk",
"commobileno": "+44 7700 900002",
"supplier_type": 1,
"risk": 1
}
]
response = requests.post(url, headers=headers, json=suppliers)
data = response.json()
print(f"Created: {data['created']}, Failed: {data['failed']}")
if data.get('retry_payload'):
print("Retry these rows:", data['retry_payload'])
# CSV file upload
# with open('suppliers.csv', 'rb') as f:
# r = requests.post(url, headers={'X-API-Key': 'YOUR_API_KEY'}, files={'file': f})
<?php
$url = 'https://developer.traceallglobal.com/api/v1/suppliers/createSupplierBulk';
$data = [
[
'companyname' => 'Acme Foods Ltd',
'address1' => '10 Industrial Way',
'city' => 'Manchester',
'postcode' => 'M1 1AB',
'country' => 1,
'techcontactname' => 'John Smith',
'techcontactemail' => 'john@acme.co.uk',
'techmobileno' => '+44 7700 900001',
'tracealluserfirstname' => 'John',
'traceallusersurname' => 'Smith',
'tracealluseremail' => 'john@acme.co.uk',
'traceallusermobileno' => '+44 7700 900001',
'comcontactname' => 'Sarah Jones',
'comcontactemail' => 'sarah@acme.co.uk',
'commobileno' => '+44 7700 900002',
'supplier_type' => 1,
'risk' => 1,
],
];
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode($data),
]);
$response = curl_exec($curl);
$result = json_decode($response, true);
curl_close($curl);
echo "Created: {$result['created']}, Failed: {$result['failed']}\n";
if (!empty($result['retry_payload'])) {
echo "Retry: " . json_encode($result['retry_payload'], JSON_PRETTY_PRINT) . "\n";
}
?>
Update one or more fields on an existing supplier company. Only the fields you include in the JSON body are changed — omitted fields are left untouched (PATCH-style). Requires API permission level 2 (Editor) or higher.
Parameters
X-API-Key (header, string, Required)
supplierid (URL path, integer, Required) — e.g. PUT /suppliers/456
Body (JSON) (object, Optional) — include only the fields you want to change:
companyname(string)address1,address2,address3(string)city,postcode(string)country(integer — country ID)techcontactname,techcontactemail,techmobileno(string)comcontactname,comcontactemail,commobileno(string)supplier_type(integer)risk(integer)comments(string)
{
"companyname": "Updated Acme Foods Ltd",
"city": "London",
"postcode": "E1 6AN",
"techcontactname": "Jane Doe",
"techcontactemail": "jane.doe@acme.co.uk",
"comments": "Updated via API"
}
Test this endpoint
Response Examples
{
"success": true,
"message": "Supplier updated successfully",
"supplierid": 456,
"vendorcode": "ACME001",
"companyname": "Updated Name Ltd"
}
{
"success": false,
"error": "No valid fields provided to update"
}
{
"success": false,
"error": "Supplier not found or already inactive"
}
Code Examples
curl -X PUT "https://developer.traceallglobal.com/api/v1/suppliers/456" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"companyname": "Updated Acme Foods Ltd", "city": "London"}'
fetch('https://developer.traceallglobal.com/api/v1/suppliers/456', {
method: 'PUT',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
companyname: 'Updated Acme Foods Ltd',
city: 'London'
})
})
.then(r => r.json())
.then(data => console.log(data));
import requests
response = requests.put(
'https://developer.traceallglobal.com/api/v1/suppliers/456',
headers={'X-API-Key': 'YOUR_API_KEY'},
json={'companyname': 'Updated Acme Foods Ltd', 'city': 'London'}
)
print(response.json())
<?php
$supplierid = 456;
$url = "https://developer.traceallglobal.com/api/v1/suppliers/$supplierid";
$data = ['companyname' => 'Updated Acme Foods Ltd', 'city' => 'London'];
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode($data),
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl);
print_r($result);
?>
Deactivates a supplier by setting active = 0 on the company record.
Related sites and supplier users are also deactivated in the same transaction.
Data is never permanently deleted — it can be reactivated manually.
Requires API permission level 3 (Manager) or higher.
Cascading deactivation
Deleting a supplier also deactivates all of its sites and supplier user accounts.
Parameters
X-API-Key (header, string, Required)
supplierid (URL path, integer, Required) — e.g. DELETE /suppliers/456
Test this endpoint
Response Examples
{
"success": true,
"message": "Supplier deactivated successfully",
"supplierid": 456
}
{
"success": false,
"error": "Missing API key"
}
{
"success": false,
"error": "Supplier not found or already inactive"
}
Code Examples
curl -X DELETE "https://developer.traceallglobal.com/api/v1/suppliers/456" \
-H "X-API-Key: YOUR_API_KEY"
fetch('https://developer.traceallglobal.com/api/v1/suppliers/456', {
method: 'DELETE',
headers: { 'X-API-Key': 'YOUR_API_KEY' }
})
.then(r => r.json())
.then(data => console.log(data));
import requests
response = requests.delete(
'https://developer.traceallglobal.com/api/v1/suppliers/456',
headers={'X-API-Key': 'YOUR_API_KEY'}
)
print(response.json())
<?php
$supplierid = 456;
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://developer.traceallglobal.com/api/v1/suppliers/$supplierid",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY'],
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl);
print_r($result);
?>