Example API Calls
A few API calls to get you started. The following examples all use cURL.

Getting Your Balance

How to fetch your available and pending balance.
1
$ curl 'https://api.vaultoro.com/v1/private/balances' \
2
-H 'VTOKEN: {TOKEN}'
Copied!
The response will look a bit like this. Your pending balances represent orders you currently have places. To calculate your available balance, simply subtract your pending balance from your settled balance.
1
{
2
"data": [{
3
"type": "PENDING",
4
"handle": "BTC",
5
"quantity": "0.00000000"
6
}, {
7
"type": "SETTLED",
8
"handle": "BTC",
9
"quantity": "9998.04231521"
10
}, {
11
"type": "PENDING",
12
"handle": "GOLD",
13
"quantity": "17.0439"
14
}, {
15
"type": "SETTLED",
16
"handle": "GOLD",
17
"quantity": "100007.0439"
18
}, {
19
"type": "PENDING",
20
"handle": "DASH",
21
"quantity": "0.00000000"
22
}, {
23
"type": "SETTLED",
24
"handle": "DASH",
25
"quantity": "23.97600000"
26
}, {
27
"type": "PENDING",
28
"handle": "SILVER",
29
"quantity": "0"
30
}, {
31
"type": "SETTLED",
32
"handle": "SILVER",
33
"quantity": "50000"
34
}]
35
}
Copied!

Creating an Order

The following will create a BUY order for 5 grams of Gold at 0.00050445 BTC.
1
curl -XPOST https://api.vaultoro.com/v1/private/orders \
2
-H "VTOKEN: $VTOKEN" \
3
-H 'Content-type: application/json' \
4
-d '{"pair": "GOLDBTC", "type": "BUY", "quantity": 5, "price": 0.00050445, "matchType": "LIMIT" }'
Copied!
If successful, your response will look like this.
1
{
2
"data": {
3
"result": {
4
"referenceId": "4kehxgp1keba8x4f",
5
"createdAt": 1598440574
6
}
7
}
8
}
Copied!
To cancel this order, use the referenceId returned.
1
curl -XDELETE https://api.vaultoro.com/v1/private/orders/4kehxgp1keba8x4f \
2
-H "VTOKEN: $VTOKEN" \
3
-H 'Content-type: application/json'
Copied!
If successful, you will receive the following response.
1
{
2
"data": {
3
"cancelled": true
4
}
5
}
Copied!
Last modified 1yr ago