Banking
The client.banking namespace provides access to account information, transaction history, and statement generation.
List Accounts
const result = await client.banking.getAccounts({ page: 1, size: 20 })
if (result.success) {
for (const account of result.data.items) {
console.log(`${account.accountNumber} — ${account.balance} ${account.currency}`)
}
}
const result = await client.banking.getAccounts({ page: 1, size: 20 })
if (result.success) {
for (const account of result.data.items) {
console.log(`${account.accountNumber} — ${account.balance} ${account.currency}`)
}
}
Query Transactions
Filter by date range, credit/debit sign, sort order, and page:
const result = await client.banking.getTransactions({
fromDate: '2024-01-01',
toDate: '2024-01-31',
sign: 'credit',
order: 'desc',
page: 1,
size: 50,
})
if (result.success) {
for (const txn of result.data.items) {
console.log(`${txn.reference} — ${txn.amount} ${txn.currency} on ${txn.date}`)
}
}
const result = await client.banking.getTransactions({
fromDate: '2024-01-01',
toDate: '2024-01-31',
sign: 'credit',
order: 'desc',
page: 1,
size: 50,
})
if (result.success) {
for (const txn of result.data.items) {
console.log(`${txn.reference} — ${txn.amount} ${txn.currency} on ${txn.date}`)
}
}
sign value | Description |
|---|---|
'credit' | Incoming funds only |
'debit' | Outgoing funds only |
| (omit) | All transactions |
Get Single Transaction
const result = await client.banking.getTransaction('REF123456')
if (result.success) {
const { reference, amount, currency, status } = result.data
console.log(`${reference}: ${amount} ${currency} — ${status}`)
}
const result = await client.banking.getTransaction('REF123456')
if (result.success) {
const { reference, amount, currency, status } = result.data
console.log(`${reference}: ${amount} ${currency} — ${status}`)
}
Batch Retrieve Transactions
Retrieve details for multiple transaction references in a single call:
const result = await client.banking.getMultipleTransactions(['REF1', 'REF2', 'REF3'])
if (result.success) {
for (const txn of result.data) {
console.log(`${txn.reference}: ${txn.amount} ${txn.currency}`)
}
}
const result = await client.banking.getMultipleTransactions(['REF1', 'REF2', 'REF3'])
if (result.success) {
for (const txn of result.data) {
console.log(`${txn.reference}: ${txn.amount} ${txn.currency}`)
}
}
Generate Statement
Generate an account statement in MT940 or other available formats:
const result = await client.banking.generateStatement({
accountNumber: 'ACC123456789',
documentType: 'MT940',
date: '2024-01',
})
if (result.success) {
// result.data contains the statement file content or download URL
console.log('Statement generated:', result.data)
}
const result = await client.banking.generateStatement({
accountNumber: 'ACC123456789',
documentType: 'MT940',
date: '2024-01',
})
if (result.success) {
console.log('Statement generated:', result.data)
}