Skip to main content

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

dni
string
required
Customer’s national identification number (DNI). Must be unique.
nombre
string
required
Customer’s first name
apellido
string
Customer’s last name
direccion
string
Customer’s address
telefono
string
Customer’s phone number
email
string
required
Customer’s email address. Must be unique.
activo
boolean
default:"true"
Customer active status

Response Fields

id
number
Unique customer identifier
dni
string
Customer’s DNI
nombre
string
Customer’s first name
apellido
string
Customer’s last name
direccion
string
Customer’s address
telefono
string
Customer’s phone number
email
string
Customer’s email address
fechaRegistro
string
Registration timestamp in ISO 8601 format
activo
boolean
Customer active status

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

id
number
required
Customer ID

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

dni
string
required
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

id
number
required
Customer ID to update

Request Body

dni
string
required
Customer’s national identification number (DNI). Must be unique.
nombre
string
required
Customer’s first name
apellido
string
Customer’s last name
direccion
string
Customer’s address
telefono
string
Customer’s phone number
email
string
required
Customer’s email address. Must be unique.
activo
boolean
Customer active status

Delete Customer

curl -X DELETE https://api.example.com/cliente/1

Path Parameters

id
number
required
Customer ID to delete

Build docs developers (and LLMs) love