Skip to main content

Update Customer

Update existing customer information including contact details, location, and pricing settings.
POST /clientes/updateCliente
Content-Type: application/json

{
  "id": 1,
  "numero_documento": "12345678",
  "nombres": "Juan Pérez García",
  "fecha_nacimiento": "1990-01-15",
  "email": "[email protected]",
  "password": "newPassword123",
  "celular": "987654321",
  "tipo_cliente": "Natural",
  "tipo_pago": "Crédito",
  "incluye_igv": 1,
  "id_distrito": 150102,
  "id_lista_precio": 2,
  "id_tipo_detraccion": 1,
  "extra_domicilio_a_domicilio": 8,
  "extra_domicilio_a_agencia": 5,
  "extra_agencia_a_domicilio": 5
}

Request Parameters

id
integer
required
Customer ID to update
numero_documento
string
required
Customer’s document number (DNI/RUC)
nombres
string
required
Customer’s full name or company name
fecha_nacimiento
string
Date of birth in YYYY-MM-DD format
email
string
Customer’s email address
password
string
New password for customer portal (leave empty to keep current password)
celular
string
required
Mobile phone number
tipo_cliente
string
required
Customer type (e.g., “Natural”, “Jurídico”)
tipo_pago
string
required
Payment type (e.g., “Contado”, “Crédito”)
incluye_igv
integer
required
Include IGV in prices: 1 = yes, 0 = no
id_distrito
integer
required
District ID where customer is located
id_lista_precio
integer
required
Price list ID (plan) assigned to customer
id_tipo_detraccion
integer
Detraction type ID for tax purposes
extra_domicilio_a_domicilio
integer
Extra charge for home-to-home delivery
extra_domicilio_a_agencia
integer
Extra charge for home-to-agency delivery
extra_agencia_a_domicilio
integer
Extra charge for agency-to-home delivery

Response

message
string
Success confirmation message

Error Responses

{
  "error": "Cliente no encontrado"
}

Add Customer Address

Add new addresses to an existing customer’s address list.
POST /clientes/agregarDireccion
Content-Type: application/json

{
  "id_cliente": 1,
  "direcciones": [
    {
      "direccion": "Av. Arequipa 890",
      "referencia": "Edificio azul, tercer piso"
    },
    {
      "direccion": "Calle Las Flores 234",
      "referencia": "Casa con reja blanca"
    }
  ]
}

Request Parameters

id_cliente
integer
required
Customer ID to add addresses to
direcciones
array
required
Array of new addresses to add to customer

Response

message
string
Success confirmation message

Error Responses

{
  "error": "Cliente no encontrado"
}

Update Notes

Important: When updating a customer, the id field is required to identify which customer to update. All other required fields must be provided even if they haven’t changed.
To update only the addresses without modifying customer information, use the Add Customer Address endpoint instead.

Address Management

The address management system allows customers to have multiple delivery locations:
  • Each address must have a direccion (street address)
  • The referencia field is optional but recommended for easier delivery location
  • When adding addresses, they are appended to the existing address list
  • Each address gets a unique ID assigned by the system

Address Examples

Good address format:
{
  "direccion": "Av. Javier Prado Este 4200, San Borja",
  "referencia": "Edificio corporativo, torre B, piso 5"
}
Minimal address:
{
  "direccion": "Jr. Lampa 345, Cercado de Lima",
  "referencia": ""
}

Build docs developers (and LLMs) love