Skip to content

Get Recent Transactions

Request URL

GET /accounts/:AFiAccountId/transactions/latest

Description

Get an array containing records of the last 30 transactions for a specified account, or all transactions within the last 12 months, whichever is fewer. The account is identified by the path parameter AFiAccountId.

Snippet Examples

javascript

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

Successful Response Examples

200 ACCOUNTS/:AFIACCOUNTID/TRANSACTIONS/LATEST SUCCESSFUL RESPONSE

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

  [
    {
      "AFiAccountId": "gakl6w7zryqamzqgnjvyfs",
      "amount": 0.1,
      "currency": "USD",
      "transactionState": "confirmed",
      "narrativeDestination": "Transfer within my accounts",  
      "internal": {
        "fromAFiUserId": "aurwujqaxhhbx",
        "txnType": "card2card",
        "sourceAFiAccountId": "gakdt961ztngvlakvzthic",
        "sourceAccountAFiUserId": "aurxqdjkmjqso"
      },
      "attachments": null,
      "reference": "rr8jf5l3mpjkzv",
      "AFiUserId": "aurxqdjkmjqso",
      "transactionId": "trn8jf5leperqkrkyioogrbukaofz",
      "dtsRecorded": "2021-10-26T20:24:43.538Z",
      "dtsValue": "2021-10-26T20:24:43.569Z",
      "narrativeSource": null,
      "labels": [],
      "dtsCompleted": "2021-10-26T20:24:44.925Z",
      "AFiCardId": "gakl6w81b8uftdhinpdtzb",
      "narrative": "Transfer within my accounts",
      "txnType": "card2card",
      "typeName": "Transfer within AmpliFi",
      "debitTransactionId": "trn8jf5l3mndrjcqrqseexdykggbv",
      "creditTransactionId": "trn8jf5leperqkrkyioogrbukaofz",
      "sourceAFiAccountId": "gakdt961ztngvlakvzthic",
      "destinationAFiAccountId": "gakl6w7zryqamzqgnjvyfs",
      "details": {
        "memos": [
          "Transfer within AmpliFi"
        ]
      },
      "transactionIdBO": "tx_4qwwyrlf9dv3t",
      "debit": 0,
      "credit": 0.1,
      "isPending": false, //true for transactions which have not settled yet
      "isComplete": true, 
      "isDeclined": false, //true for transactions which were actively rejected
      "dtsBooked": "2021-10-26T20:24:44.812Z"
    }
  ]