Managing bank accounts
List, add and delete bank accounts.
Add a new bank account
import { createSignature } from "./createSignature";
const axios = require('axios');
const apiKey = "{YOUR API KEY}";
const secret = "{YOUR SECRET}";
async function addBankAccount() {
const path = "https://idrx.co/api/auth/add-bank-account";
const req = {
"bankAccountNumber" : "{BANK ACCOUNT NUMBER}",
"bankCode" : "{BANK CODE}",
};
const bufferReq = Buffer.from(JSON.stringify(req), 'base64').toString('utf8');
const timestamp = Math.round((new Date()).getTime()).toString();
const sig = createSignature('POST', path, bufferReq, timestamp, secret);
const res = await axios.post(path, req, {
headers: {
'Content-Type': 'application/json',
'idrx-api-key': apiKey,
'idrx-api-sig': sig,
'idrx-api-ts' : timestamp,
},
});
console.log('res.data: ');
console.log(JSON.stringify(res.data, null, 4));
}
addBankAccount();Delete a bank account
Last updated