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

# Pull Analytics JSON

> Retrieve analytics results in JSON format for a processed PDF. Step 3 of the PDF Analytics flow.

## Overview

The Pull Analytics JSON API is the final step in the PDF Analytics flow. After the PDF processing is complete (confirmed via the [Pull Status](/api-reference/analytics/pdf-pull-status) API), use this endpoint to retrieve the analytics results in JSON format.

The response contains comprehensive banking analytics derived from the uploaded bank statement PDFs, similar to the [Analytics JSON](/api-reference/analytics/analytics-json) API output.

### PDF Analytics Flow

<Steps>
  <Step title="Push PDF">
    Upload bank statement PDFs using the [Push PDF](/api-reference/analytics/pdf-push) API. Receive a `ref_token`.
  </Step>

  <Step title="Check Status">
    Poll the [Pull Status](/api-reference/analytics/pdf-pull-status) API until processing is complete.
  </Step>

  <Step title="Pull Analytics JSON (this API)">
    Retrieve the analytics results using the `ref_token`.
  </Step>
</Steps>

### Important Notes

* Only call this API after the [Pull Status](/api-reference/analytics/pdf-pull-status) API confirms processing is complete.
* The response structure is similar to the [Analytics JSON](/api-reference/analytics/analytics-json) API, containing banking analysis, category-wise breakdowns, and account profiles.

## Authentication

This API requires authentication using the following headers:

<ParamField header="client_id" type="string" required>
  Your unique client identifier provided by FinPro during onboarding.
</ParamField>

<ParamField header="client_secret" type="string" required>
  Your confidential client secret key provided by FinPro. Must be kept secure.
</ParamField>

<ParamField header="appIdentifier" type="string" required>
  The unique identifier for your application.
</ParamField>

<ParamField header="organisationId" type="string" required>
  Your organization's unique identifier assigned by FinPro.
</ParamField>

<ParamField header="content-Type" type="string" required>
  Must be set to `application/json`.
</ParamField>

## Request Body

<ParamField body="ref_token" type="string" required>
  The reference token returned by the [Push PDF](/api-reference/analytics/pdf-push) API. This uniquely identifies the PDF processing job whose results you want to retrieve.
</ParamField>

### Request Example

```json theme={null}
{
  "ref_token": "34b11d14-1bee-4966-bcdc-c2c7ce9ff9a5"
}
```

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl --location --request POST '{{Base_URL}}/analytics/pdf/pull/json' \
  --header 'client_id: {{Client_Id}}' \
  --header 'client_secret: {{Client_Secret}}' \
  --header 'organisationId: {{Organisation_Id}}' \
  --header 'appIdentifier: {{App_Identifier}}' \
  --header 'Content-Type: application/json' \
  --data-raw '{
      "ref_token": "34b11d14-1bee-4966-bcdc-c2c7ce9ff9a5"
  }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('{{Base_URL}}/analytics/pdf/pull/json', {
    method: 'POST',
    headers: {
      'client_id': '{{Client_Id}}',
      'client_secret': '{{Client_Secret}}',
      'organisationId': '{{Organisation_Id}}',
      'appIdentifier': '{{App_Identifier}}',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      ref_token: '34b11d14-1bee-4966-bcdc-c2c7ce9ff9a5'
    })
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  url = "{{Base_URL}}/analytics/pdf/pull/json"

  headers = {
      "client_id": "{{Client_Id}}",
      "client_secret": "{{Client_Secret}}",
      "organisationId": "{{Organisation_Id}}",
      "appIdentifier": "{{App_Identifier}}",
      "Content-Type": "application/json"
  }

  payload = {
      "ref_token": "34b11d14-1bee-4966-bcdc-c2c7ce9ff9a5"
  }

  response = requests.post(url, json=payload, headers=headers)
  print(response.json())
  ```
</CodeGroup>


## OpenAPI

````yaml POST /analytics/pdf/pull/json
openapi: 3.0.3
info:
  title: FinPro API
  description: MoneyOne FinPro - Account Aggregator FIU Platform APIs
  version: 1.21.0
servers:
  - url: '{baseUrl}'
    description: FinPro API Server
    variables:
      baseUrl:
        default: https://scramblerpay-uat.moneyone.in
        description: API Base URL - change this to your environment
security:
  - clientId: []
    clientSecret: []
    organisationId: []
    appIdentifier: []
paths:
  /analytics/pdf/pull/json:
    post:
      tags:
        - Analytics
      summary: Pull Analytics JSON
      description: >-
        Retrieve analytics results in JSON format for a processed PDF. Step 3 of
        the PDF Analytics flow.
      operationId: pullPdfAnalyticsJson
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PdfRefTokenRequest'
            example:
              ref_token: 34b11d14-1bee-4966-bcdc-c2c7ce9ff9a5
      responses:
        '200':
          description: Analytics data retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyticsJsonResponse'
              example:
                ver: 1.21.0
                status: success
                data:
                  status: SUCCESS
                  message: Success
                  data:
                    bankingAnalysis:
                      overallAnalysis: {}
                      completeCategoryWiseAnalysis: {}
                      accountProfiles: []
                      fcuIndicators: {}
                      bounceAnalysis: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                ver: 1.21.0
                timestamp: '2025-10-01T11:49:28.920Z'
                errorCode: InvalidRequest
                errorMsg: Invalid ref_token or processing not complete
                status: FP0001
        '401':
          description: Authentication Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - clientId: []
          clientSecret: []
          organisationId: []
          appIdentifier: []
components:
  schemas:
    PdfRefTokenRequest:
      type: object
      description: >-
        Request body containing the reference token for PDF processing status or
        results.
      required:
        - ref_token
      properties:
        ref_token:
          type: string
          description: Reference token returned by the Push PDF API.
          example: 34b11d14-1bee-4966-bcdc-c2c7ce9ff9a5
    AnalyticsJsonResponse:
      type: object
      description: Response containing analytics data for a consent journey.
      properties:
        ver:
          type: string
          description: API version that processed the request.
          example: 1.21.0
        status:
          type: string
          description: Overall API call status.
          example: success
        data:
          type: object
          description: Analytics response payload.
          properties:
            status:
              type: string
              description: Processing status.
              example: SUCCESS
            message:
              type: string
              description: Status message.
              example: Success
            status_code:
              type: string
              description: Status code.
              example: success
            transaction_id:
              type: string
              description: Unique transaction identifier.
              example: 4aeb3514-ca16-4bfe-9233-ec165292b6c2
            journey_transaction_id:
              type: string
              description: Journey-specific transaction identifier.
            journey_id:
              type: string
              description: Journey identifier used for the analytics.
              example: orchestration_complete_analytics_json_v1
            data:
              type: object
              description: >-
                Contains bankingAnalysis and rawData objects with detailed
                analytics.
              properties:
                bankingAnalysis:
                  type: object
                  description: >-
                    Comprehensive banking analytics including overallAnalysis,
                    categoryWiseAnalysis, accountProfiles, fcuIndicators,
                    bounceAnalysis, investmentAnalysis, loanCreditsAnalysis,
                    nudges, abbTables, and paymentTypeAnalytics.
                rawData:
                  type: object
                  description: Raw financial data used to generate the analytics.
    ErrorResponse:
      type: object
      properties:
        ver:
          type: string
          description: API version
        timestamp:
          type: string
          format: date-time
          description: When the error occurred
        errorCode:
          type: string
          description: Error category code
        errorMsg:
          type: string
          description: Detailed error message
        status:
          type: string
          description: FinPro-specific error code (FPxxxx format)
  securitySchemes:
    clientId:
      type: apiKey
      in: header
      name: client_id
      description: Your unique client identifier provided by MoneyOne during FIU onboarding
    clientSecret:
      type: apiKey
      in: header
      name: client_secret
      description: Your confidential client secret provided by MoneyOne
    organisationId:
      type: apiKey
      in: header
      name: organisationId
      description: Your organization's unique identifier in the FinPro system
    appIdentifier:
      type: apiKey
      in: header
      name: appIdentifier
      description: Application-specific identifier for tracking API calls

````