Crear o actualizar documento
curl --request POST \
--url https://api.cobrix.co/api/integrations/v1/{companyId}/collection-documents/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",
"externalDocumentId": "invoice-1001",
"customerExternalId": "customer-1001",
"customer": {
"type": "individual",
"name": "Cliente de prueba",
"email": "[email protected]"
},
"issueDate": "2026-07-14T00:00:00Z",
"dueDate": "2026-08-14T00:00:00Z",
"currency": "USD",
"lines": [
{
"description": "Plan mensual",
"quantity": 1,
"unitAmountMinor": 2025
}
]
}
'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',
externalDocumentId: 'invoice-1001',
customerExternalId: 'customer-1001',
customer: {type: 'individual', name: 'Cliente de prueba', email: '[email protected]'},
issueDate: '2026-07-14T00:00:00Z',
dueDate: '2026-08-14T00:00:00Z',
currency: 'USD',
lines: [{description: 'Plan mensual', quantity: 1, unitAmountMinor: 2025}]
})
};
fetch('https://api.cobrix.co/api/integrations/v1/{companyId}/collection-documents/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}/collection-documents/upsert"
payload = {
"source": "erp_acme",
"externalDocumentId": "invoice-1001",
"customerExternalId": "customer-1001",
"customer": {
"type": "individual",
"name": "Cliente de prueba",
"email": "[email protected]"
},
"issueDate": "2026-07-14T00:00:00Z",
"dueDate": "2026-08-14T00:00:00Z",
"currency": "USD",
"lines": [
{
"description": "Plan mensual",
"quantity": 1,
"unitAmountMinor": 2025
}
]
}
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){
"invoiceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyCustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customerExternalId": "<string>",
"source": "<string>",
"externalDocumentId": "<string>",
"status": "created",
"invoiceStatus": "<string>",
"currency": "<string>",
"totalMinor": 123,
"balanceMinor": 123,
"customer": {
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyCustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": "<string>",
"externalCustomerId": "<string>",
"status": "created"
},
"invoiceNumber": "<string>"
}{
"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"
}
}Documentos de cobro
Crear o actualizar documento
Sincroniza un documento externo, su cliente y líneas. totalMinor, cuando se envía, debe corresponder con las líneas.
POST
/
integrations
/
v1
/
{companyId}
/
collection-documents
/
upsert
Crear o actualizar documento
curl --request POST \
--url https://api.cobrix.co/api/integrations/v1/{companyId}/collection-documents/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",
"externalDocumentId": "invoice-1001",
"customerExternalId": "customer-1001",
"customer": {
"type": "individual",
"name": "Cliente de prueba",
"email": "[email protected]"
},
"issueDate": "2026-07-14T00:00:00Z",
"dueDate": "2026-08-14T00:00:00Z",
"currency": "USD",
"lines": [
{
"description": "Plan mensual",
"quantity": 1,
"unitAmountMinor": 2025
}
]
}
'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',
externalDocumentId: 'invoice-1001',
customerExternalId: 'customer-1001',
customer: {type: 'individual', name: 'Cliente de prueba', email: '[email protected]'},
issueDate: '2026-07-14T00:00:00Z',
dueDate: '2026-08-14T00:00:00Z',
currency: 'USD',
lines: [{description: 'Plan mensual', quantity: 1, unitAmountMinor: 2025}]
})
};
fetch('https://api.cobrix.co/api/integrations/v1/{companyId}/collection-documents/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}/collection-documents/upsert"
payload = {
"source": "erp_acme",
"externalDocumentId": "invoice-1001",
"customerExternalId": "customer-1001",
"customer": {
"type": "individual",
"name": "Cliente de prueba",
"email": "[email protected]"
},
"issueDate": "2026-07-14T00:00:00Z",
"dueDate": "2026-08-14T00:00:00Z",
"currency": "USD",
"lines": [
{
"description": "Plan mensual",
"quantity": 1,
"unitAmountMinor": 2025
}
]
}
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){
"invoiceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyCustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customerExternalId": "<string>",
"source": "<string>",
"externalDocumentId": "<string>",
"status": "created",
"invoiceStatus": "<string>",
"currency": "<string>",
"totalMinor": 123,
"balanceMinor": 123,
"customer": {
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyCustomerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"source": "<string>",
"externalCustomerId": "<string>",
"status": "created"
},
"invoiceNumber": "<string>"
}{
"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
Minimum string length:
1Minimum string length:
1Minimum string length:
1Show child attributes
Show child attributes
Available options:
USD, VES, usd, ves Show child attributes
Show child attributes
Required range:
x >= 0Response
Documento procesado
Available options:
created, updated, unchanged, rejected Show child attributes
Show child attributes

