> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fintelite.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get merchant analysis

> Retrieve merchant transaction analysis with grouping and statistics



## OpenAPI

````yaml /api-specs/anycheck.yaml get /bank-statements/{id}/merchant-analysis
openapi: 3.0.3
info:
  title: AnyCheck API
  version: 1.0.0
  description: >
    # AnyCheck API Documentation


    The AnyCheck API (formerly KYB API) provides comprehensive business and
    identity verification services through a RESTful interface.


    ## Features

    - **Identity Verification**: KTP, NIK, and other identity document
    validation

    - **Business Documents**: BPKB, land certificates, and business registration
    verification

    - **Compliance**: PEP screening and fraud detection

    - **Bank Statement Analysis**: OCR extraction and financial analysis

    - **Template Management**: Create and manage verification templates

    - **Async Processing**: Queue-based verification with webhook notifications


    ## Authentication

    All endpoints (except `/ping` and `/health`) require authentication via the
    `X-API-Key` header.
  contact:
    name: API Support
    email: bd@fintelite.ai
  license:
    name: Proprietary
servers:
  - url: https://api.anycheck.ai
    description: Production server
security:
  - apiKey: []
tags:
  - name: Health
    description: Health check endpoints
  - name: Upload
    description: File upload operations
  - name: Authentication
    description: User authentication and registration
  - name: Groups
    description: Group resource management
  - name: Services
    description: Verification service operations
  - name: Folders
    description: Folder management for organizing verifications
  - name: Verifications
    description: Document verification operations
  - name: Templates
    description: Verification template management
  - name: Bank Statement Analysis
    description: Bank statement OCR extraction, review, and financial analytics
  - name: Drafts
    description: 'Draft verification management: save, edit, and submit verifications'
paths:
  /bank-statements/{id}/merchant-analysis:
    get:
      tags:
        - Bank Statement Analysis
      summary: Get merchant analysis
      description: Retrieve merchant transaction analysis with grouping and statistics
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Verification ID
        - name: page_offset
          in: query
          schema:
            type: integer
            minimum: 0
            default: 0
          description: Number of records to skip for pagination
        - name: page_size
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 10
          description: Number of records per page
        - name: transaction_type
          in: query
          schema:
            type: string
            enum:
              - CR
              - DB
          description: Filter by transaction type (CR for credit, DB for debit)
        - name: account_number
          in: query
          schema:
            type: string
          description: Filter by account number (optional)
      responses:
        '200':
          description: Merchant analysis data with pagination
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    description: Verification ID
                  merchant_analysis:
                    type: array
                    items:
                      $ref: '#/components/schemas/BSAMerchantAnalysis'
                  total:
                    type: integer
                    description: Total number of merchant groups
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '408':
          $ref: '#/components/responses/RequestTimeout'
components:
  schemas:
    BSAMerchantAnalysis:
      type: object
      properties:
        merchant_name:
          type: string
          description: Merchant or counterparty name
          example: ABC Company
        total_transaction:
          type: integer
          description: Total number of transactions with this merchant
          example: 5
        total_amount:
          type: number
          description: Total transaction amount with this merchant
          example: 2500000
        transactions:
          type: array
          items:
            $ref: '#/components/schemas/BSATransaction'
          description: List of transactions with this merchant
    BSATransaction:
      type: object
      properties:
        account_number:
          type: string
          description: Account number
          example: '1234567890'
        page_no:
          type: integer
          description: Page number in bank statement
          example: 1
        trx_date:
          type: string
          description: Transaction date
          example: '2023-01-15'
        trx_notes:
          type: string
          description: Transaction description/notes
          example: Transfer from ABC Company
        trx_types:
          type: string
          enum:
            - CR
            - DB
          description: Transaction type (CR for credit, DB for debit)
          example: CR
        category_type:
          type: string
          description: Transaction category
          example: Non-Recurring Miscellaneous Income
        is_operational:
          type: boolean
          description: Whether this is an operational transaction
          example: false
        merchant_name:
          type: string
          description: Merchant or counterparty name
          example: NINA NURSITA RAMADHAN
        trx_mutation_db_number:
          type: number
          description: Debit amount in original currency
          example: 0
        trx_mutation_cr_number:
          type: number
          description: Credit amount in original currency
          example: 200000
        balance_number:
          type: number
          description: Account balance after transaction
          example: 200000
        confidence_detail:
          type: object
          description: Confidence scores for extracted fields
          properties:
            page_no:
              type: number
              description: Confidence score for page number
              example: 0
            trx_date:
              type: number
              description: Confidence score for transaction date
              example: 0
            trx_notes:
              type: number
              description: Confidence score for transaction notes
              example: 0
            trx_types:
              type: number
              description: Confidence score for transaction type
              example: 0
            category_type:
              type: number
              description: Confidence score for category type
              example: 0
            is_operational:
              type: number
              description: Confidence score for operational flag
              example: 0
            merchant_name:
              type: number
              description: Confidence score for merchant name
              example: 0
            trx_mutation_amount:
              type: number
              description: Confidence score for transaction amount
              example: 0
            balance:
              type: number
              description: Confidence score for balance
              example: 0
            page_no_level:
              type: string
              description: Confidence level for page number
              example: LOW
            trx_date_level:
              type: string
              description: Confidence level for transaction date
              example: LOW
            trx_notes_level:
              type: string
              description: Confidence level for transaction notes
              example: LOW
            trx_types_level:
              type: string
              description: Confidence level for transaction type
              example: LOW
            category_type_level:
              type: string
              description: Confidence level for category type
              example: LOW
            is_operational_level:
              type: string
              description: Confidence level for operational flag
              example: LOW
            merchant_name_level:
              type: string
              description: Confidence level for merchant name
              example: LOW
            trx_mutation_amount_level:
              type: string
              description: Confidence level for transaction amount
              example: LOW
            balance_level:
              type: string
              description: Confidence level for balance
              example: LOW
        mutation_amount_base_currency:
          type: number
          description: Transaction amount converted to base currency
          example: 200000
        balance_base_currency:
          type: number
          description: Balance converted to base currency
          example: 200000
        clean_description:
          type: string
          description: Cleaned transaction description
          example: Transfer In
        is_operational_llm:
          type: boolean
          description: Operational classification by AI
          example: false
        is_operational_keyword:
          type: boolean
          nullable: true
          description: Operational classification by keyword matching
          example: true
        is_automatic_bank_transaction:
          type: boolean
          description: Whether this is an automatic bank transaction
          example: false
        is_circular_transaction:
          type: boolean
          description: Whether this is a circular transaction
          example: false
        is_kiting_transaction:
          type: boolean
          description: Whether this is a kiting transaction
          example: false
        is_big_transaction:
          type: boolean
          description: Whether this is a large transaction
          example: true
        is_round_transaction:
          type: boolean
          description: Whether this is a round number transaction
          example: true
        is_transfer_from_company_group:
          type: boolean
          description: Whether this is a transfer from company group
          example: false
        is_transfer_from_director:
          type: boolean
          description: Whether this is a transfer from director
          example: false
        is_transfer_from_supplier:
          type: boolean
          description: Whether this is a transfer from supplier
          example: false
        is_transfer_from_customer:
          type: boolean
          description: Whether this is a transfer from customer
          example: false
        is_pace_revenue:
          type: boolean
          description: Whether this is pace revenue
          example: true
        is_rm_revenue:
          type: boolean
          description: Whether this is RM revenue
          example: true
    ErrorResponse:
      type: object
      properties:
        error_code:
          type: string
          example: INVALID_REQUEST
          description: Error code identifying the type of error
        message:
          type: string
          example: Invalid request. Please check input data format and try again
          description: Human-readable error message
        errors:
          type: array
          description: Field-specific validation errors (optional)
          items:
            $ref: '#/components/schemas/FieldError'
    FieldError:
      type: object
      properties:
        field:
          type: string
          description: Name of the field with validation error
          example: service_id
        message:
          type: string
          description: Field-specific error message
          example: This field is required
      required:
        - field
        - message
  responses:
    BadRequest:
      description: Bad request - Invalid input data
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            required_field:
              summary: Required field missing
              value:
                error_code: INVALID_REQUEST
                message: Invalid request. Please check input data format and try again
                errors:
                  - field: service_id
                    message: This field is required
            invalid_format:
              summary: Invalid field format
              value:
                error_code: INVALID_REQUEST
                message: Invalid request. Please check input data format and try again
                errors:
                  - field: email
                    message: This field should be a valid email
                  - field: folder_id
                    message: Must be a valid UUID
            multiple_errors:
              summary: Multiple validation errors
              value:
                error_code: INVALID_REQUEST
                message: Invalid request. Please check input data format and try again
                errors:
                  - field: service_id
                    message: This field is required
                  - field: configuration
                    message: This field is required
                  - field: folder_id
                    message: Must be a valid UUID
    Unauthorized:
      description: Unauthorized - Authentication required or invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            invalid_api_key:
              summary: Invalid API key
              value:
                error_code: INVALID_API_KEY
                message: API key is invalid
            api_key_expired:
              summary: Expired API key
              value:
                error_code: API_KEY_EXPIRED
                message: API key is expired
            unauthorized:
              summary: Missing authentication
              value:
                error_code: UNAUTHORIZED
                message: You are not authorized to perform this action
    Forbidden:
      description: Forbidden - User lacks required permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error_code: FORBIDDEN
            message: You are forbidden to perform this action
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error_code: NOT_FOUND
            message: Resource not found
    RequestTimeout:
      description: Request timeout
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error_code: REQUEST_TIMEOUT
            message: Request timed out. Please try again later
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for service-to-service authentication

````