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

# Consolidate Transactions API

> Consolidate Breezing transactions into daily or monthly summary rows with the roll-up API, merging amounts, fees, and fiat values per token.



## OpenAPI

````yaml POST /transactions/roll-up
openapi: 3.1.0
info:
  title: Breezing Public API
  version: 1.0.0
  description: >-
    Crypto accounting API for programmatic access and AI agents. Authenticate
    with an API key using the Authorization header: `Bearer brz_...`
servers:
  - url: https://api.breezing.io/v1
security:
  - BearerAuth: []
paths:
  /transactions/roll-up:
    post:
      tags:
        - Transactions
      summary: Consolidate transactions (roll up)
      description: >-
        Consolidate (roll up) a set of transactions, the API equivalent of
        "Consolidate Transactions (Roll up)" in the dashboard. The engine groups
        the selected transactions by period (day or month), token, and direction
        (optionally also by counterparty wallet), then replaces each
        multi-transaction group with a single consolidated row whose amount,
        fee, and fiat values are the sums of its members. The consolidated row
        records the original transaction IDs in its note. Original rows in a
        consolidated group are deleted; single-transaction groups and exchange
        trades (non-null exchangeId) are left unchanged.


        Roll-up is a per-wallet operation: walletId is required and every
        transaction in ids must belong to it, so rows from different wallets are
        never merged. This is irreversible (the original rows are removed), so
        select carefully. Returns 400 WALLET_MISMATCH if any id does not belong
        to walletId, 404 if any transaction is not found, 409 if any is locked
        or currently processing. Duplicate IDs are deduplicated server-side.
      parameters:
        - schema:
            type: string
            description: >-
              Organization ID. Use GET /v1/companies to discover available
              org/company pairs.
            example: '1'
          required: true
          description: >-
            Organization ID. Use GET /v1/companies to discover available
            org/company pairs.
          name: orgId
          in: query
        - schema:
            type: string
            description: >-
              Company ID. Use GET /v1/companies to discover available companies
              and their access levels.
            example: '1'
          required: true
          description: >-
            Company ID. Use GET /v1/companies to discover available companies
            and their access levels.
          name: companyId
          in: query
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RollUpBody'
      responses:
        '200':
          description: Transactions submitted to the consolidation engine
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      processed:
                        type: integer
                        description: >-
                          Number of distinct, unlocked transactions submitted to
                          the consolidation engine. Each period+token+direction
                          group with more than one transaction is replaced by a
                          single consolidated row; single-transaction groups and
                          exchange trades are left unchanged. Inspect GET
                          /transactions afterward.
                      dedupedFrom:
                        type: integer
                        description: >-
                          Original input length when duplicate IDs were deduped
                          server-side. Omitted when the input had no duplicates.
                    required:
                      - processed
                required:
                  - success
                  - data
        '400':
          description: >-
            Bad request, including WALLET_MISMATCH when an id does not belong to
            walletId
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '403':
          description: >-
            API key has no access to this company, has read-only access where
            write was required, or the company subscription is inactive
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '404':
          description: One or more transactions were not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '409':
          description: One or more transactions are locked or currently processing
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
      security:
        - BearerAuth: []
components:
  schemas:
    RollUpBody:
      type: object
      properties:
        ids:
          type: array
          items:
            type: integer
          minItems: 1
          maxItems: 500
          description: >-
            Transaction IDs to consolidate (max 500). All ids must belong to
            walletId. Transactions that belong to an exchange trade (non-null
            exchangeId) are skipped by the engine. Duplicate IDs are
            deduplicated server-side.
        type:
          type: string
          enum:
            - day
            - month
          description: >-
            Consolidation period. "day" merges same-token, same-direction
            transactions within each calendar day (the consolidated row is
            timestamped at 12:00 that day). "month" merges within each calendar
            month (timestamped on the 1st).
        groupByContact:
          type: boolean
          default: false
          description: >-
            When true, transactions are additionally grouped by counterparty
            wallet, so transfers involving different contacts are not merged
            together. Defaults to false.
        walletId:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          description: >-
            The wallet whose transactions are being consolidated. Roll-up is a
            per-wallet operation: every id in "ids" must belong to this wallet,
            otherwise the request fails with 400 WALLET_MISMATCH. Use GET
            /wallets to find IDs.
      required:
        - ids
        - type
        - walletId

````