Skip to content

List User IOUs

Request URL

GET /ious/for/:AFiUserId

Description

Get an IOU between the current user and a specified user, if one exists. The creditor (lender) ID is given as a path parameter. The current user is the debtor.

Snippet Examples

javascript

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

Successful Response Examples

200 IOUS/FOR/:AFIUSERID SUCCESSFUL RESPONSE GET IOU FOR SPECIFIED AFIUSERID

HEADERS

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

PARAMETERS

Parameter Description Value
AFiUserId [required] qweaurl8kddma4is

REQUEST BODY

none

RESPONSE BODY

{
    "success": true,
    "payload": [
        {
            "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"
                }
            ],
            "AFiUserId": "qweaurl8kddma4is",
            "otherAFiUserId": "qweaurl8kgtlv9pc"
        }
    ]
}