Crear o actualizar cliente
curl --request POST \
--url https://api.cobrix.co/api/integrations/v1/{companyId}/customers/upsert \
--header 'Authorization: Bearer <token>' \
--header 'Cobrix-Signature: <cobrix-signature>' \
--header 'Cobrix-Timestamp: <cobrix-timestamp>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"source": "erp_acme",
"externalCustomerId": "customer-1001",
"type": "individual",
"name": "Cliente de prueba"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'Cobrix-Timestamp': '<cobrix-timestamp>',
'Cobrix-Signature': '<cobrix-signature>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
source: 'erp_acme',
externalCustomerId: 'customer-1001',
type: 'individual',
name: 'Cliente de prueba'
})
};
fetch('https://api.cobrix.co/api/integrations/v1/{companyId}/customers/upsert', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.cobrix.co/api/integrations/v1/{companyId}/customers/upsert"
payload = {
"source": "erp_acme",
"externalCustomerId": "customer-1001",
"type": "individual",
"name": "Cliente de prueba"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Cobrix-Timestamp": "<cobrix-timestamp>",
"Cobrix-Signature": "<cobrix-signature>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyCustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": "<string>",
"externalCustomerId": "<string>",
"status": "created"
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "The API key is missing or invalid.",
"requestId": "req-1001"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests for this API key.",
"requestId": "req-1001"
}
}Clientes
Crear o actualizar cliente
Crea, actualiza o reproduce sin cambios un cliente externo. source debe coincidir con el partner de la llave.
POST
/
integrations
/
v1
/
{companyId}
/
customers
/
upsert
Crear o actualizar cliente
curl --request POST \
--url https://api.cobrix.co/api/integrations/v1/{companyId}/customers/upsert \
--header 'Authorization: Bearer <token>' \
--header 'Cobrix-Signature: <cobrix-signature>' \
--header 'Cobrix-Timestamp: <cobrix-timestamp>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"source": "erp_acme",
"externalCustomerId": "customer-1001",
"type": "individual",
"name": "Cliente de prueba"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'Cobrix-Timestamp': '<cobrix-timestamp>',
'Cobrix-Signature': '<cobrix-signature>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
source: 'erp_acme',
externalCustomerId: 'customer-1001',
type: 'individual',
name: 'Cliente de prueba'
})
};
fetch('https://api.cobrix.co/api/integrations/v1/{companyId}/customers/upsert', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.cobrix.co/api/integrations/v1/{companyId}/customers/upsert"
payload = {
"source": "erp_acme",
"externalCustomerId": "customer-1001",
"type": "individual",
"name": "Cliente de prueba"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Cobrix-Timestamp": "<cobrix-timestamp>",
"Cobrix-Signature": "<cobrix-signature>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyCustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": "<string>",
"externalCustomerId": "<string>",
"status": "created"
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "The API key is missing or invalid.",
"requestId": "req-1001"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests for this API key.",
"requestId": "req-1001"
}
}Authorizations
Llave cbx_live creada para el partner.
Headers
Identificador estable de la operación.
Minimum string length:
1Segundos Unix dentro de una ventana de cinco minutos.
Pattern:
^[0-9]{10}$HMAC-SHA256 de timestamp, método, ruta y cuerpo crudo.
Pattern:
^v1=[a-f0-9]{64}$Identificador opcional para correlación de soporte.
Path Parameters
Empresa vinculada a la llave.
Body
application/json
Available options:
individual, business Required string length:
1 - 200Minimum string length:
1Minimum string length:
1
