> 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.

# Modify a Virtual Account

PUT https://tts.sandbox.apib2b.citi.com/citiconnect/sb/receivablesservices/v1/virtualaccounts
Content-Type: application/json

This endpoint allows you to modify existing accounts or reopen previously closed virtual accounts. You can modify the account's description, tax ID, address as well as specify whether the virtual account will allow credits or debits to post.

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

## 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.

### Headers

- `Authorization` (string, required) — The OAuth Token prefixed with "Bearer" and space in between.

### Body (application/json)

This endpoint expects an UpdateVirtualAccounts.

- `action` (enum, required) — Type of action that will be applied to virtual account. Actions that can be chosen are: - CreditDebitPreferences- Reopen- Modify
  - Allowed values: `CreditDebitPreferences`, `Reopen`, `Modify`
- `branch_code` (string, required)
- `virtual_account_number` (string, required) — specifies the virtual account that has to be updated.
- `account_description` (string, optional) — Description for the previously mentioned virtual account. This parameter is conditional if the action = 'Modify'.
- `address` (AddressDetails, optional) — Address Details of the entity to which the previously mentioned Virtual Account is assigned to. This parameter is conditionally mandatory only for action = 'Modify'.
- `credit_debit_preferences` (CreditDebitPreference, optional)
- `tax_payer_id` (string, optional) — Tax payer ID to which entity the previously mentioned virtual account is assigned to.This parameter is mandatory only when the action = 'Modify'.

## 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

### 415 Unsupported Media Type Error

Unsupported Media Type

- `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

### AddressDetails

Address Details of the entity to which the previously mentioned Virtual Account is assigned to. This parameter is conditionally mandatory only for action = 'Modify'.

- `address_line_1` (string, optional) — AddressLine-1 is to be provided by client, Information that locates and identifies a specific address, as defined by postal services, presented in free-form text.
- `address_line_2` (string, optional) — AddressLine-2 is to be provided by client, Information that locates and identifies a specific address, as defined by postal services, presented in free-form text.
- `address_line_3` (string, optional) — AddressLine-3 is to be provided by client, Information that locates and identifies a specific address, as defined by postal services, presented in free-form text.
- `address_line_4` (string, optional) — AddressLine-4 is to be provided by client, Information that locates and identifies a specific address, as defined by postal services, presented in free-form text.

### CreditDebitPreference

- `disallow_credit` (string, optional) — Indicative parameter as No 'N' or Yes 'Y' to disallow or Allow Credit posting for the previously mentioned Virtual Account
- `disallow_debit` (string, optional) — Indicative parameter as No 'N' or Yes 'Y' to disallow or Allow Debit posting for the previously mentioned Virtual Account

### ErrorDetail

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

## Examples

**Request**

```json
{
  "action": "CreditDebitPreferences",
  "branch_code": "string",
  "virtual_account_number": "string"
}
```

**Response**

```json
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><VirtualAccountResponse><RequestId>48021193-989b-4722-8a97-f9b3ee272683</RequestId><Status>success</Status><Message>Request accepted Successfully</Message></VirtualAccountResponse>"
```

**SDK Code**

```python updateVirtualAccounts_example (application/xml)
import requests

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

payload = {
    "action": "CreditDebitPreferences",
    "branch_code": "string",
    "virtual_account_number": "string"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript updateVirtualAccounts_example (application/xml)
const url = 'https://tts.sandbox.apib2b.citi.com/citiconnect/sb/receivablesservices/v1/virtualaccounts';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"action":"CreditDebitPreferences","branch_code":"string","virtual_account_number":"string"}'
};

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

```go updateVirtualAccounts_example (application/xml)
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"action\": \"CreditDebitPreferences\",\n  \"branch_code\": \"string\",\n  \"virtual_account_number\": \"string\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby updateVirtualAccounts_example (application/xml)
require 'uri'
require 'net/http'

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

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"action\": \"CreditDebitPreferences\",\n  \"branch_code\": \"string\",\n  \"virtual_account_number\": \"string\"\n}"

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

```java updateVirtualAccounts_example (application/xml)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://tts.sandbox.apib2b.citi.com/citiconnect/sb/receivablesservices/v1/virtualaccounts")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"action\": \"CreditDebitPreferences\",\n  \"branch_code\": \"string\",\n  \"virtual_account_number\": \"string\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://tts.sandbox.apib2b.citi.com/citiconnect/sb/receivablesservices/v1/virtualaccounts', [
  'body' => '{
  "action": "CreditDebitPreferences",
  "branch_code": "string",
  "virtual_account_number": "string"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp updateVirtualAccounts_example (application/xml)
using RestSharp;

var client = new RestClient("https://tts.sandbox.apib2b.citi.com/citiconnect/sb/receivablesservices/v1/virtualaccounts");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"action\": \"CreditDebitPreferences\",\n  \"branch_code\": \"string\",\n  \"virtual_account_number\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift updateVirtualAccounts_example (application/xml)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "action": "CreditDebitPreferences",
  "branch_code": "string",
  "virtual_account_number": "string"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://tts.sandbox.apib2b.citi.com/citiconnect/sb/receivablesservices/v1/virtualaccounts")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```