Create Customer
curl -X POST https://api.example.com/cliente \
-H "Content-Type: application/json" \
-d '{
"dni": "12345678",
"nombre": "Juan",
"apellido": "Pérez",
"direccion": "Av. Principal 123",
"telefono": "987654321",
"email": "[email protected]",
"activo": true
}'
{
"id": 1,
"dni": "12345678",
"nombre": "Juan",
"apellido": "Pérez",
"direccion": "Av. Principal 123",
"telefono": "987654321",
"email": "[email protected]",
"fechaRegistro": "2024-01-15T10:30:00",
"activo": true
}
Request Body
Customer’s national identification number (DNI). Must be unique.
Customer’s email address. Must be unique.
Response Fields
Unique customer identifier
Registration timestamp in ISO 8601 format
Get Customer by ID
curl -X GET https://api.example.com/cliente/1
{
"id": 1,
"dni": "12345678",
"nombre": "Juan",
"apellido": "Pérez",
"direccion": "Av. Principal 123",
"telefono": "987654321",
"email": "[email protected]",
"fechaRegistro": "2024-01-15T10:30:00",
"activo": true
}
Path Parameters
Get Customer by DNI
curl -X GET https://api.example.com/cliente/dni/12345678
{
"id": 1,
"dni": "12345678",
"nombre": "Juan",
"apellido": "Pérez",
"direccion": "Av. Principal 123",
"telefono": "987654321",
"email": "[email protected]",
"fechaRegistro": "2024-01-15T10:30:00",
"activo": true
}
Path Parameters
Customer’s national identification number
List All Customers
curl -X GET https://api.example.com/cliente
[
{
"id": 1,
"dni": "12345678",
"nombre": "Juan",
"apellido": "Pérez",
"direccion": "Av. Principal 123",
"telefono": "987654321",
"email": "[email protected]",
"fechaRegistro": "2024-01-15T10:30:00",
"activo": true
},
{
"id": 2,
"dni": "87654321",
"nombre": "María",
"apellido": "García",
"direccion": "Calle Secundaria 456",
"telefono": "912345678",
"email": "[email protected]",
"fechaRegistro": "2024-01-16T14:20:00",
"activo": true
}
]
Update Customer
curl -X PUT https://api.example.com/cliente/1 \
-H "Content-Type: application/json" \
-d '{
"dni": "12345678",
"nombre": "Juan Carlos",
"apellido": "Pérez López",
"direccion": "Av. Principal 123, Piso 2",
"telefono": "987654321",
"email": "[email protected]",
"activo": true
}'
{
"id": 1,
"dni": "12345678",
"nombre": "Juan Carlos",
"apellido": "Pérez López",
"direccion": "Av. Principal 123, Piso 2",
"telefono": "987654321",
"email": "[email protected]",
"fechaRegistro": "2024-01-15T10:30:00",
"activo": true
}
Path Parameters
Request Body
Customer’s national identification number (DNI). Must be unique.
Customer’s email address. Must be unique.
Delete Customer
curl -X DELETE https://api.example.com/cliente/1
Path Parameters