Get a sub-account's balance
const url = 'https://api.siprtc.io/v1/Accounts/example/Balances/example';const options = {method: 'GET', headers: {Authorization: 'Basic <credentials>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.siprtc.io/v1/Accounts/example/Balances/example \ --header 'Authorization: Basic <credentials>'Vendor accounts only. Returns the prepaid balance, in US dollars, of one of the vendor’s own sub-accounts (an account whose parent is the vendor in the path).
The account in the path must be of type vendor; any other account type gets 412. A sub-account of another account, or an Auth ID that does not exist, gets 404.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Auth ID of the vendor account
Auth ID of the vendor’s sub-account
Responses
Section titled “ Responses ”The sub-account and its balance
object
Auth ID of the account the balance belongs to.
Prepaid balance in US dollars. Negative when usage has exceeded the credit.
Example
{ "auth_id": "AC000000000000000000", "balance": 42.75}Missing or wrong credentials (body: "Authentication failed")
Example generated
exampleThe sub-account does not exist or is not this vendor’s (body: "record not found")
Example generated
exampleThe path account is not a vendor (body: "Vendor AuthID is not valid vendor")
Example generated
example