> ## 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 Request

> Initiate a request to fetch financial information from the Account Aggregator for an approved consent.

## Overview

The FI Request API is used to initiate a request for Financial Information (FI) from the Account Aggregator system. This API triggers the data fetch process for accounts associated with an approved consent. The data flow is asynchronous, meaning the financial information is not returned immediately in this API's response but will be available once the fetch is completed.

### Key Use Cases

* **Automatic FI Fetch**: For automatic fetch types, the FinPro system handles FI requests automatically, so Financial Information Users (FIUs) do not need to explicitly call this API.
* **Periodic/Recurring Fetch**: For periodic or recurring fetch types, it is recommended to request incremental data only to optimize data transfer and processing.
* **Custom Date Range**: You can optionally specify a custom date range for the financial data you want to fetch, overriding the date range specified in the consent artefact.

### Important Notes

* Since the data flow is asynchronous, the FIU will not receive the actual Financial Information (FI) in the response of this API. Instead, use the FI Request Status API to check when the data is ready.
* If the `fiDataRange` parameters are not passed, the data is fetched according to the data range specified in the consent artefact.
* For periodic fetch types, if no date range is specified, incremental data is fetched automatically.

## Authentication

This API requires authentication using the following headers:

<ParamField header="client_id" type="string" required>
  Your unique client identifier provided by FinPro during onboarding. This ID is used to authenticate your application.
</ParamField>

<ParamField header="client_secret" type="string" required>
  Your confidential client secret key provided by FinPro. This must be kept secure and never exposed in client-side code.
</ParamField>

<ParamField header="appIdentifier" type="string" required>
  The unique identifier for your application (e.g., your application's package name or bundle ID). This helps FinPro identify which application is making the request.
</ParamField>

<ParamField header="organisationId" type="string" required>
  Your organization's unique identifier assigned by FinPro. This identifies your organization in the FinPro system.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Must be set to `application/json` to indicate that the request body contains JSON data.
</ParamField>

## Request Body

<ParamField body="consentId" type="string" required>
  The unique consent identifier provided by the Account Aggregator after the user has approved the consent. This ID links the FI request to a specific approved consent.
</ParamField>

<ParamField body="fiDataRangeFrom" type="string" optional>
  The start date from when the financial information statement is required. Must be in ISO 8601 date format with UTC timezone (e.g., `2021-05-01T16:49:48.297Z`). If not provided, the start date from the consent artefact will be used.
</ParamField>

<ParamField body="fiDataRangeTo" type="string" optional>
  The end date until when the financial information statement is required. Must be in ISO 8601 date format with UTC timezone (e.g., `2022-05-06T06:33:00.000Z`). This value must be less than or equal to the current UTC timestamp. If not provided, the end date from the consent artefact will be used.
</ParamField>

### Request Example

```json theme={null}
{
  "consentId": "54450ac0-8bcb-4b9c-ad74-29b4fabe18f7",
  "fiDataRangeFrom": "2021-05-01T16:49:48.297Z",
  "fiDataRangeTo": "2022-05-06T06:33:00.000Z"
}
```

## Response Parameters

<ResponseField name="ver" type="string" required>
  The version of the API that processed the request. This helps track which version of the API handled your request.
</ResponseField>

<ResponseField name="timestamp" type="string" required>
  The timestamp when the API response was generated, in UTC time format. This can be used for logging and debugging purposes.
</ResponseField>

<ResponseField name="response" type="string" required>
  The status of the API call. Returns `"ok"` when the FI request has been successfully initiated.
</ResponseField>

<ResponseField name="data" type="object" required>
  Contains the essential identifiers for tracking the FI request.

  <Expandable title="data properties">
    <ResponseField name="consentId" type="string" required>
      The consent ID for which the FI request was initiated. This confirms which consent the request is associated with.
    </ResponseField>

    <ResponseField name="sessionId" type="string" required>
      A unique session identifier generated for this particular FI request session. Use this ID with the FI Request Status API to check the status of this specific data fetch request.
    </ResponseField>
  </Expandable>
</ResponseField>

### Success Response Example

```json theme={null}
{
  "ver": "1.1.2",
  "timestamp": "2022-05-19T09:16:48.811Z",
  "response": "ok",
  "data": {
    "consentId": "54450ac0-8bcb-4b9c-ad74-29b4fabe18f7",
    "sessionId": "9d2b0920-389a-47cb-bd8f-d931dc0e801b"
  }
}
```

## Error Responses

### Invalid Consent ID

When the provided consent ID does not exist in the system:

```json theme={null}
{
  "ver": "1.21.0",
  "timestamp": "2025-10-01T11:46:13.293Z",
  "errorCode": "InvalidConsentId",
  "errorMsg": "Consent ID does not exist."
}
```

**HTTP Status Code**: `400 Bad Request`

### Common Error Scenarios

* **InvalidConsentId**: The provided consent ID does not exist in the FinPro system or has been deleted.
* **InvalidRequest**: The request body contains invalid data, such as malformed date formats or missing required fields.
* **ConsentExpired**: The consent has expired and can no longer be used to fetch financial information.
* **ConsentRevoked**: The user has revoked the consent, and it can no longer be used for data fetching.

## Rate Limiting

This API is subject to rate limiting to ensure fair usage and system stability:

* **Rate Limit**: 1000 requests per time window
* **Headers Returned**:
  * `X-RateLimit-Limit`: Maximum number of requests allowed
  * `X-RateLimit-Remaining`: Number of requests remaining in current window
  * `X-RateLimit-Reset`: Unix timestamp when the rate limit resets

If you exceed the rate limit, you will receive a `429 Too Many Requests` response.

## Usage Flow

1. **Obtain Consent**: Before calling this API, ensure you have successfully obtained user consent and received a `consentId` from the Account Aggregator.

2. **Initiate FI Request**: Call this API with the `consentId` to initiate the financial information fetch process. Optionally, specify custom date ranges if needed.

3. **Store Session ID**: Save the returned `sessionId` from the response. You will need this to check the status of the data fetch.

4. **Poll Status**: Use the FI Request Status API with the `sessionId` to periodically check when the data is ready for retrieval.

5. **Retrieve Data**: Once the status indicates the data is ready, use the Get All FI Data API to retrieve the actual financial information.

## Best Practices

* **Incremental Data Fetching**: For periodic/recurring consents, always request incremental data by specifying appropriate date ranges. This reduces processing time and bandwidth usage.

* **Session ID Management**: Always store the `sessionId` returned in the response. This is crucial for tracking the status of your data fetch request.

* **Error Handling**: Implement robust error handling to gracefully manage scenarios where the consent ID is invalid, expired, or revoked.

* **Asynchronous Processing**: Since this API is asynchronous, implement a polling mechanism or webhook handler to know when the data is ready. Do not expect immediate data availability.

* **Date Range Validation**: When specifying custom date ranges, ensure the `fiDataRangeTo` is not in the future and falls within the consent's approved date range.

* **Rate Limit Management**: Monitor the rate limit headers and implement backoff strategies to avoid hitting rate limits.


## OpenAPI

````yaml POST /fi/request
openapi: 3.0.3
info:
  title: FinPro API
  description: MoneyOne FinPro - Account Aggregator FIU Platform APIs
  version: 1.21.0
servers:
  - url: '{baseUrl}'
    description: FinPro API Server
    variables:
      baseUrl:
        default: https://scramblerpay-uat.moneyone.in
        description: API Base URL - change this to your environment
security:
  - clientId: []
    clientSecret: []
    organisationId: []
    appIdentifier: []
paths:
  /fi/request:
    post:
      tags:
        - Data Fetch
      summary: FI Request
      description: >-
        Initiate a request to fetch financial information from the Account
        Aggregator for an approved consent. This API triggers the data fetch
        process for accounts associated with an approved consent. The data flow
        is asynchronous, meaning the financial information is not returned
        immediately in this API's response but will be available once the fetch
        is completed.
      operationId: fiRequest
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FIRequestBody'
            example:
              consentId: 54450ac0-8bcb-4b9c-ad74-29b4fabe18f7
              fiDataRangeFrom: '2021-05-01T16:49:48.297Z'
              fiDataRangeTo: '2022-05-06T06:33:00.000Z'
      responses:
        '200':
          description: FI request initiated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FIRequestSuccessResponse'
              example:
                ver: 1.1.2
                timestamp: '2022-05-19T09:16:48.811Z'
                response: ok
                data:
                  consentId: 54450ac0-8bcb-4b9c-ad74-29b4fabe18f7
                  sessionId: 9d2b0920-389a-47cb-bd8f-d931dc0e801b
        '400':
          description: Bad Request - Invalid consent ID or validation failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                ver: 1.21.0
                timestamp: '2025-10-01T11:46:13.293Z'
                errorCode: InvalidConsentId
                errorMsg: Consent ID does not exist.
        '401':
          description: Authentication Failed - Invalid credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests - Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - clientId: []
          clientSecret: []
          organisationId: []
          appIdentifier: []
components:
  schemas:
    FIRequestBody:
      type: object
      required:
        - consentId
      properties:
        consentId:
          type: string
          format: uuid
          description: >-
            The unique consent identifier provided by the Account Aggregator
            after the user has approved the consent. This ID links the FI
            request to a specific approved consent.
        fiDataRangeFrom:
          type: string
          format: date-time
          description: >-
            The start date from when the financial information statement is
            required. Must be in ISO 8601 date format with UTC timezone (e.g.,
            2021-05-01T16:49:48.297Z). If not provided, the start date from the
            consent artefact will be used.
        fiDataRangeTo:
          type: string
          format: date-time
          description: >-
            The end date until when the financial information statement is
            required. Must be in ISO 8601 date format with UTC timezone (e.g.,
            2022-05-06T06:33:00.000Z). This value must be less than or equal to
            the current UTC timestamp. If not provided, the end date from the
            consent artefact will be used.
    FIRequestSuccessResponse:
      type: object
      properties:
        ver:
          type: string
          description: >-
            The version of the API that processed the request. This helps track
            which version of the API handled your request.
        timestamp:
          type: string
          format: date-time
          description: >-
            The timestamp when the API response was generated, in UTC time
            format. This can be used for logging and debugging purposes.
        response:
          type: string
          description: >-
            The status of the API call. Returns 'ok' when the FI request has
            been successfully initiated.
        data:
          type: object
          description: Contains the essential identifiers for tracking the FI request.
          properties:
            consentId:
              type: string
              format: uuid
              description: >-
                The consent ID for which the FI request was initiated. This
                confirms which consent the request is associated with.
            sessionId:
              type: string
              format: uuid
              description: >-
                A unique session identifier generated for this particular FI
                request session. Use this ID with the FI Request Status API to
                check the status of this specific data fetch request.
    ErrorResponse:
      type: object
      properties:
        ver:
          type: string
          description: API version
        timestamp:
          type: string
          format: date-time
          description: When the error occurred
        errorCode:
          type: string
          description: Error category code
        errorMsg:
          type: string
          description: Detailed error message
        status:
          type: string
          description: FinPro-specific error code (FPxxxx format)
  securitySchemes:
    clientId:
      type: apiKey
      in: header
      name: client_id
      description: Your unique client identifier provided by MoneyOne during FIU onboarding
    clientSecret:
      type: apiKey
      in: header
      name: client_secret
      description: Your confidential client secret provided by MoneyOne
    organisationId:
      type: apiKey
      in: header
      name: organisationId
      description: Your organization's unique identifier in the FinPro system
    appIdentifier:
      type: apiKey
      in: header
      name: appIdentifier
      description: Application-specific identifier for tracking API calls

````