> This page is for Enterprise.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://citi-demo.ferndocs.com/enterprise/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://citi-demo.ferndocs.com/enterprise/_mcp/server.

# Delete a Virtual Account

DELETE https://tts.sandbox.apib2b.citi.com/citiconnect/sb/receivablesservices/v1/virtualaccounts

This endpoint allows you to delete an active virtual account.

Reference: https://citi-demo.ferndocs.com/enterprise/enterprises/api-reference/account-services/virtual-accounts-api/virtual-accounts-single-entity/delete-virtual-account

## Authentication

- `Authorization` header (bearer token, required) — All CitiConnect APIs use the oAuth2 authentication scheme, which requires a bearer token to authenticate your API call. The Token URL includes the version of authentication used by this API. See the Citi Authentication API reference for information on requesting a token.

## Request

### Query parameters

- `client_id` (string, required) — This is your unique identifier shared during your CitiConnect API onboarding. This is the same `client_id` used for OAuth token generation.
- `branch_code` (string, required) — Citi internal branch code associated with a virtual account number.

### Headers

- `Authorization` (string, required) — The OAuth token prefixed with "Bearer" and a space in between.
- `encrypted-params` (string, required) — Indicates the virtual account number that must be for status inquiries updates and deletions. \<br />Sample message before encryption - \{"virtual\_account\_number":"09834572"}

## Response

### 202

Accepted

- `message` (string, required) — Detailed response description for given request.
- `request_id` (string, required) — Auto-generated unique identification assigned for the request.
- `status` (string, required) — Status of the request.

## Errors

### 400 Bad Request Error

Bad Request

- `code` (string, optional) — The code which categorize the https error, to compile recognize at application, i.e. CC00003,CC00004,CC00005 etc
- `error_details` (list of ErrorDetail, optional)
- `message` (string, optional) — message for error
- `ref_id` (string, optional) — unique reference ID for a particular request
- `status` (string, optional) — https status code

### 401 Unauthorized Error

Unauthorized

- `code` (string, optional) — The code which categorize the https error, to compile recognize at application, i.e. CC00003,CC00004,CC00005 etc
- `error_details` (list of ErrorDetail, optional)
- `message` (string, optional) — message for error
- `ref_id` (string, optional) — unique reference ID for a particular request
- `status` (string, optional) — https status code

### 405 Method Not Allowed Error

Method Not Allowed

- `code` (string, optional) — The code which categorize the https error, to compile recognize at application, i.e. CC00003,CC00004,CC00005 etc
- `error_details` (list of ErrorDetail, optional)
- `message` (string, optional) — message for error
- `ref_id` (string, optional) — unique reference ID for a particular request
- `status` (string, optional) — https status code

### 500 Internal Server Error

Internal Server Error

- `code` (string, optional) — The code which categorize the https error, to compile recognize at application, i.e. CC00003,CC00004,CC00005 etc
- `error_details` (list of ErrorDetail, optional)
- `message` (string, optional) — message for error
- `ref_id` (string, optional) — unique reference ID for a particular request
- `status` (string, optional) — https status code

## Types

### ErrorDetail

- `action` (string, optional) — corrective action to be taken to resolve above issue
- `issue` (string, optional) — more details about the issue

## Examples

**Response**

```json
{
  "message": "string",
  "request_id": "string",
  "status": "string"
}
```

**SDK Code**

```python
import requests

url = "https://tts.sandbox.apib2b.citi.com/citiconnect/sb/receivablesservices/v1/virtualaccounts"

querystring = {"branch_code":"branch_code","client_id":"client_id"}

headers = {
    "Authorization": "Bearer <token>",
    "encrypted-params": "encrypted-params"
}

response = requests.delete(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://tts.sandbox.apib2b.citi.com/citiconnect/sb/receivablesservices/v1/virtualaccounts?branch_code=branch_code&client_id=client_id';
const options = {
  method: 'DELETE',
  headers: {Authorization: 'Bearer <token>', 'encrypted-params': 'encrypted-params'}
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://tts.sandbox.apib2b.citi.com/citiconnect/sb/receivablesservices/v1/virtualaccounts?branch_code=branch_code&client_id=client_id"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("encrypted-params", "encrypted-params")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://tts.sandbox.apib2b.citi.com/citiconnect/sb/receivablesservices/v1/virtualaccounts?branch_code=branch_code&client_id=client_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["encrypted-params"] = 'encrypted-params'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://tts.sandbox.apib2b.citi.com/citiconnect/sb/receivablesservices/v1/virtualaccounts?branch_code=branch_code&client_id=client_id")
  .header("Authorization", "Bearer <token>")
  .header("encrypted-params", "encrypted-params")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://tts.sandbox.apib2b.citi.com/citiconnect/sb/receivablesservices/v1/virtualaccounts?branch_code=branch_code&client_id=client_id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'encrypted-params' => 'encrypted-params',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://tts.sandbox.apib2b.citi.com/citiconnect/sb/receivablesservices/v1/virtualaccounts?branch_code=branch_code&client_id=client_id");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("encrypted-params", "encrypted-params");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "encrypted-params": "encrypted-params"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://tts.sandbox.apib2b.citi.com/citiconnect/sb/receivablesservices/v1/virtualaccounts?branch_code=branch_code&client_id=client_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```