List Accounts
Request URL
GET /accounts
Description
Get an array of records for all accounts belonging to the current user.
Snippet Examples
javascript
const axios = require('axios');
const config = {
method: 'GET',
url: '${AMPLIFI_BASE_URL}/accounts',
headers: {
'token': "A long random string token received from /token request"
},
};
let result;
try {
result = await axios.request(config);
if (result.status === 200) {
console.log(JSON.stringify(result.data));
}
} catch (err) {
console.log({
errCode: err.code,
responseStatus: err.response && err.response.status,
data: err.response && JSON.stringify(err.response.data)
});
}
cURL
curl --location "AMPLIFI_BASE_URL/accounts" --header "token: A long random string token received from /token request"
Successful Response Examples
200 ACCOUNTS SUCCESSFUL RESPONSE FOR GETTING CURRENT USER ACCOUNTS
HEADERS
Header | Value |
---|---|
token | A long random string token received from /token request |
REQUEST BODY
RESPONSE BODY
{
"accounts": [
{
"AFiCardId": "qwegalgnuyocdfoxg",
"AFiAccountId": "qwegalgnuyocdfoxg",
"name": "virtual",
"typeId": "virtual",
"accountIdBO": "cd_5cws26xjxlfbb",
"backOfficeId": "evolve",
"backOfficeName": "evolve",
"status": "blocked",
"isActive": true,
"isClosed": false,
"num": "100000******9622",
"rn": "084106768",
"balance": {
"currency": "USD",
"native": 0,
"available": 0
},
"AFiUserId": "qweaurl8kgtlv9pc",
"dtsOpened": "2023-04-19T15:38:14.436Z",
"id": "qwegalgnuyocdfoxg",
"primaryUserAFiUserId": null,
"dtsUpdated": "2023-12-11T13:14:57.328Z"
},
{
"AFiCardId": "qwegalgmoi1nxqhzc",
"AFiAccountId": "qwegalgmoi1nxqhzc",
"name": "virtual",
"typeId": "virtual",
"accountIdBO": "cd_5cwsm0vjv3z7f",
"backOfficeId": "evolve",
"backOfficeName": "evolve",
"status": "blocked",
"isActive": true,
"isClosed": false,
"num": "100000******9057",
"rn": "084106768",
"balance": {
"currency": "USD",
"native": 0,
"available": 0
},
"AFiUserId": "qweaurl8kgtlv9pc",
"dtsOpened": "2023-04-18T19:49:33.207Z",
"id": "qwegalgmoi1nxqhzc",
"primaryUserAFiUserId": null,
"dtsUpdated": "2023-12-11T13:14:57.351Z"
},
{
"AFiCardId": "qwegalgmnr8njtinq",
"AFiAccountId": "qwegalgmnr8njtinq",
"name": "virtual",
"typeId": "virtual",
"accountIdBO": "cd_5cwsmytr3zt3p",
"backOfficeId": "evolve",
"backOfficeName": "evolve",
"status": "blocked",
"isActive": true,
"isClosed": false,
"num": "100000******9034",
"rn": "084106768",
"balance": {
"currency": "USD",
"native": 0,
"available": 0
},
"AFiUserId": "qweaurl8kgtlv9pc",
"dtsOpened": "2023-04-18T19:28:43.341Z",
"id": "qwegalgmnr8njtinq",
"primaryUserAFiUserId": null,
"dtsUpdated": "2023-12-11T13:15:01.034Z"
},
{
"AFiAccountId": "qwegal8kgtmysmels",
"AFiCardId": "qwegal8kgtmysmels",
"name": "Checking",
"typeId": "Standard",
"accountIdBO": "cd_5cg2g8nddz3r9",
"backOfficeId": "evolve",
"backOfficeName": "evolve",
"status": "active",
"isActive": true,
"isClosed": false,
"num": "100000******7112",
"rn": "084106768",
"balance": {
"currency": "USD",
"native": 2.99,
"available": 2.99
},
"AFiUserId": "qweaurl8kgtlv9pc",
"dtsOpened": "2022-09-27T17:21:47.495Z",
"id": "qwegal8kgtmysmels",
"dtsUpdated": "2023-12-11T13:14:57.340Z",
"cardIdBO": "cd_5cg2g8nddz3r9",
"isActivated": false,
"dtsExpiry": "2025-10-01T03:59:59.999Z",
"currency": "USD",
"name_on_card": "JOHN TESTMAN NKPB",
"image": "images/card1.png",
"dtsPreActivated": "2022-09-27T17:21:57.866Z",
"dtsReissued": "2023-04-18T17:48:03.912Z"
}
],
"dtsUpdateNext": "2023-12-11T13:35:01.165Z",
"success": true,
"userId": "qweaurl8kgtlv9pc"
}