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

# Deactivate a Virtual Account

> Stop a reserved virtual account from receiving further payments.

Deactivate a reserved account so it stops accepting payments. BillStack marks the account inactive on our side **and** instructs the underlying bank provider to stop it, so transfers into the account are no longer accepted.

## Endpoint

```http theme={null}
POST https://api.billstack.co/v2/thirdparty/deactivateVirtualAccount/
```

<ParamField header="Authorization" type="string" required>
  Your secret key as a Bearer token: `Bearer Bill_Stack-SEC-KEY-…`
</ParamField>

<ParamField header="Content-Type" type="string" required>
  `application/json`
</ParamField>

## Body parameters

Provide **one** of the following to identify the account:

<ParamField body="reference" type="string">
  The merchant reference you supplied when creating the account.
</ParamField>

<ParamField body="email" type="string">
  The customer's email address.
</ParamField>

<ParamField body="bank" type="string">
  Optional. The specific provider to deactivate (`9PSB`, `SAFEHAVEN`, `PROVIDUS`, or `PALMPAY`). If a customer holds accounts with more than one bank and you omit `bank`, all of their accounts are deactivated.
</ParamField>

## Request

```bash theme={null}
curl -X POST https://api.billstack.co/v2/thirdparty/deactivateVirtualAccount/ \
  -H "Authorization: Bearer Bill_Stack-SEC-KEY-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "reference": "order_12345"
  }'
```

## Response

```json theme={null}
{
  "status": true,
  "message": "Account deactivated",
  "data": {
    "reference": "R-XXXXXXXXXXX",
    "merchant_reference": "order_12345",
    "customer": "customer@example.com",
    "deactivated": [
      {
        "account_number": "0000000000",
        "bank_id": "9PSB",
        "status": "INACTIVE",
        "provider_stopped": true
      }
    ]
  }
}
```

### Response fields

| Field                                 | Description                                                                                                                                                    |
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `data.reference`                      | The BillStack reference for the reserved account.                                                                                                              |
| `data.merchant_reference`             | The reference you supplied at creation.                                                                                                                        |
| `data.customer`                       | The customer email the account belongs to.                                                                                                                     |
| `data.deactivated`                    | The provider account(s) that were deactivated. Each entry has its `account_number`, `bank_id`, the new `status` (`INACTIVE`), and `provider_stopped`.          |
| `data.deactivated[].provider_stopped` | `true` if the underlying bank confirmed the account was stopped. `false` means the account is marked inactive in BillStack but the bank stop is still pending. |

<Note>
  The account is marked `INACTIVE` in BillStack as soon as you call this endpoint. `provider_stopped` tells you whether the bank itself has also confirmed the stop.
</Note>

<Warning>
  Deactivation is intended to be permanent for that account. Any transfer a customer attempts into a deactivated account afterwards will be rejected by the bank. To collect from the same customer again, create a new virtual account.
</Warning>
