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

Account Aggregation Services provide account information like balance, account type and account name. After an account is added to the system, basic account data is immediately available. To access more detailed data and transaction history, you must do an initial aggregation [refresh](https://developer.mastercard.com/open-finance-us/documentation/products/manage/account-aggregation/data-refresh/index.md) on the account. This first-time aggregation operation retrieves up to 6 months of transaction data from the financial institution for traditional accounts (possibly longer for certain liability account types where the history of data is supported by the financial institution).
Note: It is recommended to pull data daily to maintain up-to-date account information.

Alternatively, you can subscribe to [TxPUSH](https://developer.mastercard.com/open-finance-us/documentation/products/manage/tx-push/index.md) notifications, which allows Mastercard to send changes to account data to your webhook listener.

## Use Cases {#use-cases}

* Budgeting apps.
* Analyzing a customer's cash flow.
* Rounding up the customer's transactions by small amounts to add to savings or to make contributions to charity.

## How It Works {#how-it-works}

The accounts that a customer grants access to during the Mastercard Data Connect flow determine what data you can access. The account data returned depends on the account type of the `accountId` referenced in the API call.

1. Generate the required credentials to call the API. See [Generate Your Credentials](https://developer.mastercard.com/open-finance-us/documentation/quick-start-guide/index.md#generate-your-credentials).
2. Generate an Access Token. See [Create Access Token](https://developer.mastercard.com/open-finance-us/documentation/quick-start-guide/index.md#step-1---create-access-token).
3. Create [a customer](https://developer.mastercard.com/open-finance-us/documentation/quick-start-guide/index.md#welcome-your-first-customer) and [link them to at least one account via Connect](https://developer.mastercard.com/open-finance-us/documentation/quick-start-guide/index.md#step-3---generate-mastercard-data-connect-url). See the different [Test Profiles](https://developer.mastercard.com/open-finance-us/documentation/integration-and-testing/test-the-apis/index.md#bank-account-profiles) and account types available to test with.
4. You can now use the Account Aggregation Services below for that customer.

## Account Aggregation Services {#account-aggregation-services}

After a customer has added accounts in [Data Connect](https://developer.mastercard.com/open-finance-us/documentation/connect/index.md), the account data can be retrieved using the Account Aggregation Services.

Depending on the amount of data needed, Mastercard offers various data access options.

There are two different payment models:

* Data Access Tiers - a pay-per-use model where you are charged for the level of access you use for each customer:
  * Tier 1: Account Simple Details (ASD) - basic account information
  * Tier 2: Account Full Details (AFD) - expanded account information including balances and available credit
  * Tier 3: Account Transaction Details (ATD) - adds transaction data; see [Transaction Data](https://developer.mastercard.com/open-finance-us/documentation/products/manage/transaction-data/index.md) for details
* Standalone services - conventional subscription options:
  * Account Limited Aggregation (ALA) - expanded account information equivalent to Account Full Details (Tier 2 above)
  * Transaction Aggregation (TAU) - adds transaction data; see [Transaction Data](https://developer.mastercard.com/open-finance-us/documentation/products/manage/transaction-data/index.md) for details

<br />

See the [Data Access Tiers](https://developer.mastercard.com/open-finance-us/documentation/products/manage/data-access-tiers/index.md) page for more information about the different data access tiers available.
Tip: You must use the correct endpoints for account aggregation and refresh, depending on whether you use Data Access Tiers or standalone services. See [Data Refresh](https://developer.mastercard.com/open-finance-us/documentation/products/manage/account-aggregation/data-refresh/index.md) for details of the correct data refresh endpoints.   

### Account Simple Details (ASD) {#account-simple-details-asd}

The ASD (Data Access Tier 1) option provides limited account data for a single customer, refreshed daily.

#### **Get Customer Account by ID (Simple)** {#__get-customer-account-by-id-simple__}

Use Get Customer Account by ID (Simple) to retrieve data from a specific account.

API Reference: `GET /aggregation/v1/customers/{customerId}/accounts/{accountId}/simple`

#### **Get Customer Accounts (Simple)** {#__get-customer-accounts-simple__}

Use Get Customer Accounts (Simple) to retrieve data from all of a customer's accounts.

API Reference: `GET /aggregation/v1/customers/{customerId}/accounts/simple`

#### **Get Customer Accounts by Institution ID (Simple)** {#__get-customer-accounts-by-institution-id-simple__}

Use Get Customer Accounts by Institution ID (Simple) to retrieve data from all of a customer's accounts by institution ID.

API Reference: `GET /aggregation/v1/customers/{customerId}/institutions/{institutionId}/accounts/simple`

#### **Get Customer Accounts by Institution Login ID (Simple)** {#__get-customer-accounts-by-institution-login-id-simple__}

Use Get Customer Accounts by Institution Login ID (Simple) to retrieve data from all of a customer's accounts by institution login ID.

API Reference: `GET /aggregation/v1/customers/{customerId}/institutionLogins/{institutionLoginId}/accounts/simple`

Use Get Customer Account by ID (Simple) to retrieve data from a single customer account, or Get Customer Accounts (Simple) to retrieve data from all of a customer's accounts. Accounts can be filtered by institution using the Get Customer Accounts by Institution (Simple) endpoint, or by institution login-set using the Get Customer Accounts by Institution Login ID (Simple) endpoint. These variations enable a customizable user experience and greater account organization.

### Account Full Details (AFD) or Account Limited Aggregation (ALA) {#account-full-details-afd-or-account-limited-aggregation-ala}

AFD (Data Access Tier 2) and ALA (standalone) both provide complete account data for a customer.

This includes all the data provided in the Tier 1 ASD service, as well as expanded information relevant to the account type, which may vary by institution.

#### **Get Customer Account by ID** {#__get-customer-account-by-id__}

Use Get Customer Account by ID to retrieve data from a specific account.

API Reference: `GET /aggregation/v2/customers/{customerId}/accounts/{accountId}`

#### **Get Customer Accounts** {#__get-customer-accounts__}

Use Get Customer Accounts to retrieve data from all of a customer's accounts.

API Reference: `GET /aggregation/v1/customers/{customerId}/accounts`

#### **Get Customer Accounts by Institution ID** {#__get-customer-accounts-by-institution-id__}

Use Get Customer Accounts by Institution ID to retrieve data from all of a customer's accounts by institution ID.

API Reference: `GET /aggregation/v1/customers/{customerId}/institutions/{institutionId}/accounts`

#### **Get Customer Accounts by Institution Login ID** {#__get-customer-accounts-by-institution-login-id__}

Use Get Customer Accounts by Institution Login ID to retrieve data from all of a customer's accounts by institution login ID.

API Reference: `GET /aggregation/v1/customers/{customerId}/institutionLogins/{institutionLoginId}/accounts`

Use Get Customer Account by ID to retrieve data from a single customer account, or Get Customer Accounts to retrieve data from all of a customer's accounts. Accounts can be filtered by institution using the Get Customer Accounts by Institution ID endpoint, or by institution login-set using the Get Customer Accounts by Institution Login ID endpoint. These variations enable a customizable user experience and greater account organization.

## Delete Accounts {#delete-accounts}

Removal of accounts is made easy with two endpoints. Delete Customer Account will remove a specified account from aggregation while Delete Customer Accounts by Institution Login ID will remove the specified set of accounts relating to a particular FI login ID.

#### **Delete Customer Account** {#__delete-customer-account__}


API Reference: `DELETE /aggregation/v1/customers/{customerId}/accounts/{accountId}`

#### **Delete Customer Account by Institution Login ID** {#__delete-customer-account-by-institution-login-id__}


API Reference: `DELETE /aggregation/v1/customers/{customerId}/institutionLogins/{institutionLoginId}`

