> ## 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.

# Checkout de documentos completado

> El checkout aplicó el pago a documentos de cobro

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

## Qué significa

La sesión de checkout de documentos terminó y el pago fue relacionado con los documentos seleccionados. El arreglo `documents` identifica los saldos involucrados.

## Payload completo

```json theme={null}
{
  "id": "evt_4a7f0873-c657-4e04-930d-160af7701262",
  "event": "checkout.collection_document_session.completed",
  "created_at": "2026-07-14T16:10:00.000Z",
  "api_version": "2025-01-21",
  "data": {
    "paymentId": "pay_842f7712",
    "checkoutSessionId": "cs_5e52b98d",
    "companyId": "7d355d52-ac74-49f5-b31c-ce29b4680752",
    "companyCustomerId": "cc_8aa37fd1",
    "documents": [
      {
        "invoiceId": "inv_d64d7b11",
        "invoiceNumber": "DOC-1001",
        "externalInvoiceId": "erp-1001",
        "source": "erp_acme",
        "currency": "USD",
        "appliedAmountMinor": "2000",
        "remainingBalanceMinor": "0"
      }
    ],
    "payment": {
      "id": "pay_842f7712",
      "companyId": "7d355d52-ac74-49f5-b31c-ce29b4680752",
      "companyCustomerId": "cc_8aa37fd1",
      "checkoutSessionId": "cs_5e52b98d",
      "subscriptionId": null,
      "status": "succeeded",
      "reconciliationStatus": "reconciled",
      "amount": 20,
      "amountMinor": 2000,
      "currency": "USD",
      "referenceAmountMinor": null,
      "referenceCurrency": null,
      "provider": "checkout",
      "providerChargeId": "charge_9001",
      "hasPaymentReference": true,
      "paymentReference": "PAY-9001",
      "paymentReferenceMasked": "****9001",
      "hasProof": false,
      "paidAt": "2026-07-14T16:10:00.000Z",
      "valueDate": null,
      "createdAt": "2026-07-14T16:09:00.000Z",
      "updatedAt": "2026-07-14T16:10:00.000Z",
      "exchange": null
    },
    "paymentMethod": {
      "kind": "card",
      "method": "card",
      "label": "Tarjeta",
      "channel": "automatic",
      "provider": "checkout",
      "isManual": false,
      "requiresReconciliation": false,
      "receiver": null,
      "receiverCheck": null,
      "submitted": null,
      "review": {
        "requiresReview": false,
        "reasons": [],
        "ocrVerdict": null,
        "ocrConfidence": null
      }
    }
  }
}
```

## Cómo procesarlo

<Steps>
  <Step title="Deduplica por id">No repitas aplicaciones si el evento vuelve a llegar.</Step>
  <Step title="Correlaciona el pago">Usa `paymentId` y `checkoutSessionId`.</Step>
  <Step title="Actualiza cada documento">Lee `appliedAmountMinor` y `remainingBalanceMinor` como strings enteros.</Step>
  <Step title="Responde 200">Procesa tareas pesadas fuera del request.</Step>
</Steps>
