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

# Track Status

> Track the AA journey to completion via webhook, status polling, or in-iframe UI events.

There are three ways to know when a journey reaches a terminal state. Pick whichever
fits your integration — they can also be combined.

* **Webhook** (recommended) — MoneyOne pushes a terminal notification to your endpoint.
* **Status Polling** — you pull the journey status with the `transactionId`.
* **UI Events** — if you embed the orchestration UI in an iframe, listen for `postMessage` events.

<Tabs>
  <Tab title="Webhook (Recommended)">
    The webhook is a terminal push: MoneyOne calls your configured endpoint once the
    journey reaches a final state, so you don't have to poll. For the AA flow, the
    `eventData` array contains a single `AA` block.

    <Note>
      To configure your webhook URL, contact `support@moneyone.in`.
    </Note>

    ### Successful AA journey

    ```json theme={null}
    {
      "timestamp": "2026-03-31T08:02:45.111480334Z",
      "transactionID": "ad277c38-ca13-49b0-befd-38343e221e6b",
      "eventType": "JOURNEY_COMPLETE",
      "eventStatus": "SUCCESS",
      "accountID": "ACC-78291",
      "eventData": [
        {
          "type": "AA",
          "status": "SUCCESS",
          "consents": [
            {
              "consentID": "6934dcbb-ee3f-4ea0-85dc-b564c9e5e1d2",
              "consentHandle": "7af9f26a-097c-4974-9e63-164a2b4c598e",
              "consentStatus": "CONSENT_APPROVED",
              "productID": "HOME2001",
              "fetchType": "PERIODIC",
              "fiFetch": "MANUAL",
              "dataFetchStatus": "SUCCESS",
              "accounts": [
                {
                  "linkRefNumber": "9bd5e87a-7916-49ff-8ee1-969375f4f5e3",
                  "fiStatus": "DELIVERED",
                  "fipID": "finsharebank",
                  "maskedAccountNumber": "XXXXXXXX1100"
                }
              ]
            }
          ]
        }
      ]
    }
    ```

    ### Failed AA journey

    When the user rejects consent (or AA cannot deliver data), the AA block reports a
    rejected consent with an empty `accounts` array and the top-level `eventStatus` is
    `FAILED`.

    ```json theme={null}
    {
      "timestamp": "2026-03-31T06:59:46.465644026Z",
      "transactionID": "c664bcaa-c0bf-4101-b9ac-31e6d78cdb48",
      "eventType": "JOURNEY_COMPLETE",
      "eventStatus": "FAILED",
      "accountID": "ACC-90342",
      "eventData": [
        {
          "type": "AA",
          "status": "FAILED",
          "consents": [
            {
              "consentID": null,
              "consentHandle": "974e2b5d-196e-4965-bea2-eb5bcce88e01",
              "consentStatus": "CONSENT_REJECTED",
              "productID": null,
              "fetchType": null,
              "fiFetch": null,
              "dataFetchStatus": "NOT_ATTEMPTED",
              "accounts": []
            }
          ]
        }
      ]
    }
    ```

    <Info>
      For the AA flow, `eventData` contains a single `AA` entry. There is no PDF entry.
    </Info>

    ### Top-level fields

    | Field           | Description                                          |
    | --------------- | ---------------------------------------------------- |
    | `timestamp`     | ISO-8601 time the event was emitted.                 |
    | `transactionID` | Transaction identifier for the journey.              |
    | `eventType`     | Always `JOURNEY_COMPLETE` for the terminal push.     |
    | `eventStatus`   | `SUCCESS` or `FAILED`.                               |
    | `accountID`     | Your account identifier for the user.                |
    | `eventData`     | Array of result blocks. For AA, a single `AA` block. |

    ### AA block fields

    | Field      | Description               |
    | ---------- | ------------------------- |
    | `type`     | Always `AA`.              |
    | `status`   | `SUCCESS` or `FAILED`.    |
    | `consents` | Array of consent results. |

    #### `consents[]` fields

    | Field             | Description                                         |
    | ----------------- | --------------------------------------------------- |
    | `consentID`       | Consent identifier (may be `null` on rejection).    |
    | `consentHandle`   | Consent handle.                                     |
    | `consentStatus`   | `CONSENT_APPROVED` or `CONSENT_REJECTED`.           |
    | `productID`       | Product the consent was created for.                |
    | `fetchType`       | `PERIODIC` or `ONETIME`.                            |
    | `fiFetch`         | `MANUAL` or `AUTOMATIC`.                            |
    | `dataFetchStatus` | `SUCCESS`, `FAILED`, `NO_DATA`, or `NOT_ATTEMPTED`. |
    | `accounts`        | Array of accounts delivered for the consent.        |

    #### `accounts[]` fields

    | Field                 | Description                                |
    | --------------------- | ------------------------------------------ |
    | `linkRefNumber`       | Link reference number for the account.     |
    | `fiStatus`            | Account delivery status, e.g. `DELIVERED`. |
    | `fipID`               | FIP identifier.                            |
    | `maskedAccountNumber` | Masked account number.                     |
  </Tab>

  <Tab title="Status Polling">
    If you prefer to pull the journey status rather than receive a webhook, poll this
    endpoint with the `transactionId`. For the AA flow, the response contains
    `health_check`, `aa`, and `analytics` steps.

    ### Endpoint

    ```
    POST /transaction/status
    ```

    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>/transaction/status' \
        --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}
    {
      "status": "SUCCESSFUL",
      "transaction_id": "<transaction_id>",
      "data": [
        {
          "type": "health_check",
          "status": "SUCCESSFUL",
          "data": {
            "healthy_fips": ["<fip_id_1>"],
            "unhealthy_fips": [],
            "fip_decisions": [
              { "fip": "<fip_id_1>", "decision": "FIP_HEALTHY" }
            ]
          }
        },
        {
          "type": "aa",
          "status": "SUCCESSFUL",
          "data": {
            "fips": [
              { "fip": "<fip_id_1>", "status": "DELIVERED" }
            ],
            "consents": [
              {
                "consentHandle": "<consent_handle>",
                "consentId": "<consent_id>",
                "consentStatus": "CONSENT_APPROVED",
                "productId": "<product_id>",
                "dataFetchStatus": "SUCCESS",
                "accounts": [
                  {
                    "linkRefNumber": "9bd5e87a-7916-49ff-8ee1-969375f4f5e3",
                    "fiStatus": "DELIVERED",
                    "fipID": "<fip_id_1>",
                    "maskedAccountNumber": "XXXXXXXX1100"
                  }
                ]
              }
            ]
          }
        },
        { "type": "analytics", "status": "SUCCESSFUL" }
      ],
      "message": null
    }
    ```

    ### Step types

    | Type           | Description                                  |
    | -------------- | -------------------------------------------- |
    | `health_check` | FIP health evaluation before the AA fetch.   |
    | `aa`           | Account Aggregator consent and data fetch.   |
    | `analytics`    | Analytics computation over the fetched data. |

    ### Step statuses

    | Status         | Meaning                                 |
    | -------------- | --------------------------------------- |
    | `SUCCESSFUL`   | The step completed successfully.        |
    | `UNSUCCESSFUL` | The step completed but did not succeed. |
    | `FAILED`       | The step failed.                        |
    | `SKIPPED`      | The step was skipped.                   |
    | `IN_PROGRESS`  | The step is currently running.          |
    | `PENDING`      | The step has not started yet.           |
    | `PARTIAL`      | The step completed partially.           |

    ### Overall statuses

    | Status         | Meaning                                    |
    | -------------- | ------------------------------------------ |
    | `SUCCESSFUL`   | The journey completed successfully.        |
    | `UNSUCCESSFUL` | The journey completed but did not succeed. |
    | `IN_PROGRESS`  | The journey is still running.              |
    | `SKIPPED`      | The journey was skipped.                   |
    | `PENDING`      | The journey has not started yet.           |

    ### Error Codes

    | HTTP Status                 | Condition                                                         |
    | --------------------------- | ----------------------------------------------------------------- |
    | `400 Bad Request`           | `transactionId` is missing or invalid in the request body.        |
    | `401 Unauthorized`          | Credentials are missing or invalid in the `Authorization` header. |
    | `500 Internal Server Error` | An unexpected server-side error occurred.                         |
  </Tab>

  <Tab title="UI Events">
    When the orchestration UI is embedded in an iframe, it communicates with the parent
    window using the browser [`postMessage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage)
    API. Your parent window can listen for these events to react the moment a journey
    reaches a terminal state.

    ### Event structure

    ```json theme={null}
    {
      "type": "REDIRECT",
      "eventCode": "JOURNEY-SUCCESS",
      "message": "Workflow completed successfully for transaction <transaction_id>",
      "statusData": { ... }
    }
    ```

    | Field        | Type   | Description                                   |
    | ------------ | ------ | --------------------------------------------- |
    | `type`       | string | Event type (e.g. `REDIRECT`).                 |
    | `eventCode`  | string | The event code (see below).                   |
    | `message`    | string | Human-readable message.                       |
    | `statusData` | object | The full status response for the transaction. |

    ### Event codes

    | Event Code                    | Trigger Condition                                          | Description                                 |
    | ----------------------------- | ---------------------------------------------------------- | ------------------------------------------- |
    | `JOURNEY-SUCCESS`             | `status === 'SUCCESSFUL'`                                  | Workflow completed successfully.            |
    | `JOURNEY-FAILURE`             | `status === 'UNSUCCESSFUL'`, `'EXPIRED'`, or `'CANCELLED'` | Workflow failed.                            |
    | `JOURNEY-SKIPPED`             | `status === 'SKIPPED'`                                     | Workflow was skipped.                       |
    | `JOURNEY-NETBANKING-REDIRECT` | Netbanking redirect required                               | User needs to be redirected for netbanking. |

    ### Listening for events

    ```javascript theme={null}
    window.addEventListener('message', (event) => {
      const { type, eventCode, message, statusData } = event.data;

      if (eventCode === 'JOURNEY-SUCCESS') {
        // Handle successful completion
        console.log('Workflow success:', statusData);
      } else if (eventCode === 'JOURNEY-FAILURE') {
        // Handle failure
        console.log('Workflow failed:', message);
      } else if (eventCode === 'JOURNEY-SKIPPED') {
        // Handle skipped journey
        console.log('Workflow skipped:', message);
      }
    });
    ```

    <Tip>
      For production integrations, verify `event.origin` against the orchestration UI's
      origin before trusting the payload.
    </Tip>
  </Tab>
</Tabs>

## Next step

Once the journey completes successfully, fetch the raw FI data or analytics on the
[Fetch Data](./fetch-data) page using the same `transaction_id`.
