Skip to main content

GET /api/platos/:id

Returns a single dish by its ID. Returns 404 if the dish does not exist or has been soft-deleted. Authentication: Bearer JWT required
Required role: any authenticated user

Request

Path parameters

id
string
required
The dish ID (nanoid format, 10 characters)

Response

Success (200)

id
string
Unique dish ID (nanoid, 10 characters)
nombre
string
Dish name
precio
string
Dish price as a decimal string (e.g. "25.00")
creado_en
string
Creation timestamp (ISO 8601)
actualizado_en
string
Last update timestamp (ISO 8601)
borrado_en
string | null
Soft-delete timestamp — null for active dishes

Error responses

StatusDescription
401Unauthorized — missing or invalid JWT
404Dish not found or has been deleted

Example

curl http://localhost:3000/api/platos/aB3dEfGhIj \
  -H "Authorization: Bearer <token>"
{
  "id": "aB3dEfGhIj",
  "nombre": "Sopa de Maní",
  "precio": "25.00",
  "creado_en": "2026-02-04T09:00:00.000Z",
  "actualizado_en": "2026-02-04T09:00:00.000Z",
  "borrado_en": null
}

Build docs developers (and LLMs) love