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

# Get parsed bank statement data

> Per-month deposits, withdrawals, balances, NSFs and negative days from analyzed bank statements, a summary with the revenue trend, the deal’s MCA positions (detected and manual), and statement coverage (which months are still missing per account). Returns `status: "not_analyzed"` with empty figures when no statement has been analyzed yet; it is not an error.



## OpenAPI

````yaml /openapi/public-v1.json get /v1/deals/{dealId}/statement-analysis
openapi: 3.0.0
info:
  title: NextLevel MCA Public API
  description: >-
    REST API for the NextLevel MCA deal platform. Objects flow Businesses →
    People → Deals → Submissions → Offers → Advances.


    **Authentication.** Send `Authorization: Bearer <key>` with an API key
    (`nlmca_live_…`, created in Settings → Developers) or an OAuth access token.
    Keys are scoped to one location.


    **Conventions.** JSON only. Cursor pagination (`limit` ≤ 100, `cursor` from
    `meta.next_cursor`). Every success is `{ data, meta }`; every error is `{
    error: { type, message, code, param, request_id } }`. POST endpoints accept
    `Idempotency-Key` (24h replay). Rate limit 300 requests/min per credential
    (`X-RateLimit-*` headers).


    **Scopes.** Keys with no scopes have all of them. Otherwise:

    - `businesses:read` — Read businesses and their notes, tasks and activity

    - `businesses:write` — Create and update businesses, notes and tasks

    - `people:read` — Read people (contacts and owners)

    - `people:write` — Create and update people

    - `deals:read` — Read deals, submissions and the pipeline

    - `deals:write` — Create and update deals, move stages

    - `documents:read` — Read documents and statement analysis

    - `documents:write` — Upload documents and request documents from merchants

    - `lenders:read` — Read lenders, criteria and lender matches

    - `lenders:write` — Create and update lenders and criteria

    - `submissions:write` — Submit deals to lenders and withdraw submissions

    - `offers:read` — Read offers

    - `offers:write` — Log and update offers, set the primary offer

    - `advances:read` — Read funded advances and renewal flags

    - `advances:write` — Update advances

    - `portal:send` — Generate and send merchant portal links

    - `webhooks:manage` — Manage webhook subscriptions
  version: '1.0'
  contact: {}
servers:
  - url: https://api.nextlevelmca.com
    description: Production
security:
  - bearer: []
tags:
  - name: Businesses
    description: Merchant businesses and their notes, tasks and activity
  - name: People
    description: Contacts and owners. Phone lookups normalise to E.164.
  - name: Deals
    description: Deals, stage moves, renewals and the pipeline
  - name: Documents
    description: Documents, presigned uploads, document requests and statement analysis
  - name: Lenders
    description: Lenders and their criteria
  - name: Lender matches
    description: Criteria-driven lender matching for a deal
  - name: Submissions
    description: Sending deals to lenders
  - name: Offers
    description: Lender offers and the primary offer
  - name: Advances
    description: Funded advances and renewal readiness
  - name: Merchant portal
    description: Magic links for the merchant portal
  - name: Webhooks
    description: Outbound event subscriptions
paths:
  /v1/deals/{dealId}/statement-analysis:
    get:
      tags:
        - Documents
      summary: Get parsed bank statement data
      description: >-
        Per-month deposits, withdrawals, balances, NSFs and negative days from
        analyzed bank statements, a summary with the revenue trend, the deal’s
        MCA positions (detected and manual), and statement coverage (which
        months are still missing per account). Returns `status: "not_analyzed"`
        with empty figures when no statement has been analyzed yet; it is not an
        error.
      operationId: documents_statementAnalysis
      parameters:
        - name: dealId
          required: true
          in: path
          description: Deal id
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    $ref: '#/components/schemas/StatementAnalysisDto'
                  meta:
                    $ref: '#/components/schemas/EmptyMetaDto'
        '401':
          description: Missing, invalid, expired or revoked credential.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelopeDto'
        '403':
          description: Credential lacks the scope, or the role lacks the permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelopeDto'
        '404':
          description: Resource not found in this location.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelopeDto'
        '429':
          description: Rate limit exceeded. See `X-RateLimit-*` and `Retry-After`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelopeDto'
      security:
        - bearer: []
components:
  schemas:
    StatementAnalysisDto:
      type: object
      properties:
        status:
          type: string
          enum:
            - not_analyzed
            - pending
            - processing
            - completed
            - failed
          description: >-
            `not_analyzed` when no statement has been parsed yet — every other
            field is empty or null then.
        analyzed_at:
          type: string
          nullable: true
          description: When the most recent statement finished processing (ISO 8601).
        months:
          description: Per-month figures, oldest first.
          type: array
          items:
            $ref: '#/components/schemas/StatementMonthDto'
        summary:
          description: Averages, totals and the revenue trend across `months`.
          allOf:
            - $ref: '#/components/schemas/StatementSummaryDto'
        positions:
          description: Existing MCA positions on the deal (detected + manual).
          type: array
          items:
            $ref: '#/components/schemas/StatementPositionDto'
        coverage:
          description: Do we have the months we need, per account?
          allOf:
            - $ref: '#/components/schemas/StatementCoverageDto'
        accounts:
          description: Accounts seen in the parsed statements.
          type: array
          items:
            $ref: '#/components/schemas/StatementAccountDto'
      required:
        - status
        - analyzed_at
        - months
        - summary
        - positions
        - coverage
        - accounts
    EmptyMetaDto:
      type: object
      properties: {}
    ErrorEnvelopeDto:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/PublicErrorDto'
      required:
        - error
    StatementMonthDto:
      type: object
      properties:
        month:
          type: string
          description: >-
            Calendar month, `YYYY-MM`. Figures are combined across all accounts
            for the month.
        deposits:
          type: number
          nullable: true
          description: >-
            Total true deposits (transfers and MCA credits excluded when the
            parser identified them).
        deposit_count:
          type: number
          nullable: true
          description: Number of deposits.
        withdrawals:
          type: number
          nullable: true
          description: Total debits.
        avg_daily_balance:
          type: number
          nullable: true
          description: Average daily balance (summed across accounts).
        ending_balance:
          type: number
          nullable: true
          description: Ending balance (summed across accounts).
        nsf_count:
          type: number
          nullable: true
          description: NSF / returned-item count.
        negative_days:
          type: number
          nullable: true
          description: Days with a negative balance (max across accounts).
        mca_debits:
          type: number
          nullable: true
          description: MCA debits detected in the month.
        statement_count:
          type: number
          description: Number of statements (accounts) that make up this month.
      required:
        - month
        - deposits
        - deposit_count
        - withdrawals
        - avg_daily_balance
        - ending_balance
        - nsf_count
        - negative_days
        - mca_debits
        - statement_count
    StatementSummaryDto:
      type: object
      properties:
        avg_monthly_deposits:
          type: number
          nullable: true
          description: Mean of monthly deposits over the analyzed months.
        avg_daily_balance:
          type: number
          nullable: true
          description: Mean of monthly average daily balances.
        nsf_count:
          type: number
          nullable: true
          description: Total NSF count across analyzed months.
        negative_days:
          type: number
          nullable: true
          description: Total negative days across analyzed months.
        revenue_trend:
          type: string
          nullable: true
          enum:
            - up
            - flat
            - down
          description: >-
            Deposits in the most recent half of the period vs the earlier half:
            `up` ≥ +10%, `down` ≤ −10%, else `flat`. Null with fewer than 2
            months.
        months_analyzed:
          type: number
          description: Months with parsed data.
      required:
        - avg_monthly_deposits
        - avg_daily_balance
        - nsf_count
        - negative_days
        - revenue_trend
        - months_analyzed
    StatementPositionDto:
      type: object
      properties:
        id:
          type: string
          nullable: true
          description: Position id on the deal.
        funder_name:
          type: string
          description: Funder / MCA company name.
        payment_amount:
          type: number
          nullable: true
          description: Recurring payment amount.
        payment_frequency:
          type: string
          nullable: true
          enum:
            - daily
            - weekly
            - bi-weekly
            - monthly
          description: Payment cadence.
        current_balance:
          type: number
          nullable: true
          description: Estimated remaining balance.
        original_amount:
          type: number
          nullable: true
          description: Original funded amount, when known.
        position_number:
          type: number
          nullable: true
          description: Position number (1st, 2nd, …).
        detected:
          type: boolean
          description: >-
            True when the position was detected from bank statements rather than
            entered manually.
      required:
        - id
        - funder_name
        - payment_amount
        - payment_frequency
        - current_balance
        - original_amount
        - position_number
        - detected
    StatementCoverageDto:
      type: object
      properties:
        required_months:
          type: number
          description: Full months the location requires (settings, default 3).
        mtd_required:
          type: boolean
          description: >-
            True when a month-to-date statement for the current month is also
            required.
        complete:
          type: boolean
          description: True when every account has every required month.
        status:
          type: string
          enum:
            - complete
            - missing
            - needs_analysis
            - no_statements
          description: >-
            `needs_analysis` = statements were uploaded but not run through
            analysis yet.
        summary:
          type: string
          description: One-line human summary.
        missing:
          description: Gaps per account.
          type: array
          items:
            $ref: '#/components/schemas/StatementCoverageMissingDto'
        unanalyzed_documents:
          type: number
          description: Uploaded bank statements that have not been analyzed.
      required:
        - required_months
        - mtd_required
        - complete
        - status
        - summary
        - missing
        - unanalyzed_documents
    StatementAccountDto:
      type: object
      properties:
        bank_name:
          type: string
          description: Bank name as parsed.
        account_last_four:
          type: string
          nullable: true
          description: Last four digits of the account.
        months_covered:
          description: Required months that are covered, `YYYY-MM`.
          type: array
          items:
            type: string
        months_missing:
          description: Required months that are missing, `YYYY-MM`.
          type: array
          items:
            type: string
      required:
        - bank_name
        - account_last_four
        - months_covered
        - months_missing
    PublicErrorDto:
      type: object
      properties:
        type:
          type: string
          enum:
            - validation_error
            - authentication_error
            - permission_error
            - not_found
            - conflict
            - rate_limit_error
            - api_error
        message:
          type: string
          description: Human-readable explanation, safe to show to an operator or an agent.
        code:
          type: string
          description: >-
            Stable machine-readable code, e.g. `missing_scope`,
            `duplicate_business`.
        param:
          type: string
          description: Request field the error refers to, when applicable.
        request_id:
          type: string
          description: Echo of the `X-Request-Id` header. Quote it when contacting support.
      required:
        - type
        - message
        - request_id
    StatementCoverageMissingDto:
      type: object
      properties:
        bank_name:
          type: string
          description: Bank name of the account with the gap.
        account_last_four:
          type: string
          nullable: true
          description: Last four digits of the account.
        month:
          type: string
          description: Missing month, `YYYY-MM`.
        label:
          type: string
          description: Human label, e.g. `Aug 2026` or `Sep 2026 (MTD)`.
      required:
        - bank_name
        - account_last_four
        - month
        - label
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: API key or JWT
      type: http
      description: API key (`nlmca_live_…`) or OAuth access token

````

## Related topics

- [Documents and uploads](/guides/documents-and-uploads.md)
- [MCP server](/mcp/overview.md)
- [Webhooks](/guides/webhooks.md)
