Account balance
To retrieve the balance of a specific account, you can make a GET request to either of the following endpoints:
Get Account & balances
To get an account balance, one can either call the get account by ID and extract balance or available_balance
curl --request GET \
--url https://api.vault.ledger.com/accounts/{{account_id}} \
--header 'authorization: Bearer {{access_token}}' \
--header 'content-type: application/json' \
--header 'x-ledger-workspace: minivault'{
"address": null,
"available_balance": "9981",
"balance": "10292",
"coin_fields": null,
"contract_address": null,
"created_by": 5,
"created_on": "2024-01-24T07:36:17.591696+00:00",
"currency": "bitcoin_testnet",
"derivation_path": "84'/1'/1'",
"governance_rules": [
{
"id": 2,
"index": 0,
"name": "Rule 1",
"rules": [
{
"data": [
{
"group": 1,
"quorum": 1
},
{
"group": 2,
"quorum": 1
},
{
"group": 3,
"quorum": 1
}
],
"id": 2,
"type": "MULTI_AUTHORIZATIONS"
}
]
},
{
"id": 3,
"index": 1,
"name": "Rule 2",
"rules": [
{
"data": [
{
"group": 2,
"quorum": 1
},
{
"group": 1,
"quorum": 1
},
{
"group": 3,
"quorum": 1
}
],
"id": 3,
"type": "MULTI_AUTHORIZATIONS"
}
]
}
],
"id": 2,
"index": 1,
"labels": [],
"last_request": 27,
"name": "ClientA COL TBTC 1",
"parent": null,
"pending_balance": "311",
"status": "ACTIVE",
"type": "Bitcoin",
"xpub": null
}or GET /accounts/{account_id}/balances and extract total or available. Not that some account time offer more granularity in the response payload.
curl --request GET \
--url https://api.vault.ledger.com/accounts/{{account_id}}/balances \
--header 'authorization: Bearer {{access_token}}' \
--header 'content-type: application/json' \
--header 'x-ledger-workspace: minivault'{
"available": 9981,
"pending": 311,
"total": 10292
}Last updated