Download OpenAPI specification:Download
The VirtuaBroker API documentation to interact with the platform. This API allows you to create orders, get balances, create deposits, and more. The API is secured with OAuth2.0.
To access the API, you must authenticate using OAuth2.0. The access token can be obtained by making a POST request to the following URL:
https://auth2.virtuabroker.com/realms/cryptobot/protocol/openid-connect/token
application/x-www-form-urlencoded
client_id
: Your client identifier (provided by VirtuaBroker)username
: Your account's username (provided by VirtuaBroker)password
: Your account's password (provided by VirtuaBroker)grant_type
: Use password
as the grant typeUpon successful authentication, you will receive an access_token
which must be included in the Authorization header as a Bearer token for all subsequent API calls.
Here's a simple example of how to request an access token using Node.js and axios:
import axios from 'axios';
import qs from 'qs';
const authUrl = 'https://auth2.virtuabroker.com/realms/cryptobot/protocol/openid-connect/token';
const clientId = 'your-client-id';
const username = 'your-username';
const password = 'your-password';
const requestToken = async () => {
const requestBody = qs.stringify({
client_id: clientId,
username,
password,
grant_type: 'password'
});
try {
const response = await axios.post(authUrl, requestBody, {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
});
const accessToken = response.data.access_token;
console.log('Access Token:', accessToken);
return accessToken;
} catch (error) {
console.error('Failed to fetch token', error);
throw error;
}
};
For integration purposes, VirtuaBroker provides a staging environment at:
https://api-stage.virtuabroker.com
Here, you can simulate various operations such as deposits and trades. For example, to simulate a deposit and trigger the associated webhook, you can use the following endpoint:
POST https://simulateincomingtransfer-kmygxkfbpq-ew.a.run.app
{
"amount": 60,
"reference": "unique-reference"
}
This will simulate a deposit of 60 units and trigger your configured webhook.
If you are interested in integrating with the VirtuaBroker platform or need specific credentials for authentication, please contact our support team at daniel@virtuabroker.com. We are here to assist you with any questions or issues you may encounter during the integration process.
This endpoint receives and processes webhook events related to deposits, trades, withdrawals, and order status updates. The event data is logged, and a confirmation response is returned.
type required | string Enum: "deposit_completed" "deposit_partially_completed" "trade_completed" "withdrawal_completed" "order_status_updated" |
id required | string ID of the webhook event |
api_version required | string API version of the webhook event |
apiKey required | string Provided API key by you so we can authenticate incoming requests coming to your webhook endpoint |
required | object or object or object or object Data associated with the webhook event |
{- "type": "deposit_partially_completed",
- "id": "evt_123456",
- "api_version": "v1",
- "apiKey": "xxx",
- "data": {
- "depositId": "deposit-123",
- "userData": {
- "firstName": "John",
- "lastName": "Doe",
- "userEmail": "user@virtuabroker.com",
- "address": "123 Main St, Anytown, ES",
- "taxId": "123-45-6789",
- "country": "ES",
- "kycId": "kyc-12345"
}, - "createdAt": 1723027132,
- "expectedAmount": 1000,
- "amount": 1000,
- "currency": "EUR",
- "depositType": "SEPA",
- "fee": 10,
- "expectedFee": 10,
- "feeCurrency": "EUR",
- "status": "Success",
- "depositInfo": {
- "accountHolder": "John Doe",
- "iban": "DE8937XXXXXXXXXXXX3000",
- "bic": "COBADEFFXXX",
- "bankName": "Commerzbank",
- "bankAddress": "Mainzer Landstrasse 151-153",
- "bankCity": "Frankfurt",
- "bankZipcode": "60327",
- "bankCountry": "DE",
- "amount": 1000,
- "referenceCode": "ABC123"
}
}
}
This endpoint creates new quotes for specified pairs.
userEmail | string <email> The email of the user making the quote |
originCurrency required | string Value: "EUR" The currency code of the origin currency |
originNetwork | string Enum: "MATIC" "ETH" "CELO" "TRON" The network of the origin currency if it is crypto |
originAmount | number > 0 The amount in the origin currency |
destinationCurrency required | string Enum: "BRL" "COP" "VES" "MXN" "ARS" "USD" "USDC" "USDT" "ETH" "BTC" "PLASTIK" "POL" "SOL" "DOGE" "ADA" "XRP" "NEAR" "PEPE" "LINK" "AVAX" "DOT" "SHIB" "ALGO" "TRX" "GIGA" "FLOKI" "KAVA" The currency code of the destination currency |
destinationNetwork | string Enum: "MATIC" "ETH" "CELO" "TRON" The network of the destination currency if it is crypto |
destinationAmount | number > 0 The amount in the destination currency |
destinationTransferMethod | string Enum: "virtuabroker" "cryptoWallet" "bankDepositBR" "pixDepositBR" "bankDepositMX" "debitCardMX" "mobileNumberMX" "bankDepositAR" "bankDepositVEN" "phonePaymentVEN" "bankDepositCOL" "wireUS" The end user destination transfer method used for transferring to the destination. This field is only used when there is a userEmail being used in the request. This field also requires the destinationTransferData to be present in order to work as expected. |
destinationTransferData | any or null The details required for the end user destination transfer method. This field is only used when there is a userEmail being used in the request. This field also requires the destinationTransferMethod to be present in order to work as expected. |
locale | string Enum: "en" "es" "pt" "it" "fr" "de" The locale of the user |
discountCode | string The discount code to apply |
{- "userEmail": "user@example.com",
- "originCurrency": "EUR",
- "originNetwork": "MATIC",
- "originAmount": 100,
- "destinationCurrency": "BRL",
- "destinationNetwork": "MATIC",
- "destinationAmount": 85,
- "destinationTransferMethod": "bankDepositBR",
- "destinationTransferData": null,
- "locale": "en",
- "discountCode": "string"
}
{- "quoteId": "123e4567-e89b-12d3-a456-426614174000",
- "originCurrency": "EUR",
- "originNetwork": "MATIC",
- "originAmount": 100,
- "destinationCurrency": "BRL",
- "destinationNetwork": "MATIC",
- "destinationAmount": 85,
- "price": 0.85,
- "fee": 1.5,
- "expectedGasFee": 1.5,
- "feeCurrency": "EUR",
- "expireAt": 1694291200
}
This endpoint returns the balances for different currencies associated with a user. The user can optionally filter by a specific currency or email.
currency | string Value: "EUR" Examples: currency=EUR Currency code to filter the balances |
userEmail | string <email> Examples: userEmail=user@virtuabroker.com userEmail=john.doe@example.com userEmail=alice@crypto.io User email to filter the balances |
{- "balances": [
- {
- "currency": "EUR",
- "balance": 100
}
]
}
This endpoint creates a new deposit request.
required | object User data for the deposit |
amount required | number > 0 Amount to be deposited |
currency required | string Value: "EUR" Currency of the deposit |
network | string Enum: "MATIC" "ETH" "CELO" "TRON" Network for the deposit for crypto deposits |
{- "userData": {
- "firstName": "John",
- "lastName": "Doe",
- "userEmail": "user@virtuabroker.com",
- "address": "123 Main St, Anytown, ES",
- "taxId": "123-45-6789",
- "country": "ES",
- "kycId": "kyc-12345"
}, - "amount": 100,
- "currency": "EUR",
- "network": "ETH"
}
{- "depositId": "01CLFXMT67II",
- "userData": {
- "firstName": "John",
- "lastName": "Doe",
- "userEmail": "user@virtuabroker.com",
- "address": "123 Main St, Anytown, ES",
- "taxId": "123-45-6789",
- "country": "ES",
- "kycId": "kyc-12345"
}, - "createdAt": 1723027132,
- "expectedAmount": 1000,
- "amount": 1000,
- "currency": "EUR",
- "depositType": "SEPA",
- "fee": 10,
- "expectedFee": 10,
- "feeCurrency": "EUR",
- "status": "Success",
- "depositInfo": {
- "accountHolder": "John Doe",
- "iban": "DE8937XXXXXXXXXXXX3000",
- "bic": "COBADEFFXXX",
- "bankName": "Commerzbank",
- "bankAddress": "Mainzer Landstrasse 151-153",
- "bankCity": "Frankfurt",
- "bankZipcode": "60327",
- "bankCountry": "DE",
- "amount": 1000,
- "referenceCode": "ABC123"
}
}
This endpoint retrieves a list of deposits based on various filters.
currency | string Value: "EUR" Examples: currency=EUR Optional currency code to filter the deposits |
minAmount | number >= 0 |
maxAmount | number >= 0 |
from | integer >= 0 |
to | integer >= 0 |
userEmail | string <email> Example: userEmail=user@example.com Email of the user making the request |
limit | number >= 0 |
page | number >= 0 |
status | string Enum: "Pending" "PendingCancel" "Canceled" "Received" "Success" "Failed" Examples: status=Pending status=Success status=Failed status=Received Optional status to filter orders |
[- {
- "depositId": "01CLFXMT67II",
- "userData": {
- "firstName": "John",
- "lastName": "Doe",
- "userEmail": "user@virtuabroker.com",
- "address": "123 Main St, Anytown, ES",
- "taxId": "123-45-6789",
- "country": "ES",
- "kycId": "kyc-12345"
}, - "createdAt": 1723027132,
- "expectedAmount": 1000,
- "amount": 1000,
- "currency": "EUR",
- "depositType": "SEPA",
- "fee": 10,
- "expectedFee": 10,
- "feeCurrency": "EUR",
- "status": "Success",
- "depositInfo": {
- "accountHolder": "John Doe",
- "iban": "DE8937XXXXXXXXXXXX3000",
- "bic": "COBADEFFXXX",
- "bankName": "Commerzbank",
- "bankAddress": "Mainzer Landstrasse 151-153",
- "bankCity": "Frankfurt",
- "bankZipcode": "60327",
- "bankCountry": "DE",
- "amount": 1000,
- "referenceCode": "ABC123"
}
}
]
This endpoint retrieves details of a specific deposit.
depositId required | string = 12 characters ^[A-Z0-9]+$ Examples: 01CLFXMT67II 2R7E5Y5KFXP8 4FWWRE3Y2URM ID of the deposit |
{- "depositId": "01CLFXMT67II",
- "userData": {
- "firstName": "John",
- "lastName": "Doe",
- "userEmail": "user@virtuabroker.com",
- "address": "123 Main St, Anytown, ES",
- "taxId": "123-45-6789",
- "country": "ES",
- "kycId": "kyc-12345"
}, - "createdAt": 1723027132,
- "expectedAmount": 1000,
- "amount": 1000,
- "currency": "EUR",
- "depositType": "SEPA",
- "fee": 10,
- "expectedFee": 10,
- "feeCurrency": "EUR",
- "status": "Success",
- "depositInfo": {
- "accountHolder": "John Doe",
- "iban": "DE8937XXXXXXXXXXXX3000",
- "bic": "COBADEFFXXX",
- "bankName": "Commerzbank",
- "bankAddress": "Mainzer Landstrasse 151-153",
- "bankCity": "Frankfurt",
- "bankZipcode": "60327",
- "bankCountry": "DE",
- "amount": 1000,
- "referenceCode": "ABC123"
}
}
This endpoint creates a new order. The order follows a "specific" flow:
Origin: The process begins with receiving a specified amount of money at the origin.
Trade Execution: Once the origin amount is received, the trade is executed.
Withdrawal: After successful execution, the final funds are sent to the specified withdrawal destination.
Note: This flow ensures a seamless process from fund reception to trade execution and final withdrawal.
quoteId required | string <uuid> The unique identifier of the created quote |
required | object User data associated with the order |
{- "quoteId": "123e4567-e89b-12d3-a456-426614174000",
- "userData": {
- "firstName": "John",
- "lastName": "Doe",
- "userEmail": "user@virtuabroker.com",
- "address": "123 Main St, Anytown, ES",
- "taxId": "123-45-6789",
- "country": "ES",
- "kycId": "kyc-12345"
}
}
{- "orderId": "01CLFXMT67II",
- "deposit": {
- "depositId": "01CLFXMT67II",
- "userData": {
- "firstName": "John",
- "lastName": "Doe",
- "userEmail": "user@virtuabroker.com",
- "address": "123 Main St, Anytown, ES",
- "taxId": "123-45-6789",
- "country": "ES",
- "kycId": "kyc-12345"
}, - "createdAt": 1723027132,
- "expectedAmount": 1000,
- "amount": 1000,
- "currency": "EUR",
- "depositType": "SEPA",
- "fee": 10,
- "expectedFee": 10,
- "feeCurrency": "EUR",
- "status": "Success",
- "depositInfo": {
- "accountHolder": "John Doe",
- "iban": "DE8937XXXXXXXXXXXX3000",
- "bic": "COBADEFFXXX",
- "bankName": "Commerzbank",
- "bankAddress": "Mainzer Landstrasse 151-153",
- "bankCity": "Frankfurt",
- "bankZipcode": "60327",
- "bankCountry": "DE",
- "amount": 1000,
- "referenceCode": "ABC123"
}
}, - "trade": {
- "tradeId": "123e4567-e89b-12d3-a456-426614174000",
- "createdAt": 1723027132,
- "pair": "BTC/EUR",
- "tradeType": "buy",
- "volume": 0.5,
- "price": 30000,
- "fee": 0.1,
- "feeCurrency": "EUR",
- "userEmail": "user@example.com"
}, - "withdraw": {
- "withdrawalId": "01CLFXMT67II",
- "userData": {
- "firstName": "John",
- "lastName": "Doe",
- "userEmail": "user@virtuabroker.com",
- "address": "123 Main St, Anytown, ES",
- "taxId": "123-45-6789",
- "country": "ES",
- "kycId": "kyc-12345"
}, - "createdAt": 1723027132,
- "updatedAt": 1723027132,
- "amount": 1000,
- "currency": "EUR",
- "withdrawalType": "CRYPTO",
- "fee": 10,
- "feeCurrency": "EUR",
- "withdrawalInfo": "string",
- "status": "Pending"
}, - "createdAt": 1723027132,
- "updatedAt": 1723027132,
- "status": "Pending",
- "fee": 6.37,
- "expectedFee": 6.88,
- "expectedGasFee": 6.88,
- "feeCurrency": "EUR"
}
This endpoint retrieves a list of orders based on various filters.
currency | string Example: currency=EUR Optional currency code to filter the items |
minAmount | number >= 0 |
maxAmount | number >= 0 |
from | integer >= 0 |
to | integer >= 0 |
userEmail | string <email> Example: userEmail=user@example.com Email of the user making the request |
limit | number >= 0 |
page | number >= 0 |
status | string Enum: "Pending" "Processing" "Reviewing" "Completed" "Failed" Examples: status=Pending status=Completed status=Failed status=Processing Optional status to filter orders |
[- {
- "orderId": "01CLFXMT67II",
- "deposit": {
- "depositId": "01CLFXMT67II",
- "userData": {
- "firstName": "John",
- "lastName": "Doe",
- "userEmail": "user@virtuabroker.com",
- "address": "123 Main St, Anytown, ES",
- "taxId": "123-45-6789",
- "country": "ES",
- "kycId": "kyc-12345"
}, - "createdAt": 1723027132,
- "expectedAmount": 1000,
- "amount": 1000,
- "currency": "EUR",
- "depositType": "SEPA",
- "fee": 10,
- "expectedFee": 10,
- "feeCurrency": "EUR",
- "status": "Success",
- "depositInfo": {
- "accountHolder": "John Doe",
- "iban": "DE8937XXXXXXXXXXXX3000",
- "bic": "COBADEFFXXX",
- "bankName": "Commerzbank",
- "bankAddress": "Mainzer Landstrasse 151-153",
- "bankCity": "Frankfurt",
- "bankZipcode": "60327",
- "bankCountry": "DE",
- "amount": 1000,
- "referenceCode": "ABC123"
}
}, - "trade": {
- "tradeId": "123e4567-e89b-12d3-a456-426614174000",
- "createdAt": 1723027132,
- "pair": "BTC/EUR",
- "tradeType": "buy",
- "volume": 0.5,
- "price": 30000,
- "fee": 0.1,
- "feeCurrency": "EUR",
- "userEmail": "user@example.com"
}, - "withdraw": {
- "withdrawalId": "01CLFXMT67II",
- "userData": {
- "firstName": "John",
- "lastName": "Doe",
- "userEmail": "user@virtuabroker.com",
- "address": "123 Main St, Anytown, ES",
- "taxId": "123-45-6789",
- "country": "ES",
- "kycId": "kyc-12345"
}, - "createdAt": 1723027132,
- "updatedAt": 1723027132,
- "amount": 1000,
- "currency": "EUR",
- "withdrawalType": "CRYPTO",
- "fee": 10,
- "feeCurrency": "EUR",
- "withdrawalInfo": "string",
- "status": "Pending"
}, - "createdAt": 1723027132,
- "updatedAt": 1723027132,
- "status": "Pending",
- "fee": 6.37,
- "expectedFee": 6.88,
- "expectedGasFee": 6.88,
- "feeCurrency": "EUR"
}
]
This endpoint retrieves details of a specific order.
orderId required | string = 12 characters ^[A-Z0-9]+$ Examples: 01CLFXMT67II 2R7E5Y5KFXP8 4FWWRE3Y2URM ID of the order |
{- "orderId": "01CLFXMT67II",
- "deposit": {
- "depositId": "01CLFXMT67II",
- "userData": {
- "firstName": "John",
- "lastName": "Doe",
- "userEmail": "user@virtuabroker.com",
- "address": "123 Main St, Anytown, ES",
- "taxId": "123-45-6789",
- "country": "ES",
- "kycId": "kyc-12345"
}, - "createdAt": 1723027132,
- "expectedAmount": 1000,
- "amount": 1000,
- "currency": "EUR",
- "depositType": "SEPA",
- "fee": 10,
- "expectedFee": 10,
- "feeCurrency": "EUR",
- "status": "Success",
- "depositInfo": {
- "accountHolder": "John Doe",
- "iban": "DE8937XXXXXXXXXXXX3000",
- "bic": "COBADEFFXXX",
- "bankName": "Commerzbank",
- "bankAddress": "Mainzer Landstrasse 151-153",
- "bankCity": "Frankfurt",
- "bankZipcode": "60327",
- "bankCountry": "DE",
- "amount": 1000,
- "referenceCode": "ABC123"
}
}, - "trade": {
- "tradeId": "123e4567-e89b-12d3-a456-426614174000",
- "createdAt": 1723027132,
- "pair": "BTC/EUR",
- "tradeType": "buy",
- "volume": 0.5,
- "price": 30000,
- "fee": 0.1,
- "feeCurrency": "EUR",
- "userEmail": "user@example.com"
}, - "withdraw": {
- "withdrawalId": "01CLFXMT67II",
- "userData": {
- "firstName": "John",
- "lastName": "Doe",
- "userEmail": "user@virtuabroker.com",
- "address": "123 Main St, Anytown, ES",
- "taxId": "123-45-6789",
- "country": "ES",
- "kycId": "kyc-12345"
}, - "createdAt": 1723027132,
- "updatedAt": 1723027132,
- "amount": 1000,
- "currency": "EUR",
- "withdrawalType": "CRYPTO",
- "fee": 10,
- "feeCurrency": "EUR",
- "withdrawalInfo": "string",
- "status": "Pending"
}, - "createdAt": 1723027132,
- "updatedAt": 1723027132,
- "status": "Pending",
- "fee": 6.37,
- "expectedFee": 6.88,
- "expectedGasFee": 6.88,
- "feeCurrency": "EUR"
}
This endpoint deletes a specific order. The order must be in status PENDING.
orderId required | string = 12 characters ^[A-Z0-9]+$ Examples: 01CLFXMT67II 2R7E5Y5KFXP8 4FWWRE3Y2URM ID of the order |
{ }