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

# Close Wallet

> This endpoint closes a wallet

`DELETE {{baseurl}}/virtual-accounts/{{walletId}}`

<Tabs>
  <Tab title="Staging">
    ```
       https://gw.stg.girostack.com/v1
    ```
  </Tab>

  <Tab title="Production">
    ```
       https://gw.prod.girostack.com/v1
    ```
  </Tab>
</Tabs>

<Card title="Headers">
  <ParamField body="x-giro-key" type="string" required>
    Pass your account's secret key as the value.
  </ParamField>
</Card>

<Card title="Path Params">
  <ParamField path="walletId" type="string">
    This is your wallet's publicId.
  </ParamField>
</Card>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request DELETE '{{API_BASE_URL}}/virtual-accounts/3bf02992-a9de-41dd-9cb1-243324567811' \
  --header 'x-giro-key: {{SECRET_KEY}}' \
  --header 'Content-Type: application/json'
  ```

  ```javascript Node.JS theme={null}
  const fetch = require("node-fetch");

  const url = '{{API_BASE_URL}}/virtual-accounts/3bf02992-a9de-41dd-9cb1-243324567811';
  const headers = {
    'x-giro-key': '{{SECRET_KEY}}',
    'Content-Type': 'application/json'
  };

  fetch(url, {
    method: 'DELETE',
    headers: headers
  })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
  ```

  ```php PHP theme={null}
  <?php
  $curl = curl_init();

  curl_setopt_array($curl, array(
    CURLOPT_URL => '{{API_BASE_URL}}/virtual-accounts/3bf02992-a9de-41dd-9cb1-243324567811',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => array(
      'x-giro-key: {{SECRET_KEY}}',
      'Content-Type: application/json'
    )
  ));

  $response = curl_exec($curl);
  $httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE);

  if (curl_errno($curl)) {
    echo 'Error: ' . curl_error($curl);
  } else {
    echo "Response Code: $httpcode\n";
    echo $response;
  }

  curl_close($curl);
  ?>
  ```
</RequestExample>

<ResponseExample>
  ```json 201 OK theme={null}
  {
      "meta": {
          "statusCode": 200,
          "success": true,
          "message": "VirtualAccount successfully deleted"
      },
      "data": {
          "publicId": "vba-e7571cbc-8cea-4a8c-9dd5-4eeb788a3a35",
          "accountNumber": "4248018748"
      }
  }
  ```

  ```json 404 Not Found theme={null}
  {
      "meta": {
          "statusCode": 404,
          "error": {
              "statusCode": 404,
              "message": "Resource doesnt exist"
          }
      }
  }
  ```
</ResponseExample>
