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

# Get bucketed cash-flow series

> Inflow, outflow and net over a caller-chosen window, bucketed by day, ISO week (Monday start), or calendar month. Buckets are calendar-aligned, half-open [period_start, period_end), UTC, contiguous and ascending; a quiet bucket reports real zeros, never an absent entry. The echoed period reflects the window after it is outward-snapped to bucket boundaries, not the raw request. Flows are gross (a movement between two of your own accounts counts once as inflow and once as outflow) — filtering to a single account_id, or to only one side of such a pair, is expected to make net non-zero; this is defined behavior, not a bug. See data_availability for missing or truncated transaction history.



## OpenAPI

````yaml /api-reference/platform-api.json get /v2/treasury/cash-flow
openapi: 3.0.0
info:
  title: Range Platform API
  description: >-
    The Range Platform API for workspace management, counterparties, and
    operational tooling.
  version: 1.7.22
  contact: {}
servers:
  - url: https://api.range.org
    description: Range API Server
security:
  - Authorization: []
  - Authorization: []
tags:
  - name: Address Information
    description: Get information about a crypto address.
  - name: Transfer Enrichments
    description: Attach workspace-scoped notes and categories to transfers.
  - name: Counterparties
    description: Manage external entities, their addresses, bank accounts, and documents.
paths:
  /v2/treasury/cash-flow:
    get:
      tags:
        - Treasury
      summary: Get bucketed cash-flow series
      description: >-
        Inflow, outflow and net over a caller-chosen window, bucketed by day,
        ISO week (Monday start), or calendar month. Buckets are
        calendar-aligned, half-open [period_start, period_end), UTC, contiguous
        and ascending; a quiet bucket reports real zeros, never an absent entry.
        The echoed period reflects the window after it is outward-snapped to
        bucket boundaries, not the raw request. Flows are gross (a movement
        between two of your own accounts counts once as inflow and once as
        outflow) — filtering to a single account_id, or to only one side of such
        a pair, is expected to make net non-zero; this is defined behavior, not
        a bug. See data_availability for missing or truncated transaction
        history.
      operationId: getCashFlow
      parameters:
        - name: group
          required: false
          in: query
          description: Filter accounts by group name (exact match, case-sensitive).
          schema:
            type: string
            example: Treasury
        - name: type
          required: false
          in: query
          schema:
            example: bank
            type: string
            enum:
              - eoa
              - multisig
              - contract
              - custodian
              - exchange
              - bank
              - defi
        - name: provider
          required: false
          in: query
          schema:
            example: utila
            type: string
            enum:
              - utila
              - kraken
              - binance
              - okx
              - bybit
              - bitget
              - gate
              - kucoin
              - plaid
              - squads
              - altitude
              - coinbase
              - realms
              - wise
              - safe
              - hyperliquid
              - cubist
              - privy
              - dfns
              - anchorage
              - revolut_business
              - turnkey
              - fordefi
              - coins_ph
              - fireblocks
              - pave_bank
              - copper
        - name: network
          required: false
          in: query
          description: Filter by account network/chain.
          schema:
            type: string
            example: ethereum
        - name: denom
          required: false
          in: query
          description: Filter balances and transfer legs by asset symbol.
          schema:
            type: string
            example: USDC
        - name: start_time
          required: false
          in: query
          description: >-
            Start of the window (ISO-8601; a bare YYYY-MM-DD is that UTC day).
            Defaults to 30 days before the effective end_time.
          schema:
            format: date-time
            example: '2026-08-01T00:00:00.000Z'
            type: string
        - name: end_time
          required: false
          in: query
          description: >-
            Exclusive end of the window (ISO-8601; a bare YYYY-MM-DD is the next
            UTC day). Defaults to now when omitted.
          schema:
            format: date-time
            example: '2026-09-01T00:00:00.000Z'
            type: string
        - name: bucket
          required: false
          in: query
          description: Bucket granularity.
          schema:
            default: day
            example: day
            type: string
            enum:
              - day
              - week
              - month
        - name: account_id
          required: false
          in: query
          description: >-
            Filter to a single account id. Endpoint-local — not part of the
            shared treasury account filters, so summary's and forecast's
            contracts are unaffected.
          schema:
            type: string
            example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TreasuryCashFlowResponseDto'
components:
  schemas:
    TreasuryCashFlowResponseDto:
      type: object
      properties:
        period:
          $ref: '#/components/schemas/TreasuryCashFlowPeriodDto'
        bucket:
          type: string
          enum:
            - day
            - week
            - month
          example: day
          description: The bucket granularity actually used.
        items:
          description: >-
            Ascending by period_start, contiguous (each period_end equals the
            next period_start). Empty when the filters match no accounts —
            distinct from a real series of zero-valued buckets.
          type: array
          items:
            $ref: '#/components/schemas/TreasuryCashFlowItemDto'
        totals:
          description: Rollup of every item above over the whole effective window.
          allOf:
            - $ref: '#/components/schemas/TreasuryCashFlowFiguresDto'
        data_availability:
          $ref: '#/components/schemas/TreasuryCashFlowDataAvailabilityDto'
      required:
        - period
        - bucket
        - items
        - totals
        - data_availability
    TreasuryCashFlowPeriodDto:
      type: object
      properties:
        start:
          type: string
          example: '2026-08-01T00:00:00.000Z'
        end:
          type: string
          example: '2026-09-01T00:00:00.000Z'
      required:
        - start
        - end
    TreasuryCashFlowItemDto:
      type: object
      properties:
        inflow_usd:
          type: string
          example: '1250.75'
          description: Exact decimal string, unrounded. "0" when nothing moved.
        outflow_usd:
          type: string
          example: '900.00'
          description: Exact decimal string, unrounded. "0" when nothing moved.
        net_usd:
          type: string
          example: '350.75'
          description: inflow_usd - outflow_usd, exact decimal string. Can be negative.
        transfer_count:
          type: number
          example: 4
          description: >-
            Contributing transfers (after the SELF and denom filters) behind the
            USD figures above — the population, whether or not it priced.
        unpriced_leg_count:
          type: number
          example: 0
          description: >-
            Matched legs (within transfer_count) whose USD could not be resolved
            (no provider-supplied price). Distinguishes a genuinely quiet bucket
            from one understated by missing prices.
        period_start:
          type: string
          example: '2026-08-15T00:00:00.000Z'
        period_end:
          type: string
          example: '2026-08-16T00:00:00.000Z'
          description: Exclusive — equals the next item's period_start.
      required:
        - inflow_usd
        - outflow_usd
        - net_usd
        - transfer_count
        - unpriced_leg_count
        - period_start
        - period_end
    TreasuryCashFlowFiguresDto:
      type: object
      properties:
        inflow_usd:
          type: string
          example: '1250.75'
          description: Exact decimal string, unrounded. "0" when nothing moved.
        outflow_usd:
          type: string
          example: '900.00'
          description: Exact decimal string, unrounded. "0" when nothing moved.
        net_usd:
          type: string
          example: '350.75'
          description: inflow_usd - outflow_usd, exact decimal string. Can be negative.
        transfer_count:
          type: number
          example: 4
          description: >-
            Contributing transfers (after the SELF and denom filters) behind the
            USD figures above — the population, whether or not it priced.
        unpriced_leg_count:
          type: number
          example: 0
          description: >-
            Matched legs (within transfer_count) whose USD could not be resolved
            (no provider-supplied price). Distinguishes a genuinely quiet bucket
            from one understated by missing prices.
      required:
        - inflow_usd
        - outflow_usd
        - net_usd
        - transfer_count
        - unpriced_leg_count
    TreasuryCashFlowDataAvailabilityDto:
      type: object
      properties:
        flows:
          type: string
          enum:
            - available
            - truncated
            - unavailable
          example: available
          description: >-
            Whether the flow figures could be aggregated. `available` includes
            the case where history exists but nothing moved in the window — a
            quiet bucket's zeros are real. `unavailable` when the matched
            account set has no synced transaction history at all. `truncated`
            when the transaction page-walk cap was hit; totals may under-count.
            Never `partial` on this endpoint.
        notes:
          example:
            - >-
              Trades are excluded from cash flow; only TRANSFER events are
              counted.
            - >-
              USD for legs without a provider-supplied price is valued at
              current spot, not price at event time.
          description: >-
            Two static notes always present, plus dynamic notes for the
            unavailable/truncated cases (same mechanism as the summary
            endpoint).
          type: array
          items:
            type: string
      required:
        - flows
        - notes
  securitySchemes:
    Authorization:
      type: apiKey
      in: header
      name: X-API-KEY
      description: Authorization method required to allow user to access the api endpoints.

````