> ## 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 PDF-sourced 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 extracted from the uploaded bank statements. Each item is
    normalized into a consistent shape with profile, summary, and transaction details. For
    the PDF flow, every item has `dataSource` and `type` set to `PDF`.

    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": "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"
            }
          ]
        }
        ```

        ### Response fields

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

        <Note>
          For the PDF flow, `dataSource` and `type` are always `PDF`. PDF items may additionally
          include `dataFetchTimeStamp` and per-transaction `valueDate` fields compared to AA-sourced data.
        </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 upload 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` of `PDF`.

        ```json theme={null}
        {
          "timestamp": "2024-06-23T10:30:00.000Z",
          "transactionID": "txn_7f8a2b91c4d3e5f2",
          "eventType": "FI_DATA",
          "eventStatus": "SUCCESS",
          "accountID": "finpro_acc_381920",
          "data": [
            {
              "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" }
                ]
              }
            }
          ]
        }
        ```

        ### 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 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, each stamped with a `type` of `PDF`. The account fields (`Profile`, `Summary`, `Transactions`) match the **Pull** tab; PDF items carry `dataFetchTimeStamp` and per-transaction `valueDate`. |

        <Note>
          This is distinct from `JOURNEY_COMPLETE`, which reports upload 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 PDF data extracted during the journey. Request them
    with the `transactionId` in one of three output formats: JSON, XML, or Excel.

    <Note>
      **Normalized output.** Analytics are computed over the extracted data and normalized,
      so the analytics output shape is **identical regardless of whether the data originally
      came from AA or PDF**. You do not need to branch on the source when consuming analytics.
    </Note>

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