> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cobrix.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Link para cobranza automatizada

> El flujo de cobranza preparó un link para entrega externa

<span className="cobrix-event-name">collection\_document.checkout\_link\_sent</span>

## Qué significa

Cobrix preparó un link y un contrato de entrega para que un sistema externo, por ejemplo un workflow de Meta WhatsApp, envíe el mensaje de cobranza automatizada. Dentro de `data`, `delivery.metaTemplate` indica la plantilla y variables.

## Payload completo

```json theme={null}
{
  "id": "evt_0a1d994e-f82c-420c-ab8d-a2fe9c23e69e",
  "event": "collection_document.checkout_link_sent",
  "created_at": "2026-07-14T15:45:00.000Z",
  "api_version": "2025-01-21",
  "data": {
    "event": "collection_document.checkout_link_sent",
    "version": "2026-05-18",
    "timestamp": "2026-07-14T15:45:00.000Z",
    "trigger": "manual",
    "subjectType": "collection_document",
    "customer": {
      "id": "cc_8aa37fd1",
      "name": "Ana Pérez",
      "email": "ana@example.com",
      "phone": "+584120000000",
      "taxId": "V12345678",
      "customerCode": "C-1001"
    },
    "company": {
      "id": "7d355d52-ac74-49f5-b31c-ce29b4680752",
      "name": "Empresa de ejemplo",
      "supportPhone": "+584120001111"
    },
    "checkout": {
      "sessionId": "cs_5e52b98d",
      "token": "checkout_public_token",
      "url": "https://pay.cobrix.co/c/cs_5e52b98d",
      "expiresAt": "2026-07-15T15:45:00.000Z"
    },
    "amount": {
      "minor": "2000",
      "major": "20.00",
      "currency": "USD"
    },
    "documents": [
      {
        "invoiceId": "inv_d64d7b11",
        "number": "DOC-1001",
        "externalDocumentId": "erp-1001",
        "issuedAt": "2026-07-01",
        "dueDate": "2026-07-15",
        "amountMinor": "2000",
        "amountMajor": "20.00",
        "balanceMinor": "2000",
        "currency": "USD"
      }
    ],
    "dunningDetails": {
      "reminderType": "MANUAL_SEND",
      "documentCount": 1,
      "nearestDueDate": "2026-07-15"
    },
    "references": {
      "checkoutType": "collection_documents",
      "source": "erp_acme",
      "idempotencyKey": "send-doc-1001-20260714"
    },
    "delivery": {
      "requestedChannels": ["email", "whatsapp"],
      "email": {
        "provider": "cobrix",
        "status": "sent",
        "recipient": "ana@example.com",
        "providerId": "mail_8172"
      },
      "whatsapp": {
        "provider": "meta",
        "recipient": "+584120000000",
        "metaTemplate": {
          "key": "collection_document_checkout_link_v2",
          "name": "collection_document_checkout_link_v2",
          "language": "es",
          "version": "v2",
          "variables": {
            "customer_name": "Ana Pérez",
            "amount": "20.00",
            "currency": "USD",
            "checkout_url": "https://pay.cobrix.co/c/cs_5e52b98d"
          }
        }
      }
    }
  }
}
```

## Qué debe hacer tu workflow

1. Deduplicar por `data.references.idempotencyKey` y `payload.id`.
2. Validar que `delivery.requestedChannels` incluya `whatsapp`.
3. Mapear `metaTemplate.name`, `language` y `variables` a la API de Meta.
4. Registrar el identificador devuelto por Meta.
5. Responder `200` sin esperar confirmaciones posteriores de entrega.
