Resolver Cliente
Busca un cliente por email o lo crea si no existe. Es idempotente: múltiples llamadas con el mismo email retornan el mismo cliente.
ID de tu empresa en Cobrix
Email del cliente (case-insensitive)
Nombre completo del cliente
curl -X POST "https://sandbox-api.cobrix.co/api/checkout/resolve-customer" \
-H "Authorization: Bearer tu_access_token" \
-H "Content-Type: application/json" \
-d '{
"companyId": "22991695-c790-4ed2-882b-c60e6190d442",
"email": "[email protected]",
"name": "Juan Pérez",
"phone": "+58 412-1234567",
"identityDocument": "V-12345678"
}'
{
"companyCustomerId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"customerId": "550e8400-e29b-41d4-a716-446655440000",
"email": "[email protected]",
"name": "Juan Pérez",
"isNew": false
}
Objeto Cliente
| Campo | Tipo | Descripción |
|---|
companyCustomerId | string | ID a usar para checkout - Relación cliente-empresa |
customerId | string | ID global del cliente en Cobrix |
email | string | Email del cliente |
name | string | Nombre del cliente |
isNew | boolean | true si fue creado, false si ya existía |
Notas de Idempotencia
El endpoint busca por email (case-insensitive):
# Primera llamada - crea cliente
POST /checkout/resolve-customer
{ "email": "[email protected]", "name": "Juan" }
# → { "companyCustomerId": "abc123", "isNew": true }
# Segunda llamada - mismo email, diferente case
POST /checkout/resolve-customer
{ "email": "[email protected]", "name": "Juan Modificado" }
# → { "companyCustomerId": "abc123", "isNew": false }
# Nota: El nombre NO se actualiza
El endpoint no actualiza datos de clientes existentes. Si necesitas actualizar información, usa el panel de administración.