# Understanding Account Data
source: https://developer.mastercard.com/open-finance-us/documentation/products/manage/account-aggregation/understanding-account-data/index.md

The account and transaction data elements returned from [Account Aggregation](https://developer.mastercard.com/open-finance-us/documentation/products/manage/account-aggregation/index.md) and [Transaction Data](https://developer.mastercard.com/open-finance-us/documentation/products/manage/transaction-data/index.md) vary depending on the account type. The account types are grouped into data segments:

* Deposit
* Line Of Credit
* Investment
* Mortgage/Loans
* Student loan

For example, within deposits there will be savings and checking accounts, and for investments you will see 401K, IRA and many other types of retirement and non-retirement accounts.

Within the `accounts` data, for some accounts / account types there will be a `details` array with additional account details (which will vary from one account type to another).

The following sections show the typical structure of account data and the details data, and also how to understand the key identifiers within the data which can help you to identify and properly organize account data within your application.

## Account Data {#account-data}

Account level data is universally available for all account types. A sample of the data is shown below.

    "accounts": [
                  {
                      "id": "6060665493",
                      "number": "xx0004",
                      "realAccountNumberLast4": "0004",
                      "accountNumberDisplay": "0004",
                      "name": "Credit Card",
                      "balance": -299.90,
                      "type": "creditCard",
                      "aggregationStatusCode": 0,
                      "status": "active",
                      "customerId": "6031425958",
                      "institutionId": "102105",
                      "balanceDate": 1695725297,
                      "aggregationSuccessDate": 1695725297,
                      "aggregationAttemptDate": 1695725297,
                      "createdDate": 1691489793,
                      "lastUpdatedDate": 1691489835,
                      "currency": "USD",
                      "lastTransactionDate": 1692103954,
                      "institutionLoginId": 6028474654,
                      "displayPosition": 4,
                      "accountNickname": "Credit Card",
                      "oldestTransactionDate": 1629374400,
                      "marketSegment": "personal"
                  }
               ]

## Account Details {#account-details}

Data at the account details level provides additional insight into a particular account. Data elements in this level can be found in multiple segments depending on the account type being accessed. A sample showing the different account details for the respective account type is shown below.
Note: The data elements that are returned vary depending on the financial institution and the account type.
* Deposit
* Line-of-Credit
* Investment
* Mortgage-Loans
* Student-Loans

```Deposit
  "detail": {
              "dateAsOf": 1607450357,
              "availableBalanceAmount": 5678.78,
              "openDate": 1607450357,
              "periodStartDate": 1607450357,
              "periodEndDate": 1607450357,
              "periodInterestRate": 13.245,
              "periodDepositAmount": 2356.56,
              "periodInterestAmount": 1234.56,
              "interestYtdAmount": 1056.67,
              "interestPriorYtdAmount": 3056.79,
              "maturityDate": 1607450357,
            }
```

```Line-Of-Credit
  "detail": {
              "dateAsOf": 1607450357,
              "interestRate": "15.789",
              "creditAvailableAmount": 3000,
              "creditMaxAmount": 7000,
              "cashAdvanceAvailableAmount": 2000,
              "cashAdvanceMaxAmount": 3000,
              "cashAdvanceBalance": 1000,
              "cashAdvanceInterestRate": 21.5,
              "currentBalance": 5789.34,
              "paymentMinAmount": 456.78,
              "paymentDueDate": 1607450357,
              "previousBalance": 1234.56,
              "statementStartDate": 1607450357,
              "statementEndDate": 1607450357,
              "statementPurchaseAmount": 2345.9,
              "statementFinanceAmount": 156.78,
              "statementCreditAmount": 345,
              "rewardEarnedBalance": 500,
              "pastDueAmount": 3688.99,
              "lastPaymentAmount": 567.89,
              "lastPaymentDate": 1607450357,
              "statementCloseBalance": 2456.69
             }
```

```Investment
  "detail": {
              "dateAsOf": 1607450357,
              "marginBalance": 456,
              "shortBalance": 1245.89,
              "availableCashBalance": 3549.78,
              "maturityValueAmount": 34067.78,
              "vestedBalance": 45000,
              "empMatchAmount": 256.99,
              "empPretaxContribAmount": 450,
              "empPretaxContribAmountYtd": 700,
              "contribTotalYtd": 2045,
              "cashBalanceAmount": 2000,
              "preTaxAmount": 78564.99,
              "afterTaxAmount": 68564.99,
              "matchAmount": 378,
              "profitSharingAmount": 34678.89,
              "rolloverAmount": 101234.67,
              "otherVestAmount": 34000,
              "otherNonvestAmount": 26000,
              "currentLoanBalance": 345789.23,
              "loanRate": 3.275,
              "buyPower": 34567.89,
              "rolloverLtd":  23456.78
      },
```

```Mortgage-Loans
  "detail": {
              "dateAsOf": 1607450357,
              "availableBalanceAmount": 500.00,
              "interestRate": "15.789",
              "paymentMinAmount": 456.78,
              "lastPaymentAmount": 567.89,
              "termOfMl": "36",
              "mlHolderName": "John Smith",
              "description": "a description",
              "lateFeeAmount": 35,
              "payoffAmount": 45567.98,
              "payoffAmountDate": 1607450357,
              "originalMaturityDate": 1607450357,
              "principalBalance": 45056.7,
              "escrowBalance": 2345.01,
              "interestPeriod": "monthly",
              "initialMlAmount": 65000,
              "initialMlDate": 1607450357,
              "nextPaymentPrincipalAmount": 1256.67,
              "nextPaymentInterestAmount": 234.56,
              "nextPayment": 1578,
              "nextPaymentDate": 1607450357,
              "lastPaymentDueDate": 1607450357,
              "lastPaymentReceiveDate": 1607450357,
              "lastPaymentPrincipalAmount": 1256.67,
              "lastPaymentInterestAmount": 234.56,
              "lastPaymentEscrowAmount": 456.78,
              "lastPaymentLastFeeAmount": 150,
              "lastPaymentLateCharge": 50,
              "ytdPrincipalPaid": 5432.01,
              "ytdInterestPaid": 3948.56,
              "ytdInsurancePaid": 1345.89,
              "ytdTaxPaid": 1489,
              "autoPayEnrolled": true,
              "collateral": "nissan sentra",
              "firstPaymentDate": 1607450357,
              "firstMortgage": true,
              "loanPaymentFreq": "monthly",
              "recurringPaymentAmount": 456.23,
              "lender": "utah community credit union",
              "endingBalanceAmount": 234789.45,
              "loanTermType": "fixed",
              "paymentsMade": 14,
              "balloonAmount": 1678.56,
              "projectedInterest": 10456.78,
              "interestPaidLtd": 56789.34,
              "interestRateType": "variable",
              "loanPaymentType": "principle",
              "paymentsRemaining": 45
            }
```

```Student-Loans
  "detail": {
              "dateAsOf": 1607450357,
              "loanAwardId": "1234568",
              "loanAwardId": "1234568",
              "originalInterestRate": 12,
              "guarantor": "FinBank",
              "owner": "FinBank",
              "interestSubsidyType": "Subsidy type",
              "interestBalance": 2000,
              "remainingTermOfMl": 2,
              "initialInterestRate": 34567.89,
              "feesBalance": 150,
              "loanYtdInterestPaid": 5623.23,
              "loanYtdFeesPaid": 5621.23,
              "loanYtdPrincipalPaid": 5621.23,
              "loanStatus": "Deferment",
              "loanStatusStartDate": 1607450357,
              "loanStatusEndDate": 1607450357,
              "weightedInterestRate": 12,
              "repaymentPlanStartDate": 1607450357,
              "repaymentPlanEndDate": 1607450357,
              "repaymentPlan": "Standard",
              "expectedPayoffDate": 1607450357,
              "currentSchool": "utah valley university",
              "originalSchool": "brigham young university",
              "outOfSchoolDate": 1607450357,
              "convertToRepayment": 1607450357,
              "daysDelinquent": 5,
              "totalPrincipalPaid": 15000,
              "totalInterestPaid": 1125,
              "totalAmountPaid": 16125
            }
```

### Investment Account Positions {#investment-account-positions}

Data at the account position level will only be populated for investment account types. A position will be returned for each specific investment or holding in a customer's account. The below example shows all the possible data elements within the position object.

    "position": [
        {
          "id": 454678080,
          "description": "DELTA AIR LINES INC",
          "symbol": "DAL",
          "units": 6.537,
          "currentPrice": 41.585,
          "securityName": "DELTA AIR LINES INC",
          "transactionType": "Margin",
          "marketValue": 271.84,
          "costBasis": 190.01,
          "status": "A",
          "currentPriceDate": 1607450357,
          "securityType": "Stock",
          "mfType": "OPENEND",
          "posType": "Long",
          "totalGLDollar": 162742.9,
          "totalGLPercent": 68.89,
          "optionStrikePrice": 50,
          "optionType": "PUT",
          "optionSharesPerContract": 100,
          "optionExpireDate": "1644994800",
          "fiAssetClass": "COMNEQTY",
          "assetClass": "INTLSTOCK",
          "currencyRate": 1,
          "securityId": "25400W102",
          "securityIdType": "CUSIP",
          "costBasisPerShare": 13.38,
          "subAccountType": "CASH",
          "securityCurrency": "USD",
          "todayGLDollar": 16272.9,
          "todayGLPercent": 18.89
        }
      ],
      "displayPosition": 2,
      "parentAccount": "5011648377"

## Understanding Key Account Identifiers {#understanding-key-account-identifiers}

Customer account records have many data points that can be used in your application. You can properly identify accounts and organize account data inside of your application by using the following Mastercard assigned identifiers.

### Key Account Record Fields {#key-account-record-fields}

Using the account key identifiers can not only help identify accounts, but organize them well within an application.

|        Field         |                                                                                                                 Description                                                                                                                  |
|----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `id`                 | The Mastercard assigned unique account identifier. Use this for future account data retrieval and organization.                                                                                                                              |
| `institutionId`      | The Mastercard assigned unique identifier for the financial institution. Use this to organize accounts by financial institution.                                                                                                             |
| `institutionLoginId` | The Mastercard assigned unique identifier for the set of login credentials. Use this to organize accounts under a login group and give proper context to accounts at the same institution, but under different login sets.                   |
| `type`               | The Mastercard normalized account type, describing if the account is a checking, savings, loan, etc. Use this to determine how you will use accounts in your application, or filter accounts in Data Connect to enhance the user experience. |

