Get Transactions by Date Range
Request URL
GET /accounts/:AFiAccountId/transactions/:dateStart/:dateEnd
Description
Get an array containing records of all transactions for a specified account for a given time period. The account is identified by the path parameter AFiAccountId
. The time period is defined by the path parameters dateStart
and dateEnd
. The dates are given in ISO date format, and the period runs from dateStart to dateEnd, inclusive.
Transaction records include various fields depending on their nature, status, and circumstances.
Snippet Examples
javascript
const axios = require('axios');
const config = {
method: 'GET',
url: '${AMPLIFI_BASE_URL}/accounts/:AFiAccountId/transactions/:dateStart/:dateEnd',
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/:dateStart/:dateEnd" --header "token: A long random string token received from /token request"
Successful Response Examples
200 ACCOUNTS/:AFIACCOUNTID/TRANSACTIONS/:DATESTART/:DATEEND SUCCESSFUL RESPONSE
HEADERS
Header | Value |
---|---|
token | A long random string token received from /token request |
PARAMETERS
Parameter | Description | Value |
---|---|---|
AFiAccountId | [required] | qwegalgnuyocdfoxg |
dateStart | [required] | 2020-10-26 |
dateEnd | [required] | 2024-10-26 |
REQUEST BODY
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"
}
]