This endpoint retrieves the current available stock count for a single product identified by itsDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Nelsoncg98/InnovaTech/llms.txt
Use this file to discover all available pages before exploring further.
productoId. The response is a plain integer — not a JSON object — representing how many units are currently available in the inventory table. If the requested productoId does not exist in the database, the endpoint returns 0 rather than an error, making it safe to call speculatively without prior existence checks.
Endpoint
Path Parameters
The unique product identifier stored in the
inventario table. This value corresponds to the productoId column, which has a UNIQUE constraint in PostgreSQL. Example: PROD-001.Response
A plain integer representing the number of units currently available for the given product. This is the value stored in the
stockDisponible column of the inventario table.Returns 0 if no inventory record is found for the given productoId — the endpoint does not return a 404 in this case.Example Request
Example Response
Source Implementation
The controller method handling this request, located inInventarioController.java:
InventarioService.java, which queries the PostgreSQL repository:
Inventario entity backing this query is defined as:
The controller’s internal
@RequestMapping is /api/inventario, making the full internal path /api/inventario/{productoId}/stock. The API Gateway intercepts requests at /api/v1/inventario/** and forwards them to servicio-inventario on port 8081, where the service receives the path as-is. Always use the gateway-prefixed form /api/v1/inventario/{productoId}/stock in client code.