Crear link de cobro
curl --request POST \
--url https://api.cobrix.co/api/integrations/v1/{companyId}/collection-documents/checkout-sessions \
--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 '
{
"customerExternalId": "customer-1001",
"currency": "USD",
"documents": [
{
"externalDocumentId": "invoice-1001"
}
]
}
'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({
customerExternalId: 'customer-1001',
currency: 'USD',
documents: [{externalDocumentId: 'invoice-1001'}]
})
};
fetch('https://api.cobrix.co/api/integrations/v1/{companyId}/collection-documents/checkout-sessions', 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/checkout-sessions"
payload = {
"customerExternalId": "customer-1001",
"currency": "USD",
"documents": [{ "externalDocumentId": "invoice-1001" }]
}
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){
"sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"token": "<string>",
"checkoutUrl": "<string>",
"currency": "<string>",
"amountMinor": "<string>",
"documents": [
{
"invoiceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amountMinor": "<string>",
"number": "<string>",
"externalDocumentId": "<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": "<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"
}
}Links de cobro
Crear link de cobro
Crea una sesión para documentos abiertos del mismo cliente y moneda. El source se obtiene de la llave.
POST
/
integrations
/
v1
/
{companyId}
/
collection-documents
/
checkout-sessions
Crear link de cobro
curl --request POST \
--url https://api.cobrix.co/api/integrations/v1/{companyId}/collection-documents/checkout-sessions \
--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 '
{
"customerExternalId": "customer-1001",
"currency": "USD",
"documents": [
{
"externalDocumentId": "invoice-1001"
}
]
}
'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({
customerExternalId: 'customer-1001',
currency: 'USD',
documents: [{externalDocumentId: 'invoice-1001'}]
})
};
fetch('https://api.cobrix.co/api/integrations/v1/{companyId}/collection-documents/checkout-sessions', 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/checkout-sessions"
payload = {
"customerExternalId": "customer-1001",
"currency": "USD",
"documents": [{ "externalDocumentId": "invoice-1001" }]
}
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){
"sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"token": "<string>",
"checkoutUrl": "<string>",
"currency": "<string>",
"amountMinor": "<string>",
"documents": [
{
"invoiceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amountMinor": "<string>",
"number": "<string>",
"externalDocumentId": "<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": "<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}$Path Parameters
Empresa vinculada a la llave.
Body
application/json

