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

# Delete Virtual Account

Permanently disable virtual accounts that are no longer needed using the API endpoint.

The `DELETE` operation **permanently deactivates** a virtual account, preventing it from receiving any future payments. The historical record and transaction data associated with the account are preserved in our system for compliance, reporting, and reconciliation purposes.

**Important**: This action is irreversible. A deactivated account cannot be reactivated. If you need to re-enable payment collection for the same beneficiary, you must [create a new virtual account](https://docs.localpayment.com/docs/create-a-virtual-account.md) .

Use this endpoint to clean up accounts that are no longer active in your operational workflow.

## Availability

Virtual Account deletion via API is available in the following countries:

| Country | Delete |
| - | - |
| **[Argentina](https://docs.localpayment.com/docs/argentina.md)** | ✔ |
| **[Brazil](https://docs.localpayment.com/docs/brazil.md)** | ✔ |
| **[Chile](https://docs.localpayment.com/docs/chile.md)** | ✔ |
| **[Colombia](https://docs.localpayment.com/docs/colombia.md)** | ✔ |
| **[Mexico (SPEI and TEF)](https://docs.localpayment.com/docs/mexico.md)** | ✔ |
| **[Peru](https://docs.localpayment.com/docs/peru.md)** | — |

***

## Before You Begin

Ensure you have:

* Valid [API credentials ](https://docs.localpayment.com/docs/api-keys-and-environments.md)(access token).
* Virtual account external ID you want to delete.

***

## Virtual Account Deletion

Currently, virtual account deletion is only available through the API endpoint. Use this method for automated cleanup processes and account management.

Before deleting a virtual account, ensure it meets the following criteria:

| Status | Can Delete | Notes |
| - | - | - |
| `COMPLETED` | ✅ | Active accounts can be deleted |
| `DISABLED` | ✅ | Already deactivated accounts can be deleted |
| `INPROGRESS` | ❌ | Wait for account creation to complete |
| Has pending transactions | ❌ | Resolve all pending transactions first |
| Has uncleared funds | ❌ | Wait for funds to clear and settle |

### Example Request

Send a `DELETE` request to the [Delete Virtual Account](https://docs.localpayment.com/reference/delete-virtual-account.md) endpoint using the external ID:

```bash curl theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
curl --request DELETE \
     --url https://api.stage.localpayment.com/api/virtual-account/{externalId} \
 		 --header 'Authorization: Bearer <your_access_token>' \
     --header 'accept: application/json'
```

### Key Request Parameters

The request requires several key parameters:

| Object | Description | Required |
| - | - | - |
| `externalId` | The external ID of the virtual account to delete (path parameter) | ✅ |

See all [available parameters](https://docs.localpayment.com/reference/delete-virtual-account.md) in the request.

### Successful Response

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "currency": "MXN",
  "externalId": "f059a032-9253-4607-9b8e-2948ed18d595",
  "internalId": "d710312c-8c3f-4b65-8e62-7f83eeba321a",
  "accountNumber": "{{accountNumber}}",
  "beneficiary": {
    "type": "INDIVIDUAL",
    "name": "John",
    "document": {
      "type": "RFC",
      "id": "EXTF900101NI1"
    },
    "bank": {
      "branch": {},
      "account": {
        "number": "646011319800023123",
        "aliases": [],
        "owner": {
          "document": {}
        }
      }
    },
    "fullName": "John Doe",
    "lastName": "Doe"
  },
  "status": {
    "code": "100",
    "description": "INPROGRESS",
    "detail": "Virtual account in progress"
  },
  "errors": []
}
```

### Key Response Fields

| Field | Description | Use Case |
| - | - | - |
| `internalId` | Localpayment's unique identifier for the deleted virtual account. | Transaction tracking and support |
| `externalId` | Your original reference number for the virtual account. | Internal reconciliation |
| `status.code` | Current transaction status code | Status monitoring |

***

## Next Steps

After deleting virtual accounts, you may want to:

> [card] [View Account Status](https://docs.localpayment.com/docs/get-virtual-account-status.md)
>
> Verify virtual account status before attempting deletion.

> [card] [Create New Virtual Accounts](https://docs.localpayment.com/docs/create-a-virtual-account.md)
>
> Generate new virtual accounts for ongoing business needs.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.