I can't get baseType of transaction with get transactions Api, how do I get the transaction is credit or debit?

Here is my code:

Is anything else in my get transaction query, or is anything wrong with the sandbox account and transactions? I used the sandbox DAG account for testing.

var apidata = await Api.findById(apiId);
  var baseUrl= 'https://sandbox.api.yodlee.com/ysl/';
  var token = {accessToken};
     var data = {
        'requestId': requestId,
        'providerAccountId':providerAccountId,
      };
    const options = {
        method: "get",
        url: baseUrl+'/transactions',
        headers: {  
            'Content-Type':"application/json", 
            'Api-Version': 1.1,
            'Authorization': "Bearer " +token
           },
        params : data
    };
    const result = await axios(options).then(res=>{
        return JSON.stringify(res.data);        
     }).catch(err=>{
        // console.log(err.response);
      return err;
      });
    return result;

I got this response have all other fields except baseType. So can you help me to get right data. Response I got:

"transaction": [
        {
            "CONTAINER": "bank",
            "id": {ID},
            "amount": {
                "amount": 480.66,
                "currency": "USD"
            },
            "categoryType": "UNCATEGORIZE",
            "categoryId": 1,
            "category": "Uncategorized",
            "categorySource": "SYSTEM",
            "highLevelCategoryId": 10000017,
            "createdDate": "2022-12-02T11:15:52Z",
            "lastUpdated": "2022-12-02T11:15:52Z",
            "description": {
                "original": "CHEROKEE NATION TAX TA TAHLEQUAH OK"
            },
            "isManual": false,
            "sourceType": "AGGREGATED",
            "date": "2022-12-01",
            "transactionDate": "2022-12-01",
            "postDate": "2022-12-01",
            "status": "POSTED",
            "accountId": {accountId},
            "runningBalance": {
                "amount": 480.66,
                "currency": "USD"
            },
            "checkNumber": "998"
        }, ] ```

Upvotes: 1

Views: 114

Answers (2)

John
John

Reputation: 1

Check if you have added baseType in the Dag XML baseType="debit" baseType="credit"

Upvotes: 0

consultantmuthu
consultantmuthu

Reputation: 46

Are you sure you are using transaction api? I see reference to accounts api in your code.

Upvotes: 0

Related Questions