List IOUs
Request URL
GET /ious
Description
List all IOUs that the current user is a party to. This includes both debits and credits.
Snippet Examples
javascript
const axios = require('axios');
const config = {
method: 'GET',
url: '${AMPLIFI_BASE_URL}/ious',
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/ious" --header "token: A long random string token received from /token request"
Successful Response Examples
200 IOUS SUCCESSFUL RESPONSE GET LIST OF IOUS
HEADERS
Header | Value |
---|---|
token | A long random string token received from /token request |
REQUEST BODY
RESPONSE BODY
{
"success": true,
"payload": [
{
"IOUAccountId": "qweaurl8kgtlv9pcqweaurl8t06royym",
"dtsModified": "2023-12-15T19:20:49.806Z",
"transactions": [
{
"IOUAccountId": "qweaurl8kgtlv9pcqweaurl8t06royym",
"IOUTransactionId": "qweioutr70boy8rxdojsieqonwsordtb",
"borrowerAFiUserId": "qweaurl8kgtlv9pc",
"lenderAFiUserId": "qweaurl8t06royym",
"amount": -1.01,
"currency": "USD",
"narrativeDebit": "A short description, if transaction is debit",
"narrativeCredit": "A short description if transaction is credit",
"dts": "2023-12-15T19:13:15.476Z",
"isPending": true,
"attachments": {},
"images": [],
"isActive": true,
"narrative": "A short description if transaction is credit"
},
{
"IOUAccountId": "qweaurl8kgtlv9pcqweaurl8t06royym",
"IOUTransactionId": "qweioutr70e4soddzpbsiduceixknnsa",
"borrowerAFiUserId": "qweaurl8kgtlv9pc",
"lenderAFiUserId": "qweaurl8t06royym",
"amount": -1.01,
"currency": "USD",
"narrativeDebit": "A short description, if transaction is debit",
"narrativeCredit": "A short description if transaction is credit",
"dts": "2023-12-15T19:15:09.376Z",
"isPending": true,
"attachments": {},
"images": [],
"isActive": true,
"narrative": "A short description if transaction is credit"
},
{
"IOUAccountId": "qweaurl8kgtlv9pcqweaurl8t06royym",
"IOUTransactionId": "qweioutr70ftlidyhakwlqtthykgkqqn",
"borrowerAFiUserId": "qweaurl8kgtlv9pc",
"lenderAFiUserId": "qweaurl8t06royym",
"amount": -1.01,
"currency": "USD",
"narrativeDebit": "A short description, if transaction is debit",
"narrativeCredit": "A short description if transaction is credit",
"dts": "2023-12-15T19:16:28.168Z",
"isPending": true,
"attachments": {},
"images": [],
"isActive": true,
"narrative": "A short description if transaction is credit"
},
{
"IOUAccountId": "qweaurl8kgtlv9pcqweaurl8t06royym",
"IOUTransactionId": "qweioutr70gs80kefedwavhtlinmijsc",
"borrowerAFiUserId": "qweaurl8kgtlv9pc",
"lenderAFiUserId": "qweaurl8t06royym",
"amount": -1.01,
"currency": "USD",
"narrativeDebit": "A short description, if transaction is debit",
"narrativeCredit": "A short description if transaction is credit",
"dts": "2023-12-15T19:17:13.036Z",
"isPending": true,
"attachments": {},
"images": [],
"isActive": true,
"narrative": "A short description if transaction is credit"
},
{
"IOUAccountId": "qweaurl8kgtlv9pcqweaurl8t06royym",
"IOUTransactionId": "qweioutr70kszstgeioecqsprgphwshi",
"borrowerAFiUserId": "qweaurl8kgtlv9pc",
"lenderAFiUserId": "qweaurl8t06royym",
"amount": -1.01,
"currency": "USD",
"narrativeDebit": "IOU",
"narrativeCredit": "IOU",
"dts": "2023-12-15T19:20:20.673Z",
"isPending": true,
"attachments": {},
"images": [],
"isActive": true,
"narrative": "IOU"
}
],
"AFiUserId": "qweaurl8kgtlv9pc",
"otherAFiUserId": "qweaurl8t06royym"
},
{
"IOUAccountId": "qweaurl8kddma4isqweaurl8kgtlv9pc",
"dtsModified": "2023-12-15T19:25:56.287Z",
"transactions": [
{
"IOUAccountId": "qweaurl8kddma4isqweaurl8kgtlv9pc",
"IOUTransactionId": "qweioutr70rzydrxvqhgrrenecvaihrn",
"borrowerAFiUserId": "qweaurl8kgtlv9pc",
"lenderAFiUserId": "qweaurl8kddma4is",
"amount": -1.01,
"currency": "USD",
"narrativeDebit": "IOU",
"narrativeCredit": "IOU",
"dts": "2023-12-15T19:25:56.287Z",
"isPending": true,
"attachments": {},
"images": [],
"isActive": true,
"narrative": "IOU"
}
],
"balance": null,
"AFiUserId": "qweaurl8kgtlv9pc",
"otherAFiUserId": "qweaurl8kddma4is"
}
]
}