Suppliers
Manage supplier records via the Suppliers API.
Base path: /v1/suppliers
Supplier Fields
| Field | Type | Description |
|---|---|---|
id | string (UUID) | Unique supplier identifier |
name | string | Supplier company name |
address | string | Street address |
email | string | Primary contact email |
contactName | string | Name of primary contact |
phone | string | Phone number |
status | string | active, inactive, or pending |
categories | string[] | Product categories this supplier provides |
createdAt | string (ISO 8601) | Creation timestamp |
updatedAt | string (ISO 8601) | Last update timestamp |
List Suppliers
GET /v1/suppliers
Returns a paginated list of all suppliers.
Query parameters: See Pagination
Request:
curl https://api.acme.trackvision.ai/v1/suppliers \
-H "Authorization: Bearer $TV_API_KEY"
Response:
{
"suppliers": [
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"name": "GreenFibre Co.",
"email": "contact@greenfibre.com",
"contactName": "Sarah Chen",
"status": "active",
"categories": ["apparel", "textiles"],
"createdAt": "2024-01-10T08:00:00Z",
"updatedAt": "2024-01-10T08:00:00Z"
}
],
"pagination": {
"page": 1,
"perPage": 50,
"total": 1,
"totalPages": 1
}
}
Get Supplier
GET /v1/suppliers/{id}
Returns a single supplier by ID.
Request:
curl https://api.acme.trackvision.ai/v1/suppliers/b2c3d4e5-f6a7-8901-bcde-f12345678901 \
-H "Authorization: Bearer $TV_API_KEY"
Response:
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"name": "GreenFibre Co.",
"address": "123 Mill Road, Manchester, M1 2AB, UK",
"email": "contact@greenfibre.com",
"contactName": "Sarah Chen",
"phone": "+44 161 000 0000",
"status": "active",
"categories": ["apparel", "textiles"],
"createdAt": "2024-01-10T08:00:00Z",
"updatedAt": "2024-01-10T08:00:00Z"
}
Create Supplier
POST /v1/suppliers
Creates a new supplier record.
Request body:
{
"name": "EcoWeave Factory",
"address": "456 Industrial Park, Dhaka, Bangladesh",
"email": "info@ecoweave.com",
"contactName": "Mohammed Rahman",
"phone": "+880 2 000 0000",
"status": "active",
"categories": ["apparel", "knitwear"]
}
Request:
curl -X POST https://api.acme.trackvision.ai/v1/suppliers \
-H "Authorization: Bearer $TV_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "EcoWeave Factory",
"email": "info@ecoweave.com",
"status": "active",
"categories": ["apparel"]
}'
Response: 201 Created with the created supplier object.
Update Supplier
PUT /v1/suppliers/{id}
Updates an existing supplier. Send only the fields you want to change.
Request:
curl -X PUT https://api.acme.trackvision.ai/v1/suppliers/b2c3d4e5-f6a7-8901-bcde-f12345678901 \
-H "Authorization: Bearer $TV_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"status": "inactive"
}'
Response: 200 OK with the updated supplier object.
Delete Supplier
DELETE /v1/suppliers/{id}
Permanently deletes a supplier record.
Request:
curl -X DELETE https://api.acme.trackvision.ai/v1/suppliers/b2c3d4e5-f6a7-8901-bcde-f12345678901 \
-H "Authorization: Bearer $TV_API_KEY"
Response: 204 No Content