Listar despachos
POST /api/dispatches/list-dispatches
Descripción
Devuelve los despachos por recibir, recibidos o enviados, paginados.
Detalles
Por recibir son los que vienen en camino a este restaurante. Recibidos son los que ya se respondieron, con o sin diferencias. Enviados son todos los que salieron de este restaurante, en cualquier estado. Se puede buscar por número de despacho o por restaurante.
Permisos requeridos
dispatches.module
Request
| Nombre | Tipo | Requerido | Reglas |
|---|---|---|---|
| view | string | Sí |
enum:incoming,received,outgoing
|
| search | string | No |
max:100
|
Paginación
| defaultLimit | 50 |
| maxLimit | 100 |
| defaultDir | desc |
| withTotal | true |
| allowedSorts | [sentAt, dispatchNumber] |
Ejemplo de request
curl -X POST https://restofy.pro/api/dispatches/list-dispatches \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <accessToken>" \
-d '{
"view": "string"
}'
Los valores son demo: reemplázalos por datos reales del negocio.
Ejemplo de respuesta
Actualizado: 2026-11-02T19:00:57Z
HTTP 200
Request
{
"view": "incoming"
}
Response
{
"success": true,
"message": "Operación realizada correctamente",
"data": {
"dispatches": [
{
"dispatchNumber": 1,
"dispatchUuid": "8a9e1dcb-fb81-4dde-b869-a157fc488b97",
"statusCode": "in_transit",
"direction": "incoming",
"counterpartName": "Cocina central 3eb51",
"fromTenantName": "Cocina central 3eb51",
"toTenantName": "Sede norte 8c812",
"fromStorageLocationName": "Bodega Principal",
"toStorageLocationName": null,
"sentByName": "App Testing",
"receivedByName": null,
"notes": "Pedido de prueba",
"receptionNotes": null,
"sentAt": "2026-11-02T18:33:27.000Z",
"receivedAt": null,
"linesCount": 1,
"totalCostCents": 120000,
"pendingReturnsCount": 0
}
],
"pagination": {
"page": 1,
"limit": 50,
"total": 1,
"totalPages": 1,
"hasNext": false,
"hasPrev": false
}
}
}