Create VIrtual Accounts

Create virtual account

POST {{baseUrl}}/business/virtual-account/create

This endpoint allows you to create a virtual account that can be used to receive funds.

KYC must have been completed by the customer before this can be enabled.

Each customer can have only 1 Virtual account per currency

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description

customer_id

number

Customer ID

currency

string

USD, MXN, BRL

Response

{
    "status": "success",
    "status_code": 201,
    "message": "Virtual account creation in progress",
    "data": {
        "account_id": "va_67890",
        "account_number": "9876543210",
        "account_type": "savings",
        "currency": "USD",
        "created_at": "2023-05-27T14:45:00Z"
    }
}

Request Example

<?php
$baseUrl = 'https://sandbox.yativo.com'; // Replace with the actual base URL
$accessToken = 'YOUR_ACCESS_TOKEN';
$customerId = 'YOUR_CUSTOMER_ID';

$url = $baseUrl . '/example-endpoint';

$data = [
    "currency": "USD", // supported are BRL, MXN,
    "customer_id": "ae68f0ef-0e59-4a23-b8da-9e07bf2af361"
    ];

$options = [
    'http' => [
        'header'  => "Authorization: Bearer $accessToken\r\n" .
                     "Content-Type: application/json\r\n",
        'method'  => 'POST',
        'content' => json_encode($data)
    ]
];

$context  = stream_context_create($options);
$response = file_get_contents($url, false, $context);

if ($response === FALSE) {
    die('Error occurred');
}

$responseData = json_decode($response, true);
print_r($responseData);
?>

Last updated