> ## Documentation Index
> Fetch the complete documentation index at: https://developer.moneyone.in/llms.txt
> Use this file to discover all available pages before exploring further.

# FI Data API

> Retrieve a user's raw financial data (FI data) by FI type from PFM service

## Overview

The FI Data API retrieves the raw financial data (FI data) aggregated for a specific user, filtered by Financial Information type. Unlike the [User Analytics API](https://developer.moneyone.in/pfm/user-analytics-api.md) — which returns derived insights and metrics — this API returns the underlying account-level records exactly as fetched from the Account Aggregator, so you can render raw holdings, balances, and transactions in your application.

## Example Request

```bash cURL theme={null}
curl --location 'https://api-uat.pfm.equal.in/pfm/user/fidata?fiType=ETF' \
--header 'Content-Type: application/json' \
--header 'authorization: eyJh...' \
--data ''
```

```javascript JavaScript theme={null}
const response = await fetch('https://api-uat.pfm.equal.in/pfm/user/fidata?fiType=ETF', {
  method: 'GET',
  headers: {
    'Content-Type': 'application/json',
    'authorization': 'eyJh...'
  }
});

const data = await response.json();
console.log('FI Data:', data);
```

```python Python theme={null}
import requests

url = "https://api-uat.pfm.equal.in/pfm/user/fidata"
headers = {
    "Content-Type": "application/json",
    "authorization": "eyJh..."
}
params = {
    "fiType": "ETF"
}

response = requests.get(url, headers=headers, params=params)
print(response.json())
```

## Authentication

This API requires Bearer token authentication:

| Header | Type | Required | Description |
| - | - | - | - |
| `authorization` | string | Yes | Bearer token obtained from the SDK Init API session |
| `content-type` | string | Yes | Must be set to `application/json` |

## Query Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `fiType` | string | Yes | The Financial Information type whose raw data should be returned. Valid values are `DEPOSIT`, `MUTUAL_FUNDS`, `EQUITIES`, `TERM_DEPOSIT`, `RECURRING_DEPOSIT`, `ETF`. |

## Response

### Success Response (200 OK)

When the FI data is successfully retrieved, the API returns an array of account-level records for the requested `fiType`. Each element represents one linked account of that type.

**Basic Response Structure:**

```json theme={null}
{
  "status": "SUCCESS",
  "data": [
    {
      // One record per linked account of the requested fiType.
      // Field-level details are documented in the Analytics Data Dictionary.
    }
  ]
}
```

| Field | Type | Description |
| - | - | - |
| `status` | string | Status of the API call. Will be `SUCCESS` for successful requests. |
| `data` | array | List of raw FI records for the requested `fiType`. Empty when the user has no data for that type (see `no_fidata` below). |

Every record shares a common account envelope (`linkReferenceNumber`, `maskedAccountNumber`, `fiType`, `bank`, `dataFetchTimeStamp`, and the account holder details), while the `summary` and `transactions` blocks carry fields specific to the requested `fiType`.

### Error Responses (400 Bad Request / 404 Not Found)

When the request fails due to authentication or data issues, the API returns specific error responses:

```json Invalid Session Token theme={null}
{
  "status": "FAILED",
  "message": "Error in processing request, please retry after sometime",
  "status_code": "invalid_session_token"
}
```

```json No FI Data Available theme={null}
{
  "status": "FAILED",
  "message": "No FI data present for the user",
  "status_code": "no_fidata"
}
```

```json Invalid FI Type theme={null}
{
  "status": "FAILED",
  "message": "Invalid FI Type",
  "status_code": "invalid_fitype"
}
```

| Field | Type | Description |
| - | - | - |
| `status` | string | Status of the API call. Will be `FAILED` for failed requests. |
| `message` | string | Human-readable error message explaining what went wrong. |
| `status_code` | string | Machine-readable error code for programmatic error handling. |

## Error Handling

| Error Code | HTTP Status | Description | Resolution |
| - | - | - | - |
| `invalid_session_token` | 400 Bad Request | The provided session token is invalid, expired, or malformed | Obtain a new session token using the SDK Init API |
| `no_fidata` | 404 Not Found | No FI data is available for the user for the requested `fiType` | Ensure the user has connected their financial accounts and data is available for that type |
| `invalid_fitype` | 400 Bad Request | The provided `fiType` parameter value is missing or not supported | Use a valid FI type from the supported list (DEPOSIT, MUTUAL\_FUNDS, EQUITIES, etc.) |

## Supported FI Types

The `fiType` parameter accepts the following values:

| FI Type | Description |
| - | - |
| `DEPOSIT` | Bank deposits and savings accounts |
| `MUTUAL_FUNDS` | Mutual Fund investments |
| `EQUITIES` | Equity investments and stocks |
| `TERM_DEPOSIT` | Fixed/Term deposits |
| `RECURRING_DEPOSIT` | Recurring deposit accounts |
| `ETF` | Exchange Traded Funds |

## Next Steps

After successfully retrieving FI data:

1. **Parse the Response**: Iterate over the `data` array to read each account's raw records
2. **Handle Different FI Types**: Call the API per `fiType` to assemble a full picture of the user's holdings
3. **Implement Caching**: Consider caching FI data to reduce API calls and improve performance
4. **Error Handling**: Implement proper error handling for token expiry and retry logic

## Security Considerations

* **Token Security**: Handle session tokens securely and avoid logging them
* **HTTPS Only**: Always use HTTPS when calling this API
* **Token Refresh**: Implement proper token refresh logic when tokens expire
* **Rate Limiting**: Be mindful of API rate limits and implement appropriate throttling
* **Encryption Support**: This API supports encryption. When encryption is enabled for your integration, both request and response payloads will be encrypted. See [API Encryption Guide](https://developer.moneyone.in/pfm/api-encryption-overview.md) for details.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.