ms-inventario) owns the product catalog for SmartLogix. Each product has a unique SKU, a unit price, a current stock count, and a minimum threshold. When stockActual drops below umbralMinimo, the product appears in the /alertas feed. The stock-check endpoint (/{id}/stock) is also used internally by the orders service via a Resilience4j circuit breaker.
All endpoints require a valid JWT token in the Authorization header.
GET /api/inventario
Return the full list of products in the catalog.Status codes
| Code | Meaning |
|---|---|
200 | Success. Returns an array of ProductDTO objects. |
Response fields
Auto-generated product identifier.
Unique product code used across SmartLogix services.
Human-readable product name.
Unit price. Must be
≥ 0.0.Current units in stock. Must be
≥ 0.Minimum stock threshold. When
stockActual is below this value, the product appears in /alertas.Physical warehouse location identifier.
Optional product description.
Example
POST /api/inventario
Create a new product. Thesku must be unique. Returns 201 Created with the persisted ProductDTO.
Request body
Unique product code. Cannot be blank.
Product name. Cannot be blank.
Unit price. Must be
≥ 0.0.Initial stock quantity. Must be
≥ 0.Low-stock alert threshold. Must be
≥ 0.Warehouse location (optional).
Product description (optional).
Status codes
| Code | Meaning |
|---|---|
201 | Product created. Response body contains the new ProductDTO. |
400 | Validation failed (e.g. blank SKU, negative price). |
Example
GET /api/inventario/
Retrieve a single product by its numeric ID.Path parameters
The product’s auto-generated identifier.
Status codes
| Code | Meaning |
|---|---|
200 | Product found. Returns a ProductDTO. |
404 | No product with the given ID. |
Example
PUT /api/inventario/
Replace all fields of an existing product. The request body follows the same schema asPOST /api/inventario. Returns the updated ProductDTO.
Path parameters
The product’s auto-generated identifier.
Request body
Unique product code. Cannot be blank.
Product name. Cannot be blank.
Unit price. Must be
≥ 0.0.Updated stock quantity. Must be
≥ 0.Low-stock alert threshold. Must be
≥ 0.Warehouse location (optional).
Product description (optional).
Status codes
| Code | Meaning |
|---|---|
200 | Update successful. Returns the updated ProductDTO. |
400 | Validation failed. |
404 | No product with the given ID. |
Example
DELETE /api/inventario/
Permanently delete a product. Returns no response body on success.Path parameters
The product’s auto-generated identifier.
Status codes
| Code | Meaning |
|---|---|
204 | Deleted successfully. No response body. |
404 | No product with the given ID. |
Example
GET /api/inventario//stock
Check whether a product has sufficient stock for a given quantity. Returns a JSON boolean (true or false). This endpoint is called internally by ms-pedidos through a Resilience4j circuit breaker.
Path parameters
The product’s auto-generated identifier.
Query parameters
The number of units to check against
stockActual.Response
true if stockActual >= cantidad; false otherwise.Status codes
| Code | Meaning |
|---|---|
200 | Check complete. Response body is true or false. |
404 | No product with the given ID. |
Example
Example response (200)
GET /api/inventario/alertas
Return all products whosestockActual is strictly below their umbralMinimo. Use this feed to trigger restocking workflows.
Status codes
| Code | Meaning |
|---|---|
200 | Success. Returns an array of ProductDTO objects (may be empty). |