Adjust a sub-account's balance
const url = 'https://api.siprtc.io/v1/Accounts/example/Balances/example';const options = { method: 'PATCH', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"balance":25.5}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.siprtc.io/v1/Accounts/example/Balances/example \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "balance": 25.5 }'Vendor accounts only. Adds balance US dollars to the prepaid balance of one of the vendor’s own sub-accounts; a negative amount debits it. The amount is added to the current balance (it never replaces it), and a debit is not limited: it can take the balance below zero.
Each successful adjustment is recorded as a completed MANUAL_RECHARGE transaction on the sub-account, with the vendor as parent. The vendor’s own balance is not changed.
An account cannot change its own balance through the API; only a vendor can adjust its sub-accounts’. Any auth_id in the body is ignored: the sub-account is always the one in the path.
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 to credit or debit
Request Bodyrequired
Section titled “ Request Bodyrequired ”Amount to add (or, if negative, to take away)
object
Amount in US dollars to add to the sub-account’s prepaid balance. A negative value debits it. Must not be 0. The amount is added to the current balance; it does not replace it.
Example
25.5Responses
Section titled “ Responses ”Balance changed (body: "Balance updated")
Example generated
exampleThe body is not valid JSON (body: "Binding Error")
Example generated
exampleMissing or wrong credentials (body: "Authentication failed")
Example generated
examplebalance is missing or 0 (body: the sub-account’s Auth ID)
Example generated
exampleThe path account is not a vendor (body: "Vendor AuthID is not valid vendor")
Example generated
exampleThe sub-account does not exist or is not this vendor’s (body: "Not Found")
Example generated
example