A RESTful API service for managing stores and warehouses, including product inventory and stock management.
- Create and manage stores/warehouses
- Search for products across stores
- Add and consume stock for products, with full history tracking
The system ensures accurate tracking of inventory movements, allowing efficient management of product stock levels across multiple locations.
- CRUD operations for Stores, Products, and Categories
- Stock management with historical tracking of stock changes
- Search functionality for products across all stores
Creates a new store with the specified name and location.
-
Content-Type:
application/json -
Body:
{ "name": "string", "location": "string" }Field Type Description namestring The name of the store. locationstring The physical location of the store.
-
Status Code:
201 Created -
Content-Type:
application/json -
Body:
{ "id": "Long", "name": "string", "location": "string" }Field Type Description idLong Unique identifier for the store. namestring The name of the store. locationstring The physical location of the store.
-
Status Code:
400 Bad Request -
Content-Type:
application/json -
Body:
{ "code": 400, "status": "Bad Request", "timestamp": "2024-10-21 01:11:59 AM", "message": "Store already exists" } -
Description: Returned when the input store already exists.
{ "code": 400, "status": "Bad Request", "timestamp": "2024-10-21 01:14:02 AM", "errors": { "name": "Store name required." } } -
Description: Returned when the input data is missing or invalid.
{
"name": "Tech Supplies",
"location": "123 Main Street, Springfield"
}{
"id": 1,
"name": "Tech Supplies",
"location": "123 Main Street, Springfield"
}Add a new stock item to the store's inventory.
-
Content-Type:
application/json -
Body:
{ "storeId": "Long", "productId": "Long", "quantity": "Long" }Field Type Description storeIdLong The ID of the store. productIdLong The ID of the product. quantityLong The quantity of stock to add.
-
Status Code:
200 Success -
Content-Type:
application/jsonBody:{ "id": "Long", "storeId": "Long", "productId": "Long", "quantity": "Long" }Field Type Description idLong Unique identifier for the stock. storeIdLong The ID of the store. productIdLong The ID of the store. quantityLong The quantity of stock to add.
-
Status Code:
400 Bad Request -
Content-Type:
application/json -
Body:
{ "code": 404, "status": "Not Found", "timestamp": "2024-10-21 03:28:03 PM", "message": "Store not found" } -
Description: Returned when the input store doesn't exist.
{ "code": 400, "status": "Bad Request", "timestamp": "2024-10-21 03:28:45 PM", "errors": { "storeId": "Store id is required" } } -
Description: Returned when the input data is missing or invalid.
{
"storeId": 1,
"productId": 548,
"quantity": 25
}{
"id": 2,
"storeId": 1,
"productId": 548,
"quantity": 25
}