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

# Fetch Data

> Retrieve the raw Account Aggregator data or computed analytics for a completed journey.

Once the journey has succeeded, retrieve the data using the same `transactionId`.
You can fetch the normalized **raw FI data** or the **analytics** computed from it.

<Tabs>
  <Tab title="Raw FI Data">
    Fetch the raw financial information collected through Account Aggregator. Each item is
    normalized into a consistent shape with profile, summary, and transaction details. For
    the AA flow, every item has `dataSource` and `type` set to `AA`.

    You can obtain this data two ways: **pull** it on demand with `POST /getallfidata`, or have
    it **pushed** to your webhook as soon as it is ready. Both carry the same FI data records.

    <Tabs>
      <Tab title="Pull — POST /getallfidata">
        ### Endpoint

        ```
        POST /getallfidata
        ```

        Base URL (UAT / Production): Contact `support@moneyone.in`.

        ### Headers

        | Header           | Description                              |
        | ---------------- | ---------------------------------------- |
        | `Content-Type`   | `application/json`                       |
        | `client_id`      | Your client ID                           |
        | `client_secret`  | Your client secret                       |
        | `organisationId` | Your organisation ID                     |
        | `appIdentifier`  | Your app identifier                      |
        | `x-request-id`   | Optional request identifier for tracing. |

        ### Request body

        ```json theme={null}
        {
          "transactionId": "<transaction_id>"
        }
        ```

        ### Sample request

        <CodeGroup>
          ```bash cURL theme={null}
          curl --request POST \
            --url 'https://<base_url>/getallfidata' \
            --header 'Content-Type: application/json' \
            --header 'client_id: <your_client_id>' \
            --header 'client_secret: <your_client_secret>' \
            --header 'organisationId: <your_organisation_id>' \
            --header 'appIdentifier: <your_app_identifier>' \
            --data '{
              "transactionId": "<transaction_id>"
            }'
          ```
        </CodeGroup>

        ### Response

        ```json theme={null}
        {
          "ver": "1.21.0",
          "status": "success",
          "data": [
            {
              "linkReferenceNumber": "9bd5e87a-7916-49ff-8ee1-969375f4f5e3",
              "maskedAccountNumber": "XXXXXXXX1100",
              "fiType": "DEPOSIT",
              "bank": "finsharebank",
              "isTampered": false,
              "dataSource": "AA",
              "Profile": {
                "Holders": {
                  "Holder": [
                    { "name": "VAIBHAV SHUKLA", "mobile": "7307204576", "email": "vks@example.com", "pan": "ABCDE1234F" }
                  ]
                }
              },
              "Summary": {
                "currentBalance": "6981.1",
                "currency": "INR",
                "type": "saving",
                "ifscCode": "UBIN0824321"
              },
              "Transactions": {
                "startDate": "07-12-2024",
                "endDate": "25-01-2025",
                "Transaction": [
                  { "type": "credit", "amount": "5500.0", "currentBalance": "5501.0", "transactionTimestamp": "10-12-2024", "narration": "UPI/TRANSFER" }
                ]
              },
              "type": "AA"
            }
          ]
        }
        ```

        ### Response fields

        | Field                        | Description                                      |
        | ---------------------------- | ------------------------------------------------ |
        | `ver`                        | API version.                                     |
        | `status`                     | Response status, e.g. `success`.                 |
        | `data`                       | Array of account data items.                     |
        | `data[].type`                | Always `AA`.                                     |
        | `data[].linkReferenceNumber` | Link reference number for the account.           |
        | `data[].maskedAccountNumber` | Masked account number.                           |
        | `data[].fiType`              | Financial information type, e.g. `DEPOSIT`.      |
        | `data[].bank`                | FIP / bank identifier.                           |
        | `data[].isTampered`          | Whether the data was detected as tampered.       |
        | `data[].dataSource`          | Always `AA`.                                     |
        | `data[].Profile`             | Account holder profile details.                  |
        | `data[].Summary`             | Account summary (balance, currency, type, IFSC). |
        | `data[].Transactions`        | Transaction list with date range.                |

        <Note>
          For the AA flow, `dataSource` and `type` are always `AA`.
        </Note>

        ### Error Codes

        | HTTP Status                 | `status`  | `message`                                                                                                                                                               |
        | --------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
        | `401 Unauthorized`          | —         | Credentials are missing or invalid in the `Authorization` header.                                                                                                       |
        | `500 Internal Server Error` | `FAILURE` | `No workflow event found for transactionId: <id>` — the `transactionId` does not exist.                                                                                 |
        | `500 Internal Server Error` | `FAILURE` | `No AA or PDF data available for transactionId: <id>` — the journey has not delivered data yet; ensure the journey status is `SUCCESSFUL` before calling this endpoint. |
        | `500 Internal Server Error` | `FAILURE` | `Failed to fetch journey data` — an unexpected server-side error occurred.                                                                                              |
      </Tab>

      <Tab title="Push — Webhook">
        The `FI_DATA` webhook fires when the workflow completes and financial data is ready. Unlike
        `JOURNEY_COMPLETE` (which reports consent status only), `FI_DATA` carries the actual account
        data — balances, transactions, and holder profile. Accounts are returned in a single flat
        `data[]` array, each stamped with a `type` (`AA` for this flow).

        ```json theme={null}
        {
          "timestamp": "2024-06-23T10:30:00.000Z",
          "transactionID": "txn_7f8a2b91c4d3e5f2",
          "eventType": "FI_DATA",
          "eventStatus": "SUCCESS",
          "accountID": "finpro_acc_381920",
          "data": [
            {
              "type": "AA",
              "linkReferenceNumber": "LRN-HDFC-SB-7821930",
              "maskedAccountNumber": "XXXXXXXX1234",
              "fiType": "DEPOSIT",
              "bank": "HDFC",
              "isTampered": false,
              "Profile": {
                "Holders": {
                  "Holder": [
                    { "name": "Rahul Sharma", "mobile": "9876543210", "email": "rahul@example.com", "pan": "ABCDE1234F" }
                  ]
                }
              },
              "Summary": {
                "currentBalance": "150000.00",
                "currency": "INR",
                "type": "SAVINGS",
                "ifscCode": "HDFC0001234"
              },
              "Transactions": {
                "startDate": "2024-01-01",
                "endDate": "2024-06-23",
                "Transaction": [
                  { "type": "CREDIT", "amount": "50000.00", "currentBalance": "150000.00", "transactionTimestamp": "2024-06-20T09:15:00Z", "narration": "NEFT TRANSFER FROM EMPLOYER ABC" },
                  { "type": "DEBIT", "amount": "12500.00", "currentBalance": "137500.00", "transactionTimestamp": "2024-06-22T14:30:00Z", "narration": "UPI/PAYMENT/UTILITY/REF829341" }
                ]
              }
            }
          ]
        }
        ```

        ### Payload fields

        | Field           | Type           | Description                                                                                                                                                                                   |
        | --------------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
        | `timestamp`     | string         | ISO-8601 UTC dispatch time.                                                                                                                                                                   |
        | `transactionID` | string         | Orchestration transaction ID for the journey.                                                                                                                                                 |
        | `eventType`     | string         | Always `FI_DATA`.                                                                                                                                                                             |
        | `eventStatus`   | string         | `SUCCESS` when `data[]` has at least one account, `PARTIAL_SUCCESS` if some consents failed, `FAILED` when `data[]` is empty.                                                                 |
        | `accountID`     | string \| null | Your account identifier (`null` if not provided).                                                                                                                                             |
        | `data[]`        | array          | Flat array of FI account objects, each stamped with a `type` of `AA`. The account fields (`Profile`, `Summary`, `Transactions`) match the **Pull** tab; AA items carry `linkReferenceNumber`. |

        <Note>
          This is distinct from `JOURNEY_COMPLETE`, which reports consent status only. To receive
          `FI_DATA` webhooks, configure your endpoint with `support@moneyone.in`.
        </Note>
      </Tab>
    </Tabs>
  </Tab>

  <Tab title="Analytics">
    Analytics are computed from the AA data collected during the journey. Request them
    with the `transactionId` in one of three output formats: JSON, XML, or Excel.

    ### Endpoints

    ```
    POST /analytics/json
    POST /analytics/xml
    POST /analytics/excel
    ```

    Base URL (UAT / Production): Contact `support@moneyone.in`.

    ### Headers

    | Header           | Description                              |
    | ---------------- | ---------------------------------------- |
    | `Content-Type`   | `application/json`                       |
    | `client_id`      | Your client ID                           |
    | `client_secret`  | Your client secret                       |
    | `organisationId` | Your organisation ID                     |
    | `appIdentifier`  | Your app identifier                      |
    | `x-request-id`   | Optional request identifier for tracing. |

    ### Request body

    All three endpoints take the same body:

    ```json theme={null}
    {
      "transactionId": "<transaction_id>"
    }
    ```

    ### Sample requests

    <CodeGroup>
      ```bash Analytics JSON theme={null}
      curl --request POST \
        --url 'https://<base_url>/analytics/json' \
        --header 'Content-Type: application/json' \
        --header 'client_id: <your_client_id>' \
        --header 'client_secret: <your_client_secret>' \
        --header 'organisationId: <your_organisation_id>' \
        --header 'appIdentifier: <your_app_identifier>' \
        --data '{
          "transactionId": "<transaction_id>"
        }'
      ```

      ```bash Analytics XML theme={null}
      curl --request POST \
        --url 'https://<base_url>/analytics/xml' \
        --header 'Content-Type: application/json' \
        --header 'client_id: <your_client_id>' \
        --header 'client_secret: <your_client_secret>' \
        --header 'organisationId: <your_organisation_id>' \
        --header 'appIdentifier: <your_app_identifier>' \
        --data '{
          "transactionId": "<transaction_id>"
        }'
      ```

      ```bash Analytics Excel theme={null}
      curl --request POST \
        --url 'https://<base_url>/analytics/excel' \
        --header 'Content-Type: application/json' \
        --header 'client_id: <your_client_id>' \
        --header 'client_secret: <your_client_secret>' \
        --header 'organisationId: <your_organisation_id>' \
        --header 'appIdentifier: <your_app_identifier>' \
        --data '{
          "transactionId": "<transaction_id>"
        }'
      ```
    </CodeGroup>

    <Note>
      The analytics output format is configurable. To adjust the fields and structure
      returned for your product, contact `support@moneyone.in`.
    </Note>

    ### Error Codes

    | HTTP Status                 | `status`  | `message`                                                                                                                      |
    | --------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------ |
    | `401 Unauthorized`          | —         | Credentials are missing or invalid in the `Authorization` header.                                                              |
    | `404 Not Found`             | `FAILURE` | `No workflow event found for transactionId: <id>` — the `transactionId` does not exist.                                        |
    | `404 Not Found`             | `FAILURE` | `No AA or PDF data found for transactionId: <id>` — no deliverable data for this transaction.                                  |
    | `404 Not Found`             | `FAILURE` | `Journey execution failed` — the analytics computation did not complete successfully.                                          |
    | `500 Internal Server Error` | `FAILURE` | `Analytics journey ID not configured for format: <format>` — contact `support@moneyone.in` to configure the analytics journey. |
    | `500 Internal Server Error` | `FAILURE` | An unexpected server-side error occurred.                                                                                      |
  </Tab>
</Tabs>
