# Delete Prism Payout Account

In certain situations, you may need to delete a merchant's payout account:

* The Stripe account was created incorrectly
* The merchant onboarded with the wrong country or business type
* Administrative cleanup is required

Violet provides an API to delete a Payout Account and its associated Stripe Express account under specific conditions.

{% hint style="info" %}
If the connected Stripe account has already been deleted externally (outside of Violet), you can still call this API to clean up the corresponding Violet records. Violet will detect this scenario and complete the deletion successfully.
{% endhint %}

## Requirements for Deletion

A payout account can only be deleted if **both** of these conditions are met:

1. The account has no transactions, payouts, or pending balance
2. The account has not been used to process any orders or payments

## API Reference

### Request

```bash
DELETE /payout_accounts/{payout_account_id}
```

| Field               | Type     | Description                                                     |
| ------------------- | -------- | --------------------------------------------------------------- |
| `payout_account_id` | `string` | The unique identifier of the Merchant Payout Account to delete. |

### Error Responses

| Status | Error Code | Error                                 | Message                                                                                                                           | Reason                                                                                                                                                                                                                                                   |
| ------ | ---------- | ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 404    | 4407       | `payout_account_not_found`            | The Payout Account was not found.                                                                                                 | The payout account specified by the ID does not exist. The ID could be incorrect, or this account may have been deleted.                                                                                                                                 |
| 403    | 9901       | `insufficient_permissions`            | You do not have permission to delete this account.                                                                                | The associated payout account cannot be accessed by your app. This could be because you are trying to delete a payout account associated with a different app.                                                                                           |
| 409    | 4452       | `payout_account_conflict`             | This account cannot be deleted because it has existing payouts, transfers, or distributions.                                      | Once an account has had transactions placed against is, it cannot be deleted. This is to ensure that past transaction data is still accessible to you and the merchants.                                                                                 |
| 500    | 4453       | `external_payment_provider_exception` | An exception was thrown by the payment provider when trying to make this request. Caused by: \[Stripe error details will be here] | If Stripe throws an underlying exception while attempting to delete the account, the error message will include details from that exception. Possible reasons include trying to delete a Stripe Standard account, which you're not authorized to access. |

## Webhooks

After a successful payout account deletion, Violet will emit a webhook: `MERCHANT_PAYOUT_ACCOUNT_DELETED`

```bash
{
  "id": "123456"
}
```

The `id` in any `DELETE` event is the unique Violet identifier of the entity that was deleted. For the `MERCHANT_PAYOUT_ACCOUNT_DELETED` event, this is the Prism Payout Account ID.

You can subscribe to this webhook event to update your internal records accordingly.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.violet.io/prism/payments/payouts/prism-payout-accounts/delete-payout-accounts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
