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

Supported currencies for Standard Virtual accounts are USDBASE, EURBASE, USD (Deprecated), EUR (Deprecated), EURDE, MXN(SPEI), MXNBASE (SPEI), MXNUSD (SPEI) and BRL (Pix). For enterprise plus virtual accounts, contact your integration assistant.

Parameter Required Description
customer_id Yes 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));

example response

{
    "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"
    }
}

List all Virtual Accounts

to get a list of all virtual accounts make a GET request to

{{base_url}}/api/v1/business/virtual-account

Get a single 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}}

DELETE Virtual Account