Gestión de Clientes
Gestión de Clientes
Section titled “Gestión de Clientes”Esta sección documenta los endpoints disponibles para la gestión de clientes en el sistema de facturación.
Crear Cliente
Section titled “Crear Cliente”Endpoint
Section titled “Endpoint”POST /api/v1/customers/create
Headers
Section titled “Headers”Authorization: Bearer {token}Content-Type: application/jsonAccept: application/json
Crear Cliente con RUC (Empresa)
Section titled “Crear Cliente con RUC (Empresa)”Parámetros del Request Body
Section titled “Parámetros del Request Body”{ "identification_number": "0922895859001", "name": "Vittorio", "lastname": "Dormi Delgado", "identification_type": "RUC", "address": "Guayaquil"}
Respuesta Exitosa (201 Created)
Section titled “Respuesta Exitosa (201 Created)”{ "message": "Registro creado", "status": "CREATED", "payload": { "id": 1617479572, "full_name": "Dormi Delgado Vittorio", "identification_type": "ruc", "identification_number": "0922895859001" }}
Crear Cliente con Cédula (Persona Natural)
Section titled “Crear Cliente con Cédula (Persona Natural)”Parámetros del Request Body
Section titled “Parámetros del Request Body”{ "identification_number": "0921498846", "name": "HECTOR ANTONIO", "lastname": "REYES VILLON", "identification_type": "CEDULA", "address": "Cerecita Km 51"}
Respuesta Exitosa (201 Created)
Section titled “Respuesta Exitosa (201 Created)”{ "message": "Registro creado", "status": "CREATED", "payload": { "id": 1327191485, "full_name": "REYES VILLON HECTOR ANTONIO", "identification_type": "cedula", "identification_number": "0921498846" }}
Crear Cliente Empresa (con flag is_business)
Section titled “Crear Cliente Empresa (con flag is_business)”Parámetros del Request Body
Section titled “Parámetros del Request Body”{ "identification_number": "0991434879001", "name": "CARVAGU S.A.", "identification_type": "RUC", "address": "S/N", "is_business": true}
Parámetros Disponibles
Section titled “Parámetros Disponibles”Campo | Tipo | Requerido | Descripción |
---|---|---|---|
identification_number | string | Sí | Número de identificación (RUC o Cédula) |
name | string | Sí | Nombre del cliente o razón social |
lastname | string | No | Apellido (para personas naturales) |
identification_type | string | Sí | Tipo de identificación: “RUC” o “CEDULA” |
email | string | Sí | Correo electrónico del cliente |
address | string | Sí | Dirección del cliente |
is_business | boolean | No | Indica si es una empresa (true) o persona natural (false) |
Tipos de Identificación
Section titled “Tipos de Identificación”- RUC: Para empresas y personas naturales obligadas a llevar contabilidad
- CEDULA: Para personas naturales no obligadas a llevar contabilidad
Códigos de Respuesta
Section titled “Códigos de Respuesta”- 201 Created: Cliente creado exitosamente
- 400 Bad Request: Datos inválidos en la solicitud
- 401 Unauthorized: Token de autorización inválido
- 422 Unprocessable Entity: Error de validación en los datos