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

# Get cash flow statement

> 
        Retrieve a Cash Flow Statement (Indirect Method) for a business within a date range.

        **Important:** Both posted and draft journal entries are included in the calculations.

        **Cash Flow Sections:**
        - **Operating Activities**: Net profit + Non-cash adjustments + Working capital changes
        - **Investing Activities**: Changes in non-current assets (PPE, intangibles)
        - **Financing Activities**: Changes in equity and long-term debt

        **Summary metrics returned:**
        - net_cash_from_operating_cents: Cash flow from operating activities
        - net_cash_from_investing_cents: Cash flow from investing activities
        - net_cash_from_financing_cents: Cash flow from financing activities
        - net_change_in_cash_cents: Total change in cash position
        - opening_cash_cents: Cash balance at period start
        - closing_cash_cents: Cash balance at period end

        **Cash Reconciliation:**
        The report includes a reconciliation to verify:
        Opening Cash + Net Change = Closing Cash

        **Detail levels:**
        - `summary` (default): Returns only summary metrics + reconciliation
        - `detailed`: Returns summary + line item breakdown by account

        **Key filters:**
        - Cash accounts: Accounts where is_cash_account=True
        - Non-cash expenses: Accounts where is_non_cash_expense=True (depreciation, etc.)
        - Working capital: Current assets (excl. cash) and current liabilities

        All values are in cents. Currency is the business's base currency.

        Accounting standards validated: IAS 7, ASC 230, FRS 102, RJ 360
        



## OpenAPI

````yaml GET /v1/platform/businesses/{business_id}/reports/cash-flow/
openapi: 3.0.3
info:
  title: Thredfi Accounting Platform API
  version: 1.0.0
  description: >-
    Comprehensive API for accounting, invoice management, open banking, and
    intelligence services.
servers: []
security: []
paths:
  /v1/platform/businesses/{business_id}/reports/cash-flow/:
    get:
      tags:
        - Reports
      summary: Get cash flow statement
      description: |2-

                Retrieve a Cash Flow Statement (Indirect Method) for a business within a date range.

                **Important:** Both posted and draft journal entries are included in the calculations.

                **Cash Flow Sections:**
                - **Operating Activities**: Net profit + Non-cash adjustments + Working capital changes
                - **Investing Activities**: Changes in non-current assets (PPE, intangibles)
                - **Financing Activities**: Changes in equity and long-term debt

                **Summary metrics returned:**
                - net_cash_from_operating_cents: Cash flow from operating activities
                - net_cash_from_investing_cents: Cash flow from investing activities
                - net_cash_from_financing_cents: Cash flow from financing activities
                - net_change_in_cash_cents: Total change in cash position
                - opening_cash_cents: Cash balance at period start
                - closing_cash_cents: Cash balance at period end

                **Cash Reconciliation:**
                The report includes a reconciliation to verify:
                Opening Cash + Net Change = Closing Cash

                **Detail levels:**
                - `summary` (default): Returns only summary metrics + reconciliation
                - `detailed`: Returns summary + line item breakdown by account

                **Key filters:**
                - Cash accounts: Accounts where is_cash_account=True
                - Non-cash expenses: Accounts where is_non_cash_expense=True (depreciation, etc.)
                - Working capital: Current assets (excl. cash) and current liabilities

                All values are in cents. Currency is the business's base currency.

                Accounting standards validated: IAS 7, ASC 230, FRS 102, RJ 360
                
      operationId: get_cash_flow_statement
      parameters:
        - in: path
          name: business_id
          schema:
            type: string
            format: uuid
          description: Business UUID
          required: true
        - in: query
          name: detail_level
          schema:
            type: string
            enum:
              - detailed
              - summary
            default: summary
          description: 'Level of detail: ''summary'' or ''detailed'''
        - in: query
          name: end_date
          schema:
            type: string
            format: date
          description: Report period end date (YYYY-MM-DD)
          required: true
        - in: query
          name: start_date
          schema:
            type: string
            format: date
          description: Report period start date (YYYY-MM-DD)
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CashFlowStatement'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
          description: Validation errors in request data
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Authentication required - missing or invalid API key
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Permission denied - insufficient privileges
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Resource not found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Conflict - resource already exists or invalid state transition
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable entity - business logic validation failed
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal server error
      security:
        - PartnerJWT: []
        - BusinessScopedJWT: []
        - BasicAuth: []
        - BearerUnscoped: []
        - BearerBusinessScoped: []
components:
  schemas:
    CashFlowStatement:
      type: object
      description: |-
        Complete Cash Flow Statement response (IAS 7 Indirect Method).

        Always includes:
        - Summary metrics
        - Cash reconciliation check

        When detail_level='detailed', also includes:
        - Operating activities breakdown
        - Investing activities by account
        - Financing activities by account
      properties:
        business_id:
          type: string
          format: uuid
          description: Business UUID
        start_date:
          type: string
          format: date
          description: Report period start date
        end_date:
          type: string
          format: date
          description: Report period end date
        currency:
          type: string
          description: Business base currency (ISO 4217)
        detail_level:
          enum:
            - summary
            - detailed
          type: string
          x-spec-enum-id: 42d5883c5aa0b3a9
          description: |-
            'summary' or 'detailed'

            * `summary` - summary
            * `detailed` - detailed
        summary:
          allOf:
            - $ref: '#/components/schemas/CashFlowSummary'
          description: Cash flow summary metrics
        cash_reconciliation:
          allOf:
            - $ref: '#/components/schemas/CashReconciliation'
          description: Cash reconciliation check (Opening + Change = Closing)
        operating_activities:
          allOf:
            - $ref: '#/components/schemas/OperatingActivities'
          description: Operating activities breakdown (detailed view only)
        investing_activities:
          allOf:
            - $ref: '#/components/schemas/CashFlowSection'
          description: Investing activities by account (detailed view only)
        financing_activities:
          allOf:
            - $ref: '#/components/schemas/CashFlowSection'
          description: Financing activities by account (detailed view only)
      required:
        - business_id
        - cash_reconciliation
        - currency
        - detail_level
        - end_date
        - start_date
        - summary
    ValidationErrorResponse:
      type: object
      description: Validation error response with field-specific errors
      properties:
        error_code:
          type: string
          description: Error code (e.g., 'validation_error')
        message:
          type: string
          nullable: true
          description: Human-readable error message
        detail:
          type: object
          additionalProperties: {}
          description: Contains field_errors and additional context
        request_id:
          type: string
          description: Request ID for tracing
      required:
        - detail
        - error_code
        - message
    ErrorResponse:
      type: object
      description: Standard error response format
      properties:
        error_code:
          type: string
          description: Error code for programmatic handling
        message:
          type: string
          nullable: true
          description: Human-readable error message
        detail:
          type: object
          additionalProperties: {}
          description: Additional error details including field_errors and debug info
        request_id:
          type: string
          description: Request ID for tracing
      required:
        - error_code
        - message
    CashFlowSummary:
      type: object
      description: |-
        Cash Flow Statement summary metrics.

        Per IAS 7, cash flows are classified into:
        - Operating: Cash from core business operations
        - Investing: Cash from acquisition/disposal of long-term assets
        - Financing: Cash from changes in equity and borrowings
      properties:
        net_cash_from_operating_cents:
          type: integer
          description: >-
            Net cash from operating activities (Net Profit + Non-cash + Working
            Capital changes)
        net_cash_from_investing_cents:
          type: integer
          description: Net cash from investing activities (fixed asset purchases/sales)
        net_cash_from_financing_cents:
          type: integer
          description: Net cash from financing activities (equity + debt changes)
        net_change_in_cash_cents:
          type: integer
          description: Total change in cash = Operating + Investing + Financing
        opening_cash_cents:
          type: integer
          description: Cash balance at period start
        closing_cash_cents:
          type: integer
          description: Cash balance at period end
      required:
        - closing_cash_cents
        - net_cash_from_financing_cents
        - net_cash_from_investing_cents
        - net_cash_from_operating_cents
        - net_change_in_cash_cents
        - opening_cash_cents
    CashReconciliation:
      type: object
      description: |-
        Cash reconciliation check per IAS 7.45.

        Validates that: Opening Cash + Net Change = Closing Cash
      properties:
        opening_cash_cents:
          type: integer
          description: Cash balance at period start
        net_change_cents:
          type: integer
          description: Total change in cash during period
        calculated_closing_cents:
          type: integer
          description: Opening + Net Change (should equal actual)
        actual_closing_cents:
          type: integer
          description: Actual cash balance at period end
        reconciles:
          type: boolean
          description: True if calculated equals actual closing cash
      required:
        - actual_closing_cents
        - calculated_closing_cents
        - net_change_cents
        - opening_cash_cents
        - reconciles
    OperatingActivities:
      type: object
      description: |-
        Operating Activities breakdown (Indirect Method).

        Starting with Net Profit, adjusts for:
        - Non-cash items (depreciation, amortisation)
        - Working capital changes (receivables, payables, inventory)
      properties:
        net_profit_cents:
          type: integer
          description: Net profit from P&L statement
        non_cash_adjustments:
          allOf:
            - $ref: '#/components/schemas/CashFlowSection'
          description: Non-cash expenses added back (depreciation, amortisation, etc.)
        working_capital_changes:
          allOf:
            - $ref: '#/components/schemas/CashFlowSection'
          description: Changes in current assets (excl. cash) and current liabilities
      required:
        - net_profit_cents
        - non_cash_adjustments
        - working_capital_changes
    CashFlowSection:
      type: object
      description: >-
        A section within Cash Flow Statement (e.g., Non-cash Adjustments,
        Investing Activities).


        Contains display name, total, and optionally line items.
      properties:
        display_name:
          type: string
          description: Section display name
        total_cents:
          type: integer
          description: Section total in cents
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/CashFlowLineItem'
          description: Individual account movements
      required:
        - display_name
        - total_cents
    CashFlowLineItem:
      type: object
      description: |-
        Individual account line item in Cash Flow Statement.

        Represents a single Account with its movement during the period.
      properties:
        account_id:
          type: string
          format: uuid
          description: Account UUID
        account_code:
          type: string
          description: Account code
        account_name:
          type: string
          description: Account name
        value_cents:
          type: integer
          description: Movement amount in cents (positive = inflow, negative = outflow)
      required:
        - account_code
        - account_id
        - account_name
        - value_cents
  securitySchemes:
    PartnerJWT:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Partner-level JWT token (unscoped). Token payload includes `partner_id`.
        Business access is validated via partner ownership. Format: `Bearer
        <your-jwt-token>`


        **Use this for**: Multi-business operations where the business_id is
        specified in the URL and partner has access to multiple businesses.
    BusinessScopedJWT:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Business-scoped JWT token. Token payload includes `business_id` to
        automatically scope requests. Format: `Bearer <your-jwt-token>`


        **Use this for**: Business-specific operations where the business
        context is embedded in the token.
    BasicAuth:
      type: http
      scheme: basic
      description: >-
        Basic authentication for OAuth2 token endpoint. Use partner_uuid:api_key
        as username:password. Example: Authorization: Basic
        base64(partner_uuid:api_key)
    BearerUnscoped:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Partner (unscoped) JWT Bearer token. Obtain via POST
        /v1/platform/oauth2/token with Basic auth (partner_uuid:api_key). Use
        header: Authorization: Bearer {access_token}
    BearerBusinessScoped:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Business-scoped JWT Bearer token. Obtain via POST
        /v1/platform/{business_id}/oauth2/token/ using a partner Bearer token.
        Only valid for endpoints whose URL contains that business_id.

````