How to fetch your available and pending balance.
Copy $ curl 'https://api.vaultoro.com/v1/private/balances' \
-H 'VTOKEN: {TOKEN}'
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.
Copy {
"data": [{
"type": "PENDING",
"handle": "BTC",
"quantity": "0.00000000"
}, {
"type": "SETTLED",
"handle": "BTC",
"quantity": "9998.04231521"
}, {
"type": "PENDING",
"handle": "GOLD",
"quantity": "17.0439"
}, {
"type": "SETTLED",
"handle": "GOLD",
"quantity": "100007.0439"
}, {
"type": "PENDING",
"handle": "DASH",
"quantity": "0.00000000"
}, {
"type": "SETTLED",
"handle": "DASH",
"quantity": "23.97600000"
}, {
"type": "PENDING",
"handle": "SILVER",
"quantity": "0"
}, {
"type": "SETTLED",
"handle": "SILVER",
"quantity": "50000"
}]
}
The following will create a BUY order for 5 grams of Gold at 0.00050445 BTC.
Copy curl -XPOST https://api.vaultoro.com/v1/private/orders \
-H "VTOKEN: $VTOKEN" \
-H 'Content-type: application/json' \
-d '{"pair": "GOLDBTC", "type": "BUY", "quantity": 5, "price": 0.00050445, "matchType": "LIMIT" }'
If successful, your response will look like this.
Copy {
"data": {
"result": {
"referenceId": "4kehxgp1keba8x4f",
"createdAt": 1598440574
}
}
}
Copy curl -XDELETE https://api.vaultoro.com/v1/private/orders/4kehxgp1keba8x4f \
-H "VTOKEN: $VTOKEN" \
-H 'Content-type: application/json'
If successful, you will receive the following response.
Copy {
"data": {
"cancelled": true
}
}