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.

Each customer can have only 1 Virtual account per currency.

Supported currencies for Virtual accounts are USD, MXN(SPEI), MXNBASE (SPEI), MXNUSD (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

Create virtual account (fetch)
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

201 Created — 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:

GET {{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:

GET {{base_url}}/api/v1/business/virtual-account/show/{{virtual_account_id}}


DELETE Virtual Account

Endpoint:

DELETE {{baseUrl}}/api/v1/business/virtual-account/delete-virtual-account/{{virtual_account_id}}


GET Virtual Account Transaction History

Endpoint:

POST {{baseUrl}}/business/virtual-account/history/{{accountNumber}}