> ## 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 raw FI data (AA or PDF) or normalized analytics for a completed journey.

Once the journey is successful, retrieve the data using the same `transactionId`.
You can fetch the **raw FI data** (with a `dataSource` of `AA` or `PDF`) or the
**analytics** computed from it.

<Tabs>
  <Tab title="Raw FI Data">
    Fetch the raw financial-institution data. In the AA + PDF flow, each item carries a
    `dataSource` of either `AA` or `PDF`, depending on which path delivered it. The overall
    response shape is otherwise consistent across both sources.

    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
        ```

        <Info>
          Base URL (UAT / Production): **Contact [support@moneyone.in](mailto:support@moneyone.in)**
        </Info>

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

        <Note>
          This endpoint also accepts an optional `x-request-id` header for request tracing.
        </Note>

        ### Request body

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

        ### Response items

        A single response may contain a mix of `AA` and `PDF` items. The tabs below show one of each.

        <Tabs>
          <Tab title="PDF item">
            A PDF-sourced item has `dataSource` (and `type`) of `PDF`.

            ```json theme={null}
            {
              "linkReferenceNumber": "243212010002508",
              "maskedAccountNumber": "243212010002508",
              "fiType": "DEPOSIT",
              "bank": "ubi",
              "isTampered": false,
              "dataSource": "PDF",
              "dataFetchTimeStamp": "",
              "Profile": { "Holders": { "Holder": [ { "name": "VAIBHAV SHUKLA", "mobile": "7307204576", "email": "vks@example.com", "pan": "" } ] } },
              "Summary": { "currentBalance": "6981.1", "currency": "INR", "balanceDateTime": "25-01-2025", "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", "valueDate": "10-12-2024", "narration": "UPIAB/625496372022/CR/VAIBHAV" } ] },
              "type": "PDF"
            }
            ```
          </Tab>

          <Tab title="AA item">
            An AA-sourced item has `dataSource` (and `type`) of `AA` and the same overall structure.

            ```json theme={null}
            {
              "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"
            }
            ```
          </Tab>
        </Tabs>

        ### Full response envelope

        ```json theme={null}
        {
          "ver": "1.21.0",
          "status": "success",
          "data": [
            {
              "linkReferenceNumber": "243212010002508",
              "maskedAccountNumber": "243212010002508",
              "fiType": "DEPOSIT",
              "bank": "ubi",
              "isTampered": false,
              "dataSource": "PDF",
              "Profile": { "Holders": { "Holder": [ { "name": "VAIBHAV SHUKLA", "mobile": "7307204576", "email": "vks@example.com", "pan": "" } ] } },
              "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": "UPIAB/625496372022/CR/VAIBHAV" } ] },
              "type": "PDF"
            }
          ]
        }
        ```

        ### Response fields

        | Field                        | Description                                            |
        | ---------------------------- | ------------------------------------------------------ |
        | `ver`                        | API version.                                           |
        | `status`                     | `success` on a successful fetch.                       |
        | `data[]`                     | Array of FI data items (AA and/or PDF).                |
        | `data[].linkReferenceNumber` | Link reference number for the account.                 |
        | `data[].maskedAccountNumber` | Masked account number.                                 |
        | `data[].fiType`              | Financial instrument type (e.g. `DEPOSIT`).            |
        | `data[].bank`                | Bank identifier (e.g. `ubi`, `finsharebank`).          |
        | `data[].isTampered`          | `true` if tampering was detected.                      |
        | `data[].dataSource`          | `AA` or `PDF` — the path that delivered this item.     |
        | `data[].type`                | Mirrors `dataSource` (`AA` or `PDF`).                  |
        | `data[].Profile`             | Account holder profile (`Holders.Holder[]`).           |
        | `data[].Summary`             | Account summary (balance, currency, type, IFSC, etc.). |
        | `data[].Transactions`        | Statement period and the `Transaction[]` list.         |

        <Note>
          AA items follow the same structure shown above for AA-sourced data. A PDF item may additionally
          include fields such as `dataFetchTimeStamp` and per-transaction `valueDate`. Branch on `dataSource`
          if you need source-specific handling — otherwise the common fields can be read uniformly.
        </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. AA and PDF accounts appear together in a single flat
        `data[]` array, each stamped with a `type` (`AA` or `PDF`) so you can tell which path delivered it.

        ```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" }
                ]
              }
            },
            {
              "type": "PDF",
              "maskedAccountNumber": "XXXXXXXX5678",
              "fiType": "DEPOSIT",
              "bank": "SBI",
              "isTampered": false,
              "dataFetchTimeStamp": "2024-06-23T11:10:00.000Z",
              "Profile": {
                "Holders": {
                  "Holder": [
                    { "name": "Priya Menon", "mobile": "9123456780", "email": "priya@example.com", "pan": "FGHIJ5678K" }
                  ]
                }
              },
              "Summary": {
                "currentBalance": "82300.00",
                "currency": "INR",
                "balanceDateTime": "2024-06-22T00:00:00Z",
                "type": "SAVINGS",
                "ifscCode": "SBIN0009876"
              },
              "Transactions": {
                "startDate": "2024-03-01",
                "endDate": "2024-06-22",
                "Transaction": [
                  { "type": "CREDIT", "amount": "35000.00", "currentBalance": "82300.00", "transactionTimestamp": "2024-06-01T00:00:00Z", "valueDate": "2024-06-01", "narration": "SALARY JUNE 2024" },
                  { "type": "DEBIT", "amount": "8200.00", "currentBalance": "74100.00", "transactionTimestamp": "2024-06-05T00:00:00Z", "valueDate": "2024-06-05", "narration": "EMI PAYMENT/LOAN/REF441" }
                ]
              }
            }
          ]
        }
        ```

        When only one path delivers data, `data[]` simply contains items of that `type` — the array is flat
        either way. AA items carry `linkReferenceNumber`; PDF items carry `dataFetchTimeStamp` (and a
        `valueDate` on each transaction).

        ### 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 or statements failed, `FAILED` when `data[]` is empty.                                              |
        | `accountID`     | string \| null | Your account identifier (`null` if not provided).                                                                                                                                        |
        | `data[]`        | array          | Flat array of FI account objects mixing `AA` and `PDF` items. Each item's `type` is the discriminator; the account fields (`Profile`, `Summary`, `Transactions`) match the **Pull** tab. |

        <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">
    Fetch pre-computed analytics for a completed journey. Analytics are available in three formats, each
    with its own endpoint. The request body is the same for all three.

    ### Endpoints

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

    <Info>
      Base URL (UAT / Production): **Contact [support@moneyone.in](mailto:support@moneyone.in)**
    </Info>

    <Note>
      **Normalized output.** Analytics are computed over the delivered data and normalized across sources,
      so the analytics output shape is **identical regardless of `dataSource`** — whether the data arrived
      via AA or via the PDF fallback. You do not need to branch on the source when consuming analytics.
    </Note>

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

    <Note>
      These endpoints also accept an optional `x-request-id` header for request tracing.
    </Note>

    ### Request body

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

    ### Sample requests

    <Tabs>
      <Tab title="Analytics JSON">
        <CodeGroup>
          ```bash cURL theme={null}
          curl --location '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_org_id>' \
            --header 'appIdentifier: <your_app_identifier>' \
            --data '{ "transactionId": "<transaction_id>" }'
          ```
        </CodeGroup>
      </Tab>

      <Tab title="Analytics XML">
        <CodeGroup>
          ```bash cURL theme={null}
          curl --location '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_org_id>' \
            --header 'appIdentifier: <your_app_identifier>' \
            --data '{ "transactionId": "<transaction_id>" }'
          ```
        </CodeGroup>
      </Tab>

      <Tab title="Analytics Excel">
        <CodeGroup>
          ```bash cURL theme={null}
          curl --location '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_org_id>' \
            --header 'appIdentifier: <your_app_identifier>' \
            --data '{ "transactionId": "<transaction_id>" }'
          ```
        </CodeGroup>
      </Tab>
    </Tabs>

    <Info>
      The exact analytics fields and output configuration are set up per product. To enable a format or
      adjust the output, contact **[support@moneyone.in](mailto:support@moneyone.in)**.
    </Info>

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