Track Account Balances
TxB APIs allow clients to track near real-time account balances. Clients use this service to get account balances before making a payment or get updated balances after a transaction is posted to their account.
Step by step guide
Step 1 - Get a list of all accounts
Our account balances API provides information at an account level. So, our first step is to get a list of accounts associated with a TxB Client.
GET /v2/products
will return a list of accounts that the client currently uses.
{
"productList": [
{
"productType": "DEPOSIT_ACCOUNT",
"relatedEntities": [
{ ... }
],
"productTypeSpecificData": {
"depositAccountSpecificData": {
"accountNumber": "220000008400",
"accountObject": {
"linkUrl": "https://api.test.txb.gs.com/v2/accounts/220000004004"
},
"transactionData": [
{ ... }
]
}
}
},
{
"productType": "DEPOSIT_ACCOUNT",
"relatedEntities": [
{ ... }
],
"productTypeSpecificData": {
"depositAccountSpecificData": {
"accountNumber": "110000008260",
"accountObject": {
"linkUrl": "https://api.test.txb.gs.com/v2/accounts/11008260"
},
"transactionData": [
{ ... }
]
}
}
}
]
}
Step 2 – Identify the accounts you want to get balances for and fetch additional account identifiers
Once you have your product list response, determine account number(s) or IBAN(s) you would like to query and get additional account identifiers associated with them.
You can skip this step if you already have routing details for your account(s).
GET /v2/accounts/220000004004
returns:
{
"type": "DEPOSIT_ACCOUNT",
"accountStatus": "ACTIVE",
"accountCurrency": "USD",
"rate": 1,
"branchCountry": "US",
"administrative": { ... },
"accountIdentifiers": { // returns account identifiers
"accountNumber": "012345678910",
"iban": "GB33GSLD01234567890123", // returns IBAN
"bankIdentifier": {
"bic": "GOLDUS33TXB",
"routingInfo": { // returns the Routing Number of the account
"code": "USABA",
"value": "124085260"
}
},
"externalPaymentIds": [ ... ]
},
...
}
Repeat this step for each of your products to get additional account identifiers.
Step 3: Get accountBalances for the list of identified TxB accounts
POST /v1/reports/accountBalances
with this request body:
[
{
"accountNumber": "012345678910",
"routingInfo": {
"code": "USABA",
"value": "124085260"
},
"iban" :"GB33GSLD01234567890120"
}
]
returns the balance info for the account(s) including available and ledger balances
[
{
"asOfDateTime": "2020-10-11T23:52:42.279Z",
"accountIdentifiers": {...},
"currency": "USD",
"balances": [
{
"balanceType": "LEDGER",
"startOfDayBalance": 2000.00,
"endOfDayBalance": null,
"currentBalance": 1500.00
},
{
"balanceType": "AVAILABLE",
"startOfDayBalance": 2000.00,
"endOfDayBalance": null,
"currentBalance": 1500.00
}
]
},
{
"asOfDateTime": "2020-10-11T23:52:42.279Z",
"accountIdentifiers": {...},
"currency": "GBP",
"balances": [
{
"balanceType": "LEDGER",
"startOfDayBalance": 5000.00,
"endOfDayBalance": null,
"currentBalance": 500.00
},
{
"balanceType": "AVAILABLE",
"startOfDayBalance": 5000.00,
"endOfDayBalance": null,
"currentBalance": 500.00
}
]
}
]
Was this page useful?
Give feedback to help us improve developer.gs.com and serve you better.