Skip to content

Get Account

Request URL

GET /accounts/:AFiAccountId

Description

Get the record for one specific account. The account is identified by the path parameter and must belong to the current user.

Snippet Examples

javascript

const axios = require('axios');
const config = {
  method: 'GET',
  url: '${AMPLIFI_BASE_URL}/accounts/:AFiAccountId',
  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/:AFiAccountId"  --header "token: A long random string token received from /token request" 

Successful Response Examples

200 ACCOUNTS/:ACCOUNTID SUCCESSFUL RESPONSE FOR RETRIEVING SPECIFIC ACCOUNT FOR CURRENT USER

HEADERS

Header Value
token A long random string token received from /token request

PARAMETERS

Parameter Description Value
AFiAccountId [required] qwegalgnuyocdfoxg

REQUEST BODY

none

RESPONSE BODY

{
    "account": {
        "_id": "64400ae79ccda06688170934",
        "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"
    },
    "success": true,
    "userId": "qweaurl8kgtlv9pc"
}