Skip to content

Items API

Manage inventory items programmatically.

Get a paginated list of items with optional filtering.

GET /api/items
ParameterTypeDefaultDescription
searchstring-Search in name, description, manufacturer, barcode
categoryIdstring-Filter by category UUID
locationIdstring-Filter by location UUID
lowStockbooleanfalseOnly show low stock items
pagenumber1Page number
limitnumber20Items per page
sortBystringcreatedAtField to sort by
sortOrderstringdescSort direction (asc/desc)
Terminal window
curl "https://your-instance.com/api/items?search=mouse&categoryId=123&limit=10"
{
"items": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Logitech MX Master 3",
"description": "Wireless ergonomic mouse",
"manufacturer": "Logitech",
"barcode": "097855147479",
"buyPrice": 99.99,
"buyDate": "2024-01-15T00:00:00.000Z",
"quantity": 2,
"minQuantity": 1,
"categoryId": "category-uuid",
"locationId": "location-uuid",
"category": {
"id": "category-uuid",
"name": "Electronics",
"color": "#3b82f6"
},
"location": {
"id": "location-uuid",
"name": "Office",
"description": "Main office area"
},
"images": [],
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1,
"totalPages": 1
}
}

Add a new item to the inventory.

POST /api/items
{
"name": "Logitech MX Master 3",
"description": "Wireless ergonomic mouse with customizable buttons",
"manufacturer": "Logitech",
"barcode": "097855147479",
"buyPrice": 99.99,
"buyDate": "2024-01-15",
"quantity": 2,
"minQuantity": 1,
"categoryId": "category-uuid",
"locationId": "location-uuid"
}
FieldTypeDescription
namestringItem name
FieldTypeDefaultDescription
descriptionstringnullItem description
manufacturerstringnullBrand/manufacturer
barcodestringnullProduct barcode (unique)
buyPricenumber0Purchase price
buyDatestringtodayISO date string
quantitynumber1Current quantity
minQuantitynumber0Low stock threshold
categoryIdstringnullCategory UUID
locationIdstringnullLocation UUID
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Logitech MX Master 3",
...
}

Retrieve a single item by ID.

GET /api/items/[id]
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Logitech MX Master 3",
"description": "Wireless ergonomic mouse",
"manufacturer": "Logitech",
"barcode": "097855147479",
"buyPrice": 99.99,
"buyDate": "2024-01-15T00:00:00.000Z",
"quantity": 2,
"minQuantity": 1,
"category": { ... },
"location": { ... },
"images": [ ... ],
"createdAt": "2024-01-15T10:30:00.000Z",
"updatedAt": "2024-01-15T10:30:00.000Z"
}

Modify an existing item.

PUT /api/items/[id]

Include only the fields you want to update:

{
"quantity": 5,
"buyPrice": 89.99
}

Returns the updated item.


Remove an item from the inventory.

DELETE /api/items/[id]
{
"success": true
}

Warning: Permanent Deletion is permanent and cannot be undone. Associated images are also deleted.


GET /api/items/[id]/images
POST /api/items/[id]/images
Content-Type: multipart/form-data
file: (binary)
DELETE /api/items/[id]/images?imageId=[imageId]