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

# PDF Analytics JSON

> Compute analytics from PDF bank statements and return the insights inline as JSON.

Runs the analytics journey over one or more PDF bank statements you reference by URL and
returns the computed insights as JSON.

PDF Analytics is a **two-step** flow:

<Steps>
  <Step title="Execute the journey">
    Call `POST /ie/transaction/journey/execute` with the bank-statement URLs. The response
    `data` is always **empty** at this stage — capture the `transaction_id` and
    `journey_transaction_id` it returns.
  </Step>

  <Step title="Fetch the data">
    Call `POST /ie/transaction/journey/data/fetch` with that `transaction_id` and
    `journey_transaction_id` to retrieve the computed analytics. The `data` shape matches
    [Analytics JSON](./analytics-json).
  </Step>
</Steps>

### Headers

Both calls use the same headers:

| Header          | Description                               |
| --------------- | ----------------------------------------- |
| `Content-Type`  | `application/json`                        |
| `Authorization` | `Basic <base64(client_id:client_secret)>` |

<Note>
  The `Authorization` value, `journey_id`, and `exchange_application_id` are provided by
  Moneyone during onboarding.
</Note>

## Step 1 — Execute the journey

Set `journey_id` to the value provided by Moneyone for this variant, and pass each bank-statement URL under
`input_data.bank_statement_data`.

<CodeGroup>
  ```bash cURL theme={null}
  curl --location --request POST 'https://equal-gms-uat.moneyone.in/ie/transaction/journey/execute' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Basic <base64(client_id:client_secret)>' \
    --data-raw '{
      "journey_id": "<journey_id>",
      "exchange_application_id": "gateway.equal.f20fec65-f5ef-4b33-b5eb-3cf79b701355",
      "input_data": {
        "bank_statement_data": [
          {
            "bank_statement_url": "<bank_statement_url>"
          }
        ]
      }
    }'
  ```
</CodeGroup>

| Field                                                 | Description                                                                   |
| ----------------------------------------------------- | ----------------------------------------------------------------------------- |
| `journey_id`                                          | Provided by Moneyone for this variant.                                        |
| `exchange_application_id`                             | Your exchange application ID provided by Moneyone.                            |
| `input_data.bank_statement_data[].bank_statement_url` | URL to a PDF bank statement. Add more objects to analyze multiple statements. |

### Response

The `data` object is **empty** here. Store the `transaction_id` and `journey_transaction_id`
for Step 2.

```json theme={null}
{
  "status": "SUCCESS",
  "message": "Success",
  "status_code": "success",
  "transaction_id": "ac573cd1-3323-45ac-bace-e315eb29b412",
  "journey_transaction_id": "EQ.GT.53c2c0ce-fb6d-4806-b6ee-f426131ef9f5#<journey_id>#4f7f739d130a4f74a5afb360ef35d620",
  "journey_id": "<journey_id>",
  "data": {}
}
```

## Step 2 — Fetch the data

Pass the `transaction_id` and `journey_transaction_id` returned by Step 1.

<CodeGroup>
  ```bash cURL theme={null}
  curl --location 'https://equal-gms-uat.moneyone.in/ie/transaction/journey/data/fetch' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Basic <base64(client_id:client_secret)>' \
    --data '{
      "transaction_id": "ac573cd1-3323-45ac-bace-e315eb29b412",
      "journey_transaction_id": "EQ.GT.53c2c0ce-fb6d-4806-b6ee-f426131ef9f5#<journey_id>#4f7f739d130a4f74a5afb360ef35d620"
    }'
  ```
</CodeGroup>

| Field                    | Description                                            |
| ------------------------ | ------------------------------------------------------ |
| `transaction_id`         | The `transaction_id` from the Step 1 response.         |
| `journey_transaction_id` | The `journey_transaction_id` from the Step 1 response. |

### Response

```json theme={null}
{
  "status": "SUCCESS",
  "message": "Success",
  "status_code": "success",
  "transaction_id": "ac573cd1-3323-45ac-bace-e315eb29b412",
  "journey_transaction_id": "EQ.GT.53c2c0ce-fb6d-4806-b6ee-f426131ef9f5#<journey_id>#4f7f739d130a4f74a5afb360ef35d620",
  "journey_id": "<journey_id>",
  "data": { <analytics data as JSON> }
}
```

### Response fields

| Field                    | Description                                               |
| ------------------------ | --------------------------------------------------------- |
| `status`                 | Overall status, e.g. `SUCCESS`.                           |
| `message`                | Human-readable status message.                            |
| `status_code`            | Machine-readable status code, e.g. `success`.             |
| `transaction_id`         | Unique ID for this analytics transaction.                 |
| `journey_transaction_id` | Fully-qualified journey transaction reference.            |
| `journey_id`             | The `journey_id` provided by Moneyone for this variant.   |
| `data`                   | The computed analytics, returned inline as a JSON object. |

<Note>
  The analytics output structure is configurable. To adjust the fields returned
  in `data`, contact `support@moneyone.in`.
</Note>
