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

# Payment failures

A payment can fail while Melio **collects** the funds from your internal account or while it **delivers** them to the payee. Either way the payment moves to `failed`, and Melio settles the money automatically. Here is what happens and how to recover.

## What can fail

* **Collection** - the debit from your internal (funding) account does not go through.
* **Delivery** - the funds cannot be delivered to the payee, or the transfer is returned.

A payment can also be stopped during risk review; see [Payment lifecycle](/docs/payment-lifecycle).

## How Melio handles it

| Failure                           | What Melio does            | The money                                                                                                       |
| --------------------------------- | -------------------------- | --------------------------------------------------------------------------------------------------------------- |
| **Collection fails**              | Payment moves to `failed`. | Nothing was collected, so there is nothing to refund.                                                           |
| **Delivery fails or is returned** | Payment moves to `failed`. | Melio automatically refunds the amount to the original internal account. Fees already charged are not refunded. |

<Note>
  Melio does not automatically retry a failed payment. To try again, create a new payment.
</Note>

## How you find out

Melio sends `api.payment.updated`; fetch the payment to see it is now `failed`.

```http theme={null}
GET /payments/pay_9f8c7b6a5d4e3f21
```

The business is also emailed about the failure. For a delivery failure the email confirms the funds are being refunded and the expected timing. If you would rather handle these notifications yourself, ask Melio to configure which failure emails are sent.

## How to recover

Create a new payment with corrected details (for example a different receiving account):

```http theme={null}
POST /payments
```

There is no retry on the same payment; recovery is always a new `POST /payments`.

## Test failures in the sandbox

Drive a payment to `failed` in a non-production environment with the simulation endpoint, so you can build and verify your handling before going live. It is available in non-production only and returns `404` in production.

```http theme={null}
POST /simulations/payments/pay_9f8c7b6a5d4e3f21/actions
```

```json theme={null}
{
  "action": "fail-deliver",
  "reason": "account closed"
}
```

Use `fail-collect` for a collection failure and `fail-deliver` for a delivery failure. The `reason` is optional free text recorded on the action.

<Note>
  Related: an undeposited check is automatically voided after 90 days, and the payment is refunded like any other delivery failure.
</Note>
