Skip to content

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:
1
2
3
4
5
6
7
8
[
  {
    "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:
{name: string}
Response:
1
2
3
4
5
6
{
  "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:
1
2
3
4
5
{
  "room_id": number,
  "name": string,
  "shelf_count": number
}
Response:
1
2
3
4
5
6
7
8
9
{
  "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:
1
2
3
4
5
6
7
{
  "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):
1
2
3
4
5
6
7
8
9
[
  {
    "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:
1
2
3
4
5
6
{
  "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):
1
2
3
4
5
6
7
8
9
[
  {
    "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:
1
2
3
4
{
  ext: string, // e.g., "jpg"
  image: string // base64 string
}
Response:
{"filename": string}
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:
1
2
3
{
  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:
1
2
3
4
{
  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:
1
2
3
4
5
6
7
8
9
[
  {
    "name": string,
    "photo": string,
    "count": number,
    "created_at": string,
    "updated_at": string
  }
]