The Inventory endpoints give you programmatic access to your full product catalog and warehouse stock data in SmartPyme. You can filter by category, brand, or stock status to build integrations such as low-stock alerts, e-commerce catalog syncs, or cost-of-goods reports. All requests must include your API key in the Authorization header.
GET /inventory
Returns a paginated list of products from your catalog. Each product record includes pricing, cost, and an inventarios array showing current stock levels broken down by warehouse and branch.
curl --request GET \
--url "https://api.smartpyme.site/api/external/v1/inventory?marca=Dell&con_stock=true&per_page=50" \
--header "Authorization: Bearer {api_key}"
Query parameters
Filter by product SKU or internal code. Performs a partial match.
Filter by product name. Performs a partial, case-insensitive match.
Filter by category name. Performs a partial match against nombre_categoria.
Filter by brand name. Performs a partial match.
Filter by product type. Accepted values: Producto, Servicio.
Filter by active status. Use 1 for active products and 0 for inactive products.
When true, returns only products that have stock greater than zero across at least one warehouse.
When true, returns only products whose current stock is at or below their configured minimum stock threshold.
Page number to retrieve. Defaults to 1.
Number of records per page. Accepts values between 1 and 200. Defaults to 100.
Field to sort results by. Accepted values: nombre, codigo, precio, costo, created_at.
Sort direction. Accepted values: asc, desc.
Response example
{
"success" : true ,
"data" : [
{
"id" : 301 ,
"nombre" : "Laptop Dell Inspiron 15" ,
"descripcion" : "Laptop 15.6 \" Intel Core i5, 8GB RAM, 512GB SSD" ,
"codigo" : "LAP-DELL-015" ,
"barcode" : "7501234567890" ,
"nombre_categoria" : "Electrónicos" ,
"precio" : 850.00 ,
"costo" : 620.00 ,
"costo_anterior" : 610.00 ,
"costo_promedio" : 615.50 ,
"marca" : "Dell" ,
"tipo" : "Producto" ,
"enable" : 1 ,
"img" : "https://cdn.smartpyme.site/products/lap-dell-015.jpg" ,
"created_at" : "2024-06-01T08:00:00Z" ,
"updated_at" : "2025-01-10T14:22:00Z" ,
"inventarios" : [
{
"id_producto" : 301 ,
"stock" : 12 ,
"stock_minimo" : 5 ,
"stock_maximo" : 50 ,
"nota" : null ,
"nombre_bodega" : "Bodega Principal" ,
"nombre_sucursal" : "Sucursal Central"
},
{
"id_producto" : 301 ,
"stock" : 4 ,
"stock_minimo" : 2 ,
"stock_maximo" : 20 ,
"nota" : "Revisar vencimiento" ,
"nombre_bodega" : "Bodega Norte" ,
"nombre_sucursal" : "Sucursal Norte"
}
]
}
],
"pagination" : {
"current_page" : 1 ,
"per_page" : 50 ,
"total" : 1 ,
"total_pages" : 1 ,
"has_next" : false ,
"has_prev" : false
},
"meta" : {
"empresa" : "Mi Empresa S.A." ,
"timestamp" : "2025-01-31T15:00:00Z" ,
"filters_applied" : {
"marca" : "Dell" ,
"con_stock" : true
}
}
}
Response fields
Indicates whether the request completed successfully.
Array of product objects matching the applied filters. Unique numeric identifier for the product.
Full display name of the product.
Optional long-form description of the product.
Internal SKU or product code used across your catalog.
Barcode or EAN associated with the product, if configured.
Category name assigned to the product.
Current retail price of the product.
Most recent purchase cost of the product.
Previous purchase cost, retained for cost-trend comparisons.
Weighted average cost calculated across all purchase batches.
Brand name of the product.
Product type: Producto for physical goods or Servicio for services.
Active status flag. 1 means the product is active; 0 means it is inactive.
URL of the product image, if one has been uploaded.
ISO 8601 timestamp of when the product record was created.
ISO 8601 timestamp of the most recent update to the product record.
Stock levels for this product broken down by warehouse and branch. ID of the product this stock entry belongs to.
Current available stock quantity in this warehouse. Supports up to three decimal places.
Minimum stock threshold configured for this product in this warehouse. Stock at or below this level matches the stock_minimo filter.
Maximum stock capacity configured for this product in this warehouse.
Optional notes recorded for this product in this warehouse (e.g. "Revisar vencimiento").
Name of the warehouse holding this stock.
Name of the branch or location to which this warehouse belongs.
GET /inventory/{id}
Retrieves a single product record by its numeric ID. The response returns the same full Product object described above, including the inventarios array with stock levels per warehouse.
Path parameter
The unique numeric identifier of the product you want to retrieve.
curl --request GET \
--url "https://api.smartpyme.site/api/external/v1/inventory/301" \
--header "Authorization: Bearer {api_key}"
The response wraps the Product object under a data key with "success": true. All fields, including inventarios, are identical to the structure documented in the GET /inventory response above.
GET /inventory/summary
Returns aggregate statistics for your entire product catalog and combined stock position. Use this endpoint to get a quick overview of catalog health — how many products are active, total stock on hand, total inventory value, and which categories contain the most products.
curl --request GET \
--url "https://api.smartpyme.site/api/external/v1/inventory/summary" \
--header "Authorization: Bearer {api_key}"
Response example
{
"success" : true ,
"data" : {
"productos" : {
"total" : 500 ,
"activos" : 480 ,
"inactivos" : 20
},
"inventario" : {
"stock_total" : 15750.5 ,
"valor_total" : 125000.75 ,
"productos_con_stock" : 450 ,
"productos_sin_stock" : 30 ,
"productos_stock_bajo" : 15
},
"productos_por_categoria" : [
{ "categoria" : "Electrónicos" , "cantidad" : 150 },
{ "categoria" : "Ropa" , "cantidad" : 200 }
]
},
"meta" : {
"empresa" : "Mi Empresa S.A." ,
"timestamp" : "2025-01-31T15:00:00Z" ,
"filters_applied" : {}
}
}
Response fields
Total number of products in your catalog, regardless of status.
Number of products currently marked as active (enable = 1).
Number of products currently marked as inactive (enable = 0).
data.inventario.stock_total
Sum of all stock quantities across every product and warehouse.
data.inventario.valor_total
Total inventory value calculated using each product’s average cost (costo_promedio) multiplied by its current stock.
data.inventario.productos_con_stock
Number of distinct products that have at least one unit in stock across any warehouse.
data.inventario.productos_sin_stock
Number of distinct products with zero stock across all warehouses.
data.inventario.productos_stock_bajo
Number of products whose current stock is at or below their configured stock_minimo threshold in at least one warehouse.
data.productos_por_categoria
List of product counts grouped by category. Show productos_por_categoria fields
Name of the product category.
Number of products assigned to this category.
Display name of the company associated with your API key.
ISO 8601 timestamp indicating when the summary was generated.
Echo of any filters used to compute the summary.