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
Supported currencies for Virtual accounts are USD, MXN(SPEI) and BRL (Pix)
Parameter | Required | Description |
---|---|---|
customer_id | Yes (only for USD) | The customer for which the virtual account is attached to |
currency | Yes | The currency of the virtual account |
example request
const baseUrl = '<https://api.yativo.com/api/v1/>'; // Replace with the actual base URL
const accessToken = 'YOUR_ACCESS_TOKEN';
const customerId = 'YOUR_CUSTOMER_ID';
const url = `${baseUrl}/business/virtual-account/create`;
const data = {
"currency": "USD", // supported are BRL, MXN,
"customer_id": "xxxxxxxxx-xxxx-xxxx-b8da-xxxxxxxx"
};
const options = {
method: 'POST',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
};
fetch(url, options)
.then(response => {
if (!response.ok) {
throw new Error(`Network response was not ok ${response.statusText}`);
}
return response.json();
})
.then(data => console.log('Response:', data))
.catch(error => console.error('Error:', error));
{
"status": "success",
"status_code": 201,
"message": "Virtual account creation in progress",
"data": {
"account_id": "va_xxxxxx",
"account_number": "xxxxxxxxxx",
"account_type": "savings",
"currency": "USD",
"created_at": "2023-05-27T14:45:00Z"
}
}
to get a list of all virtual accounts make a GET request to
{{base_url}}/api/v1/business/virtual-account
to get a virtual account detail make a GET request with the virtual account ID
{{base_url}}/api/v1/business/virtual-account/show/{{virtual_account_id}}