Create a customer USD virtual account
curl --request POST \
--url https://api.yara.cash/v1/virtual-accounts \
--header 'Content-Type: application/json' \
--header 'X-Idempotency-Key: <x-idempotency-key>' \
--header 'X-Yara-API-Key: <api-key>' \
--data '
{
"customer_id": "5ec10df5-acde-4e95-926c-2174279cf2fd",
"currency": "USD"
}
'import requests
url = "https://api.yara.cash/v1/virtual-accounts"
payload = {
"customer_id": "5ec10df5-acde-4e95-926c-2174279cf2fd",
"currency": "USD"
}
headers = {
"X-Idempotency-Key": "<x-idempotency-key>",
"X-Yara-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Idempotency-Key': '<x-idempotency-key>',
'X-Yara-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({customer_id: '5ec10df5-acde-4e95-926c-2174279cf2fd', currency: 'USD'})
};
fetch('https://api.yara.cash/v1/virtual-accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.yara.cash/v1/virtual-accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customer_id' => '5ec10df5-acde-4e95-926c-2174279cf2fd',
'currency' => 'USD'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Idempotency-Key: <x-idempotency-key>",
"X-Yara-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.yara.cash/v1/virtual-accounts"
payload := strings.NewReader("{\n \"customer_id\": \"5ec10df5-acde-4e95-926c-2174279cf2fd\",\n \"currency\": \"USD\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Idempotency-Key", "<x-idempotency-key>")
req.Header.Add("X-Yara-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.yara.cash/v1/virtual-accounts")
.header("X-Idempotency-Key", "<x-idempotency-key>")
.header("X-Yara-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"5ec10df5-acde-4e95-926c-2174279cf2fd\",\n \"currency\": \"USD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yara.cash/v1/virtual-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Idempotency-Key"] = '<x-idempotency-key>'
request["X-Yara-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_id\": \"5ec10df5-acde-4e95-926c-2174279cf2fd\",\n \"currency\": \"USD\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"created_at": "<string>",
"currency": "USD",
"customer_id": "<string>",
"deposit_instructions": {
"account_number": "<string>",
"account_type": "<string>",
"bank_name": "<string>"
},
"id": "<string>",
"supported_rails": [
"<string>"
],
"updated_at": "<string>"
}
}{
"data": {
"created_at": "<string>",
"currency": "USD",
"customer_id": "<string>",
"deposit_instructions": {
"account_number": "<string>",
"account_type": "<string>",
"bank_name": "<string>"
},
"id": "<string>",
"supported_rails": [
"<string>"
],
"updated_at": "<string>"
}
}{
"data": {
"created_at": "<string>",
"currency": "USD",
"customer_id": "<string>",
"deposit_instructions": {
"account_number": "<string>",
"account_type": "<string>",
"bank_name": "<string>"
},
"id": "<string>",
"supported_rails": [
"<string>"
],
"updated_at": "<string>"
}
}{
"error": {
"code": "validation_error",
"message": "invalid JSON body"
}
}{
"error": {
"code": "validation_error",
"message": "invalid JSON body"
}
}{
"error": {
"code": "validation_error",
"message": "invalid JSON body"
}
}{
"error": {
"code": "validation_error",
"message": "invalid JSON body"
}
}{
"error": {
"code": "validation_error",
"message": "invalid JSON body"
}
}Virtual accounts
Create a customer USD virtual account
Creates or returns the existing live USD virtual account for a Tier-2-verified customer. The response is masked; retrieve the account by ID for full active deposit instructions.
POST
/
v1
/
virtual-accounts
Create a customer USD virtual account
curl --request POST \
--url https://api.yara.cash/v1/virtual-accounts \
--header 'Content-Type: application/json' \
--header 'X-Idempotency-Key: <x-idempotency-key>' \
--header 'X-Yara-API-Key: <api-key>' \
--data '
{
"customer_id": "5ec10df5-acde-4e95-926c-2174279cf2fd",
"currency": "USD"
}
'import requests
url = "https://api.yara.cash/v1/virtual-accounts"
payload = {
"customer_id": "5ec10df5-acde-4e95-926c-2174279cf2fd",
"currency": "USD"
}
headers = {
"X-Idempotency-Key": "<x-idempotency-key>",
"X-Yara-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Idempotency-Key': '<x-idempotency-key>',
'X-Yara-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({customer_id: '5ec10df5-acde-4e95-926c-2174279cf2fd', currency: 'USD'})
};
fetch('https://api.yara.cash/v1/virtual-accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.yara.cash/v1/virtual-accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customer_id' => '5ec10df5-acde-4e95-926c-2174279cf2fd',
'currency' => 'USD'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Idempotency-Key: <x-idempotency-key>",
"X-Yara-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.yara.cash/v1/virtual-accounts"
payload := strings.NewReader("{\n \"customer_id\": \"5ec10df5-acde-4e95-926c-2174279cf2fd\",\n \"currency\": \"USD\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Idempotency-Key", "<x-idempotency-key>")
req.Header.Add("X-Yara-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.yara.cash/v1/virtual-accounts")
.header("X-Idempotency-Key", "<x-idempotency-key>")
.header("X-Yara-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"5ec10df5-acde-4e95-926c-2174279cf2fd\",\n \"currency\": \"USD\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yara.cash/v1/virtual-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Idempotency-Key"] = '<x-idempotency-key>'
request["X-Yara-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_id\": \"5ec10df5-acde-4e95-926c-2174279cf2fd\",\n \"currency\": \"USD\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"created_at": "<string>",
"currency": "USD",
"customer_id": "<string>",
"deposit_instructions": {
"account_number": "<string>",
"account_type": "<string>",
"bank_name": "<string>"
},
"id": "<string>",
"supported_rails": [
"<string>"
],
"updated_at": "<string>"
}
}{
"data": {
"created_at": "<string>",
"currency": "USD",
"customer_id": "<string>",
"deposit_instructions": {
"account_number": "<string>",
"account_type": "<string>",
"bank_name": "<string>"
},
"id": "<string>",
"supported_rails": [
"<string>"
],
"updated_at": "<string>"
}
}{
"data": {
"created_at": "<string>",
"currency": "USD",
"customer_id": "<string>",
"deposit_instructions": {
"account_number": "<string>",
"account_type": "<string>",
"bank_name": "<string>"
},
"id": "<string>",
"supported_rails": [
"<string>"
],
"updated_at": "<string>"
}
}{
"error": {
"code": "validation_error",
"message": "invalid JSON body"
}
}{
"error": {
"code": "validation_error",
"message": "invalid JSON body"
}
}{
"error": {
"code": "validation_error",
"message": "invalid JSON body"
}
}{
"error": {
"code": "validation_error",
"message": "invalid JSON body"
}
}{
"error": {
"code": "validation_error",
"message": "invalid JSON body"
}
}Authorizations
Public merchant API key. You can also send Authorization: ApiKey .
Headers
Idempotency key
Body
application/json
Virtual account creation request
Response
Existing account
Show child attributes
Show child attributes
⌘I