Fetch Banking Data

Fetch data aggregation associated with loan request.

HTTPS Request

POST https://api.lenmo.app/api/v3/data_marketplace/data_aggregation/fetch_loan_request_data_aggs/

This endpoint receives loan_request_id and returns the data_aggregation associated with this loan_request.

Headers

Name
Type
Description

Accept

String

The content type of the response.

X-API-KEY*

String

The API key that gives the user the authentication to perform this request.

X-Timestamp*

String

The timestamp of the request.

X-HMAC*

String

The HMAC generated for the request.

Request Body

Name
Type
Description

loan_request_id*

Long

loan request id for the needed aggregation to fetch

Sample Request

curl -X POST "https://api.lenmo.app/api/v3/data_marketplace/data_aggregation/fetch_loan_request_data_aggs/" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -H "X-API-KEY: YOUR_API_KEY" \
    -H "X-Timestamp: REQUEST_TIMESTAMP" \
    -H "X-HMAC: REQUEST_HMAC" \
    -d "{\"loan_request_id\": 1}"

Sample Response

{
  "created": "2022-05-27T10:37:14.658672Z",
  "borrower_bank_name_at_loan_request": "SANDBOX TEST BANK",
  "borrower_bank_balance": "0.00",
  "data_aggregation": {
    "Status": {
      "Severity": "Info",
      "StatusCode": 0,
      "StatusDesc": "Success"
    },
    "DepAcctTrns": {
      "FIAcctId": {
        "AcctId": 6161846,
        "AcctType": "DDA",
        "ExtAcctType": "DDA"
      },
      "BankAcctTrnRec": [
        {
          "Memo": "BOB'S DISCOUNT F DES:PAYROLL ID **003624X INDN:Smith, Jane CO ID:9006",
          "TrnID": 25835773,
          "CurAmt": {
            "Amt": 250.17,
            "CurCode": "USD"
          },
          "TrnType": "Credit",
          "Category": "Earned Income",
          "PostedDt": "2022-05-27",
          "CreatedOnDt": "2022-05-27T11:27:28-07:00",
          "SubCategory": "Wages & Salary"
        },
        {
          "Memo": "BOB'S DISCOUNT F DES:PAYROLL ID **016227X INDN:Smith, Jane CO ID:9006",
          "TrnID": 25835774,
          "CurAmt": {
            "Amt": 359.94,
            "CurCode": "USD"
          },
          "TrnType": "Credit",
          "Category": "Earned Income",
          "PostedDt": "2023-12-12",
          "CreatedOnDt": "2024-06-07T11:27:28-07:00",
          "SubCategory": "Wages & Salary"
        }
      ],
      "SelectionCriterion": {
        "SelRangeDt": {
          "EndDt": "2022-05-27",
          "StartDt": "2021-05-27"
        }
      }
    }
  },
  "agg_90": {
    "avg_credit": 0,
    "avg_debit": 0,
    "credit_30": 0,
    "debit_30": 0,
    "credit_60": 0,
    "debit_60": 0,
    "credit_90": 0,
    "debit_90": 0,
    "total_credit": 0,
    "total_debit": 0,
    "misc_spending_last90": 0,
    "entertainment_spending_last90": 0,
    "lifestyle_spending_last90": 0,
    "education_spending_last90": 0,
    "bank_fees_spending_last90": 0,
    "donations_spending_last90": 0,
    "goods_and_merch_spending_last90": 0,
    "home_expense_spending_last90": 0,
    "services_spending_last90": 0,
    "utilities_spending_last90": 0,
    "credit_payment_spending_last90": 0,
    "transportation_spending_last_90": 0,
    "food_spending_last90": 0,
    "cash_advance_last90": 0,
    "misc_spending_percentage_from_total": 0,
    "entertainment_spending_percentage_from_total": 0,
    "lifestyle_spending_percentage_from_total": 0,
    "education_spending_percentage_from_total": 0,
    "bank_fees_spending_percentage_from_total": 0,
    "donations_spending_percentage_from_total": 0,
    "goods_and_merch_spending_percentage_from_total": 0,
    "home_expense_spending_percentage_from_total": 0,
    "services_spending_percentage_from_total": 0,
    "utilities_spending_percentage_from_total": 0,
    "credit_payment_spending_percentage_from_total": 0,
    "transportation_spending_percentage_from_total": 0,
    "food_spending_percentage_from_total": 0,
    "cash_advance_percentage_from_total": 0,
    "negative_balance_count": 0
  }
}

Response Parameters

Parameter
Type
Description

created

Date

UTC time of data aggregation saved in the database.

borrower_bank_name_at_loan_request

String

Name of the borrower bank from which aggregation is fetched

borrower_bank_balance

String

Borrower balance in the bank provided the aggregation

data_aggregation

JSON

JSON object containing the data aggregation from the borrower's bank. It contains aggregation data provided by fiserv. Please, refer to DepAcctTrnInqRsentry in fiserv client's response.

agg_90

JSON

A JSON object containing aggregated data from the borrower's bank transactions in the last 90 days from the date of the loan request creation.

avg_credit

Float

Average income in the last 90 days.

avg_debit

Float

Average spending in the last 90 days.

credit_30

Float

Total income in the last 30 days.

debit_30

Float

Total spending in the last 30 days.

credit_60

Float

Total income in the last 30-60 days.

debit_60

Float

Total spending in the last 30-60 days.

credit_90

Float

Total income in the last 60-90 days.

debit_90

Float

Total spending in the last 60-90 days.

total_credit

Float

Total income in last 90 days.

total_debit

Float

Total spending in last 90 days.

misc_spending_last90

Float

Total amount spent in the miscellaneous expenses category in the last 90 days.

entertainment_spending_last90

Float

Total amount spent in the entertainment category in the last 90 days.

lifestyle_spending_last90

Float

Total amount spent in the Health & Lifestyle category in the last 90 days.

education_spending_last90

Float

Total amount spent in the Education category in the last 90 days.

bank_fees_spending_last90

Float

Total amount spent in the Bank Fees & Charges category in the last 90 days.

donations_spending_last90

Float

Total amount spent in the Donations category in the last 90 days.

goods_and_merch_spending_last90

Float

Total amount spent in the Goods & Merchandise category in the last 90 days.

home_expense_spending_last90

Float

Total amount spent in the Home Expenses category in the last 90 days.

services_spending_last90

Float

Total amount spent in the Services category in the last 90 days.

utilities_spending_last90

Float

Total amount spent in the Utilities category in the last 90 days.

credit_payment_spending_last90

Float

Total Amount spent in the Transfers & Adjustments category in the last 90 days.

transportation_spending_last_90

Float

Total Amount spent in the Travel & Transportation category in the last 90 days.

food_spending_last90

Float

Total Amount spent in the Food & Dining category in the last 90 days.

cash_advance_last90

Float

Total Amount spent in the Cash Advance subcategory in the last 90 days.

misc_spending_percentage_from_total

Float

Percentage spent on Miscellaneous expenses category from the total.

entertainment_spending_percentage_from_total

Float

Percentage spent on Entertainment category from the total.

lifestyle_spending_percentage_from_total

Float

Percentage spent on Health & Lifestyle category from the total.

education_spending_percentage_from_total

Float

Percentage spent on Education category from the total.

bank_fees_spending_percentage_from_total

Float

Percentage spent on Bank Fees & Charges category from the total.

donations_spending_percentage_from_total

Float

Percentage spent on Donations category from the total.

goods_and_merch_spending_percentage_from_total

Float

Percentage spent on Goods & Merchandise category from the total.

home_expense_spending_percentage_from_total

Float

Percentage spent on Home Expenses category from the total.

services_spending_percentage_from_total

Float

Percentage spent on Services category from the total.

utilities_spending_percentage_from_total

Float

Percentage spent on Utilities category from the total.

credit_payment_spending_percentage_from_total

Float

Percentage spent on Transfers & Adjustments category from the total.

transportation_spending_percentage_from_total

Float

Percentage spent on Travel & Transportation category from the total.

food_spending_percentage_from_total

Float

Percentage spent on Food category from the total.

cash_advance_percentage_from_total

Float

Percentage spent on Cash Advance subcategory from the total.

negative_balance_count

Integer

The number of times the borrower's bank balance went negative

Last updated