Skip to main content

What it does

POST /api/spei/cash-in generates a disposable CLABE bound to your sandbox account. Any SPEI transfer received at that CLABE triggers a cash_in webhook to the configured URL. In sandbox, confirmation is simulated ~1 second after CLABE creation (instead of waiting for a real transfer). This lets you test the entire cash-in flow without depending on a real issuing bank.

Example

curl -X POST https://sandbox.mx.ntxpay.com/api/spei/cash-in \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "amountCentavos": 50000,
    "externalId": "order-001",
    "customerName": "Juan Pérez"
  }'

Response (201)

{
  "id": 12345,
  "externalId": "order-001",
  "status": "PENDING",
  "amountCentavos": 50000,
  "clabe": "646180123456789012",
  "expiresAt": "2026-03-26T10:30:00.000Z"
}
Use the returned clabe to display to the end payer (your company’s customer). In sandbox this CLABE is fictitious, but the transaction.clabe field arriving in the webhook will be the same.

Expected webhook

After ~1 second (default success scenario):
{
  "event": "cash_in",
  "deliveryId": "...",
  "transaction": {
    "id": 12345,
    "externalId": "order-001",
    "status": "CONFIRMED",
    "amountCentavos": 50000,
    "clabe": "646180123456789012",
    "confirmedAt": "2026-03-26T10:00:01.000Z",
    "counterpart": {
      "name": "Simulated Payer",
      "taxId": "PAGS850101ABC",
      "bank": {
        "code": "012",
        "name": "BBVA México"
      }
    }
  }
}

Test scenarios

ScenarioWebhook
DefaultCONFIRMED
error:invalid-clabeFAILED
error:duplicate-external-idFAILED
delayed:5sCONFIRMED after 5s
See Scenarios for the full list.

Next steps

Cash-out

How to send SPEI in sandbox.

Webhooks

Understanding webhook delivery in sandbox.