Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/luisllatas-dev/Proyecto_Pasteleria_DonMamino/llms.txt

Use this file to discover all available pages before exploring further.

The Clients API lets you manage the customer records for Don Mamino’s bakery locations. All read operations are publicly accessible without authentication. Write operations — creating, updating, and deleting clients — require a valid JWT Bearer token.
Authentication: GET endpoints are public and require no token. POST, PUT, and DELETE endpoints require an Authorization: Bearer <token> header.

GET /api/clientes

Returns a list of all registered clients in the database.
curl --request GET \
  --url http://localhost:3000/api/clientes
Response — 200 OK
[
  {
    "id_cliente": 1,
    "nombre_cliente": "María López",
    "email": "[email protected]",
    "telefono": "987654321",
    "direccion_envio": "Av. Lima 123, Miraflores"
  },
  {
    "id_cliente": 2,
    "nombre_cliente": "Carlos Ríos",
    "email": "[email protected]",
    "telefono": "912345678",
    "direccion_envio": "Jr. Cusco 456, San Isidro"
  }
]
id_cliente
number
required
Auto-incremented unique identifier for the client.
nombre_cliente
string
required
Full name of the client.
email
string
required
Unique email address of the client.
telefono
string
required
Contact phone number (up to 15 characters).
direccion_envio
string
required
Shipping address for order delivery.

GET /api/clientes/:id

Returns a single client record by their unique ID.
curl --request GET \
  --url http://localhost:3000/api/clientes/1
Response — 200 OK
{
  "id_cliente": 1,
  "nombre_cliente": "María López",
  "email": "[email protected]",
  "telefono": "987654321",
  "direccion_envio": "Av. Lima 123, Miraflores"
}
Response — 404 Not Found
{
  "message": "Cliente no encontrado"
}

POST /api/clientes

Creates a new client record. Requires authentication.
This endpoint requires a valid JWT Bearer token in the Authorization header.
nombre_cliente
string
required
Full name of the client.
email
string
required
Unique email address. Duplicate emails will cause a conflict error.
telefono
string
required
Contact phone number (up to 15 characters).
direccion_envio
string
required
Shipping address for order delivery.
curl --request POST \
  --url http://localhost:3000/api/clientes \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "nombre_cliente": "Ana Torres",
    "email": "[email protected]",
    "telefono": "956123789",
    "direccion_envio": "Calle Flores 789, Barranco"
  }'
Response — 201 Created
{
  "id": 3,
  "mensaje": "Cliente creado exitosamente"
}
id
number
required
The id_cliente of the newly created client record.
mensaje
string
required
Confirmation message.

PUT /api/clientes/:id

Updates all fields of an existing client record. Requires authentication.
This endpoint requires a valid JWT Bearer token in the Authorization header.
id
number
required
The unique ID of the client to update.
nombre_cliente
string
required
Updated full name of the client.
email
string
required
Updated email address.
telefono
string
required
Updated contact phone number.
direccion_envio
string
required
Updated shipping address.
curl --request PUT \
  --url http://localhost:3000/api/clientes/3 \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "nombre_cliente": "Ana Torres Mendoza",
    "email": "[email protected]",
    "telefono": "956123789",
    "direccion_envio": "Calle Flores 789, Barranco"
  }'
Response — 200 OK
{
  "mensaje": "Cliente actualizado exitosamente"
}
Response — 404 Not Found
{
  "message": "Cliente no encontrado"
}

DELETE /api/clientes/:id

Permanently deletes a client record by ID. Requires authentication.
This endpoint requires a valid JWT Bearer token in the Authorization header. Deletion is permanent and cannot be undone.
id
number
required
The unique ID of the client to delete.
curl --request DELETE \
  --url http://localhost:3000/api/clientes/3 \
  --header 'Authorization: Bearer <token>'
Response — 200 OK
{
  "mensaje": "Cliente eliminado exitosamente"
}
Response — 404 Not Found
{
  "message": "Cliente no encontrado"
}

Build docs developers (and LLMs) love