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

# refund_out Webhook

> Return of a cash-out — a sent transfer was returned by the counterparty

## When it fires

The `refund_out` webhook type receives the `transaction.cash_out.returned` event: a **transfer you sent was returned** by the counterparty's bank. The corresponding balance is credited back to your account.

Common scenarios:

* Invalid destination CLABE or closed account
* The beneficiary/counterparty bank rejected the transfer after initial acceptance
* Return within the SPEI network's window

## Payload

```json theme={"system"}
{
  "event": "transaction.cash_out.returned",
  "transactionId": "56789",
  "amount": 50000,
  "currency": "MXN",
  "status": "RETURNED",
  "destinationClabe": "012180001234567890",
  "sourceClabe": null,
  "reference": "9876543",
  "voucher": null,
  "occurredAt": "2026-05-14T09:15:00.000Z"
}
```

The `transactionId` is the **same** as the original cash-out — use it to correlate and mark the payment as returned.

## Headers

| Header               | Value                              |
| -------------------- | ---------------------------------- |
| `x-event-id`         | Unique event UUID (use for dedupe) |
| `X-NTXPay-Signature` | `sha256=<hmac>` of the raw body    |

## Expected Response

`200 OK` within 10 seconds.

## Processing

```typescript theme={"system"}
const event = JSON.parse(rawBody.toString());
if (event.event === 'transaction.cash_out.returned') {
  // The balance credit back has already happened automatically
  await markPayoutReturned(event.transactionId, event.amount);
}
```

For the complete handler with HMAC validation and dedupe in Node.js, Python, Java, and Go, see [Implementation](/en/guides/webhooks/implementation).
