POST
/productos-grid
🔒 Requiere clave de API
Endpoint conservado para la aplicación Kalkulus. Las integraciones externas de catálogo deben usar POST /productos/catalogo-inventario: incluye variantes y todas las bodegas por SKU en una sola respuesta. Requiere el header Sucursal con el id interno de sucursal.
Ejemplo
curl -X POST "https://fenix.kalkulusapp.com/api/productos-grid" \
-H "X-API-KEY: TU_API_KEY" \
-H "Sucursal: valor" \
-H "Content-Type: application/json" \
-d '{
"page": 1,
"perPage": 10,
"filters": [
{
"key": "codigo_producto",
"value": "102382",
"type": "="
}
],
"columns": [
"id",
"detalle",
"codigo_producto",
"precio_venta",
"inventario",
"es_variable",
"producto_padre_id",
"imagen"
],
"orderBy": "id",
"orderDirection": "DESC"
}'
const cuerpo = {
"page": 1,
"perPage": 10,
"filters": [
{
"key": "codigo_producto",
"value": "102382",
"type": "="
}
],
"columns": [
"id",
"detalle",
"codigo_producto",
"precio_venta",
"inventario",
"es_variable",
"producto_padre_id",
"imagen"
],
"orderBy": "id",
"orderDirection": "DESC"
};
const respuesta = await fetch("https://fenix.kalkulusapp.com/api/productos-grid", {
method: "POST",
headers: {
"X-API-KEY": "TU_API_KEY",
"Sucursal": "valor",
"Content-Type": "application/json"
},
body: JSON.stringify(cuerpo)
});
const datos = await respuesta.json();
import requests
import json
cuerpo = json.loads(r"""
{
"page": 1,
"perPage": 10,
"filters": [
{
"key": "codigo_producto",
"value": "102382",
"type": "="
}
],
"columns": [
"id",
"detalle",
"codigo_producto",
"precio_venta",
"inventario",
"es_variable",
"producto_padre_id",
"imagen"
],
"orderBy": "id",
"orderDirection": "DESC"
}
""")
respuesta = requests.request(
"POST",
"https://fenix.kalkulusapp.com/api/productos-grid",
headers={
"X-API-KEY": "TU_API_KEY",
"Sucursal": "valor",
"Content-Type": "application/json"
},
json=cuerpo,
)
print(respuesta.json())
<?php
$ch = curl_init("https://fenix.kalkulusapp.com/api/productos-grid");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"X-API-KEY: TU_API_KEY",
"Sucursal: valor",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => <<<'JSON'
{
"page": 1,
"perPage": 10,
"filters": [
{
"key": "codigo_producto",
"value": "102382",
"type": "="
}
],
"columns": [
"id",
"detalle",
"codigo_producto",
"precio_venta",
"inventario",
"es_variable",
"producto_padre_id",
"imagen"
],
"orderBy": "id",
"orderDirection": "DESC"
}
JSON,
]);
$respuesta = json_decode(curl_exec($ch), true);
curl_close($ch);
Parámetros
| Nombre | Tipo | Descripción |
|---|---|---|
| Sucursalobligatorio en encabezado |
texto | id de la sucursal (ver GET /sucursales-empresa) — determina de cuál sucursal se listan los productos. |
Cuerpo de la solicitud application/json
| Campo | Tipo |
|---|---|
| page | entero |
| perPage | entero |
| filters3 | |
| key obligatorio | texto |
| value obligatorio | objeto |
| type obligatorio | texto |
| columns | lista de texto |
| orderBy | texto |
| orderDirection | texto ASCDESC |
| sesionKey | texto |
Buscar/listar productos (compatibilidad de la aplicación)
{
"page": 1,
"perPage": 10,
"filters": [
{
"key": "codigo_producto",
"value": "102382",
"type": "="
}
],
"columns": [
"id",
"detalle",
"codigo_producto",
"precio_venta",
"inventario",
"es_variable",
"producto_padre_id",
"imagen"
],
"orderBy": "id",
"orderDirection": "DESC"
}
Respuestas
200Página de productos4 campos
| Campo | Tipo |
|---|---|
| data | lista de objeto |
| current_page | entero |
| per_page | entero |
| total | entero |
Buscar/listar productos (compatibilidad de la aplicación)
{
"data": [
{
"id": 102382,
"detalle": "Camiseta Kalkulus",
"codigo_producto": "102382",
"precio_venta": 12000,
"inventario": 15,
"es_variable": true,
"producto_padre_id": null,
"imagen": "https://res.cloudinary.com/kalkulus/image/upload/v1/productos/102382.jpg"
}
],
"total": 1
}
401Unauthorized
403Ruta no disponible