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

# Close Virtual Account

> POST /api/v1/virtual-accounts/{id}/close - Close a virtual account

Close a virtual account for the authenticated tenant.

## Endpoint

```
POST /api/v1/virtual-accounts/{id}/close
```

## Path Parameters

<ParamField path="id" type="string" required>
  Virtual account ID.
</ParamField>

## Request Body

<ParamField body="reason" type="string">
  Optional closure reason. It is forwarded to the internal service path, but it is not currently echoed back in the response body.
</ParamField>

## Response

Returns the updated virtual account object with `status` set to `closed`.

## Example Request

<CodeGroup>
  ```javascript JavaScript theme={null}
  const closedAccount = await client.virtualAccounts.close('va_abc123xyz', {
    reason: 'customer_request'
  });

  console.log(`Account ${closedAccount.accountNumber} closed`);
  console.log(`Status: ${closedAccount.status}`);
  ```

  ```python Python theme={null}
  closed_account = client.virtual_accounts.close(
      'va_abc123xyz',
      reason='customer_request'
  )

  print(f"Account {closed_account.account_number} closed")
  print(f"Status: {closed_account.status}")
  ```

  ```php PHP theme={null}
  $closedAccount = $client->virtualAccounts->close('va_abc123xyz', [
      'reason' => 'customer_request'
  ]);

  echo "Account {$closedAccount->account_number} closed\n";
  echo "Status: {$closedAccount->status}";
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.usezentra.com/api/v1/virtual-accounts/va_abc123xyz/close \
    -H "Authorization: Bearer YOUR_SECRET_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "reason": "customer_request"
    }'
  ```
</CodeGroup>

## Example Response

```json theme={null}
{
  "data": {
    "id": "va_abc123xyz",
    "tenant_id": "tenant_123",
    "customer_id": "cus_1234567890",
    "account_number": "0123456789",
    "account_name": "John Doe",
    "bank_code": "wema-bank",
    "bank_name": "Wema Bank",
    "provider": "paystack_dva",
    "status": "closed",
    "account_type": "standard",
    "total_received_minor": 500000,
    "transaction_count": 5,
    "metadata": {
      "purpose": "collections"
    },
    "expires_at": null,
    "created_at": "2026-03-07T10:30:00Z",
    "updated_at": "2026-03-07T16:00:00Z"
  },
  "meta": {
    "timestamp": "2026-03-07T16:00:00Z",
    "requestId": "req_123"
  }
}
```

## Error Responses

<ResponseExample>
  ```json Account Not Found theme={null}
  {
    "error": {
      "code": "NOT_FOUND",
      "message": "Account not found",
      "details": null
    },
    "meta": {
      "path": "/api/v1/virtual-accounts/va_missing/close",
      "method": "POST"
    }
  }
  ```

  ```json Invalid State theme={null}
  {
    "error": {
      "code": "FAILED_PRECONDITION",
      "message": "Account cannot be closed in its current state",
      "details": null
    },
    "meta": {
      "path": "/api/v1/virtual-accounts/va_abc123xyz/close",
      "method": "POST"
    }
  }
  ```
</ResponseExample>

## Important Notes

<Warning>
  Treat account closure as irreversible in your integration. Do not assume the account can be reopened later.
</Warning>

<Info>
  The current reviewed response returns the updated account record. Fields like `closure_reason` and `closed_at` are not part of the current response contract.
</Info>

## Next Steps

<CardGroup cols={2}>
  <Card title="Create New Account" icon="plus" href="/api-reference/virtual-accounts/create">
    Generate another account
  </Card>

  <Card title="List Accounts" icon="list" href="/api-reference/virtual-accounts/list">
    Review existing accounts
  </Card>
</CardGroup>
