REST API
There is a description of inventory REST API.
For the Admin Panel API will described on the next version.
Location (room)
Get All Locations
Request:
| [GET] http://IP_ADDR:PORT/api/rooms
|
Response:
| [
{
"id": number,
"name": string,
"created_at": string, // "2026-06-14 11:35:25"
"updated_at": string
}
]
|
Add a new Location
Request:
| [POST] http://IP_ADDR:PORT/api/rooms
|
Payload:
Response:
| {
"id": number,
"name": string,
"created_at": string,
"updated_at": string
}
|
Racks
Get Racks in the Room
Request:
| [GET] http://IP_ADDR:PORT/api/rooms/{room_id}/shelves
|
Response:
| [
{
"id": number,
"room_id": number,
"name": string,
"shelf_count": number,
"created_at": string,
"updated_at": string,
"level_count": number
}
]
|
Add a new Rack
Request:
| [POST] http://IP_ADDR:PORT/api/shelves
|
Payload:
| {
"room_id": number,
"name": string,
"shelf_count": number
}
|
Response:
| {
"id": number,
"room_id": number,
"name": string,
"shelf_count": number,
"created_at": string,
"updated_at": string,
"level_count": number
}
|
Shelfs
Get Shelfs of the Rack
Request:
| [GET] http://IP_ADDR:PORT/api/shelves/{shelf_id}/levels
|
Response:
| [
{
"id": number,
"shelf_id": number,
"level_number": number,
"name": string,
"boxes_per_row": number.
"row_count": number,
"created_at": string,
"updated_at": string
}
]
|
Add a new Shelf to the Rack
Request:
| [POST] http://IP_ADDR:PORT/api/levels
|
Payload:
| {
"shelf_id": number,
"level_number": number,
"name": string,
"boxes_per_row": number,
"row_count": number
}
|
Response:
| {
"id": number,
"shelf_id": number,
"level_number": number,
"name": string,
"boxes_per_row": number.
"row_count": number,
"created_at": string,
"updated_at": string
}
|
Boxes
Get Boxes on the Shelf
Request:
| [GET] http://IP_ADDR:PORT/api/levels/{level_id}/boxes
|
Response:
| [
{
"id": number,
"shelf_level_id": number,
"name": string,
"content": string, // JSON-string
"photo": string,
"position_row": number,
"position_col": number,
"created_at": string,
"updated_at": string
}
]
|
Content (stringified JSON):
| [
{
"name": string,
"photo": string,
"count": number,
"created_at": string,
"updated_at": string
}
]
|
Add a new Box
Request:
| [POST] http://IP_ADDR:PORT/api/boxes
|
Payload:
| {
"shelf_level_id": number,
"name": string,
"content": string, // JSON as string
"photo": string
}
|
Response:
| {
"id": number, // Box ID
"shelf_level_id": number,
"name": string,
"content": string, // JSON-string
"photo": string,
"position_row": number,
"position_col": number,
"created_at": string,
"updated_at": string
}
|
Content (stringified JSON):
| [
{
"name": string,
"photo": string,
"count": number,
"created_at": string,
"updated_at": string
}
]
|
Change the box photo
Request to upload the image file:
| [POST] http://IP_ADDR:PORT/api/upload
|
Payload:
| {
ext: string, // e.g., "jpg"
image: string // base64 string
}
|
Response:
Save the filename received after uploading the image file.
Then, update the box details by passing this filename in the following request.
Request:
| [PUT] http://IP_ADDR:PORT/api/boxes/{box_id}
|
Payload:
| {
photo: string // filename from the upload response
}
|
Remove the box
Request:
| [DELETE] http://IP_ADDR:PORT/api/boxes/{box_id}
|
Items
Get items in the box
Request:
| [GET] http://IP_ADDR:PORT/api/boxes/{box_id}
|
Response:
| {
"id": number,
"shelf_level_id": number,
"name": string,
"content": string, // JSON-string
"photo": string,
"position_row": number,
"position_col": number,
"created_at": string,
"updated_at": string
}
|
Add a new Item
Request:
| [PUT] http://IP_ADDR:PORT/api/boxes/{box_id}
|
Payload:
| {
content: string, // JSON as string (array of items)
photo: string // response.filename if uploaded new or box.photo
}
|
The stringified array of items must be have the next structure:
| [
{
"name": string,
"photo": string,
"count": number,
"created_at": string,
"updated_at": string
}
]
|