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

# View a virtual account

GET https://sandbox.currenciesdirect.com/v1/customers/{customer_id}/virtual-accounts/{vban_number}

Get virtual account details. You can query by virtual bank account number (path parameter), currency (query parameter), or unique reference (query parameter).

**Authentication:** [Bearer token required](/api-guide/getting-started/authentication#oauth-20-authentication)


Reference: https://docs.redpincompany.com/api-reference/customers/api-integration/virtual-accounts/get-virtual-account-by-vban

## Authentication

- `Authorization` header (bearer token, required) — OAuth 2.0 Bearer token authentication. This API uses OAuth 2.0 Client Credentials flow. Please refer to the [Authentication](/api-guide/getting-started/authentication#oauth-20-authentication) section for detailed information on how to obtain and use your OAuth credentials.

## Servers

- `https://sandbox.currenciesdirect.com` (Sandbox, default)
- `https://api.redpincompany.com` (Production)

## Request

### Path parameters

- `customer_id` (string, required) — Unique Customer Identifier
- `vban_number` (string, required) — Virtual bank account number. Alternatively, you can query by currency or unique-ref using query parameters on the base endpoint `/v1/customers/{customer_id}/virtual-accounts`.

### Query parameters

- `currency` (string, optional) — Three-letter currency code (as specified by [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)). Use this query parameter to filter virtual accounts by currency.
- `unique-ref` (string, optional) — Unique reference identifier for the virtual account. Use this query parameter to retrieve a specific virtual account by its unique reference.

## Response

### 200

OK

- `customer_id` (string, required) — Customer number.
- `customer_name` (string, required) — Name of the customer.
- `virtual_account_details` (list of VirtualAccountDetails, required) — Array of virtual accounts.

## Errors

### 400 Bad Request Error

Bad request - invalid parameters

- `code` (string, required)
- `description` (string, required) — Human-readable error description
- `type` (enum, optional) — Category or type of the error. - `VALIDATION_ERROR`: Error due to invalid input data or format - `AUTHORIZATION_ERROR`: Error related to insufficient permissions - `SYSTEM_ERROR`: Internal system or server errors - `RESOURCE_ERROR`: Error related to resource availability - `BUSINESS_ERROR`: Error related to business logic violations - `DATA_ERROR`: Error related to data inconsistencies or duplication
  - Allowed values: `VALIDATION_ERROR`, `AUTHORIZATION_ERROR`, `SYSTEM_ERROR`, `RESOURCE_ERROR`, `BUSINESS_ERROR`, `DATA_ERROR`
- `field` (string, optional)
- `details` (map from string to any, optional) — Additional details about the error
- `timestamp` (datetime, optional)

### 401 Unauthorized Error

Unauthorized - invalid authorization header

- `code` (string, required)
- `description` (string, required) — Human-readable error description
- `type` (enum, optional) — Category or type of the error. - `VALIDATION_ERROR`: Error due to invalid input data or format - `AUTHORIZATION_ERROR`: Error related to insufficient permissions - `SYSTEM_ERROR`: Internal system or server errors - `RESOURCE_ERROR`: Error related to resource availability - `BUSINESS_ERROR`: Error related to business logic violations - `DATA_ERROR`: Error related to data inconsistencies or duplication
  - Allowed values: `VALIDATION_ERROR`, `AUTHORIZATION_ERROR`, `SYSTEM_ERROR`, `RESOURCE_ERROR`, `BUSINESS_ERROR`, `DATA_ERROR`
- `field` (string, optional)
- `details` (map from string to any, optional) — Additional details about the error
- `timestamp` (datetime, optional)

### 404 Not Found Error

Virtual account not found

- `code` (string, required)
- `description` (string, required) — Human-readable error description
- `type` (enum, optional) — Category or type of the error. - `VALIDATION_ERROR`: Error due to invalid input data or format - `AUTHORIZATION_ERROR`: Error related to insufficient permissions - `SYSTEM_ERROR`: Internal system or server errors - `RESOURCE_ERROR`: Error related to resource availability - `BUSINESS_ERROR`: Error related to business logic violations - `DATA_ERROR`: Error related to data inconsistencies or duplication
  - Allowed values: `VALIDATION_ERROR`, `AUTHORIZATION_ERROR`, `SYSTEM_ERROR`, `RESOURCE_ERROR`, `BUSINESS_ERROR`, `DATA_ERROR`
- `field` (string, optional)
- `details` (map from string to any, optional) — Additional details about the error
- `timestamp` (datetime, optional)

### 500 Internal Server Error

Internal Server Error

- `code` (string, required)
- `description` (string, required) — Human-readable error description
- `type` (enum, optional) — Category or type of the error. - `VALIDATION_ERROR`: Error due to invalid input data or format - `AUTHORIZATION_ERROR`: Error related to insufficient permissions - `SYSTEM_ERROR`: Internal system or server errors - `RESOURCE_ERROR`: Error related to resource availability - `BUSINESS_ERROR`: Error related to business logic violations - `DATA_ERROR`: Error related to data inconsistencies or duplication
  - Allowed values: `VALIDATION_ERROR`, `AUTHORIZATION_ERROR`, `SYSTEM_ERROR`, `RESOURCE_ERROR`, `BUSINESS_ERROR`, `DATA_ERROR`
- `field` (string, optional)
- `details` (map from string to any, optional) — Additional details about the error
- `timestamp` (datetime, optional)

## Types

### VirtualAccountDetails

- `virtual_account_number` (string, required) — Account number of customer's virtual account.
- `virtual_account_type` (string, required) — Type of customer's virtual account.
- `financial_institution_name` (string, required) — Name of bank/financial institution.
- `address` (string, required) — Address of bank/financial institution.
- `status` (string, required) — Status of virtual account.
- `currency` (string, required) — Currency of virtual account in [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) three-letter format (e.g., USD, GBP).
- `country` (string, required) — Country of virtual account in [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format (e.g., USA, GBR).
- `country_specific_code` (string, optional) — Code of bank/financial institution.
- `country_specific_type` (string, optional) — Type of bank/financial institution's code.
- `country_specific_method` (string, optional) — Method/network to be used for money transfer.
- `country_specific_code2` (string, optional) — Second code of bank/financial institution.
- `country_specific_type2` (string, optional) — Type of bank/financial institution's second code.
- `country_specific_method2` (string, optional) — Method/network to be used for money transfer using second code.

## Examples

**Response**

```json
{
  "customer_id": "0201001008235975",
  "customer_name": "Mustafa Balistreri",
  "virtual_account_details": [
    {
      "virtual_account_number": "26957617",
      "virtual_account_type": "Checking",
      "financial_institution_name": "Currencies Direct Limited",
      "address": "One Canada Square Canary Wharf E14 5AA",
      "status": "ACTIVE",
      "currency": "GBP",
      "country": "GBR",
      "country_specific_code": "230124",
      "country_specific_type": "SORT CODE",
      "country_specific_method": "FPS",
      "country_specific_code2": "GB10CDPN23012426957617",
      "country_specific_type2": "IBAN",
      "country_specific_method2": "CHAPS"
    }
  ]
}
```

**SDK Code**

```shell cURL (by vbanNumber)
curl -X GET https://sandbox.currenciesdirect.com/v1/customers/{customerId}/virtual-accounts/{vbanNumber} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

```

```shell cURL (by currency)
curl -X GET https://sandbox.currenciesdirect.com/v1/customers/{customerId}/virtual-accounts?currency={currency} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

```

```shell cURL (by unique-ref)
curl -X GET https://sandbox.currenciesdirect.com/v1/customers/{customerId}/virtual-accounts?unique-ref={uniqueRefence} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

```

```python Virtual account details
import requests

url = "https://sandbox.currenciesdirect.com/v1/customers/cust_123456789/virtual-accounts/123456000000049"

querystring = {"currency":"GBP","unique-ref":"6d23072a-ac3e-4146-9b83-7ad384d65707"}

headers = {"Authorization": "Bearer <token>"}

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

print(response.json())
```

```javascript Virtual account details
const url = 'https://sandbox.currenciesdirect.com/v1/customers/cust_123456789/virtual-accounts/123456000000049?currency=GBP&unique-ref=6d23072a-ac3e-4146-9b83-7ad384d65707';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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

```go Virtual account details
package main

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

func main() {

	url := "https://sandbox.currenciesdirect.com/v1/customers/cust_123456789/virtual-accounts/123456000000049?currency=GBP&unique-ref=6d23072a-ac3e-4146-9b83-7ad384d65707"

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

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

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

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

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

}
```

```ruby Virtual account details
require 'uri'
require 'net/http'

url = URI("https://sandbox.currenciesdirect.com/v1/customers/cust_123456789/virtual-accounts/123456000000049?currency=GBP&unique-ref=6d23072a-ac3e-4146-9b83-7ad384d65707")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

```java Virtual account details
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://sandbox.currenciesdirect.com/v1/customers/cust_123456789/virtual-accounts/123456000000049?currency=GBP&unique-ref=6d23072a-ac3e-4146-9b83-7ad384d65707")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://sandbox.currenciesdirect.com/v1/customers/cust_123456789/virtual-accounts/123456000000049?currency=GBP&unique-ref=6d23072a-ac3e-4146-9b83-7ad384d65707', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp Virtual account details
using RestSharp;

var client = new RestClient("https://sandbox.currenciesdirect.com/v1/customers/cust_123456789/virtual-accounts/123456000000049?currency=GBP&unique-ref=6d23072a-ac3e-4146-9b83-7ad384d65707");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Virtual account details
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.currenciesdirect.com/v1/customers/cust_123456789/virtual-accounts/123456000000049?currency=GBP&unique-ref=6d23072a-ac3e-4146-9b83-7ad384d65707")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
```