> ## 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.

# Group Internal Transactions API

> Group two or more Breezing transactions into one internal transfer with a single API request, assigning a shared internal ID across the legs.



## OpenAPI

````yaml POST /transactions/group-internals
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/group-internals:
    post:
      tags:
        - Transactions
      summary: Group transactions as an internal transfer
      description: >-
        Mark a set of transactions as a single internal transfer group. The
        server mints a new internalId and assigns it to every listed
        transaction, setting isInternal=true. Use this when you have identified
        two or more transactions that represent the same transfer between the
        user's own wallets (e.g. a withdrawal from Wallet A and the
        corresponding deposit on Wallet B).


        Returns 404 if any transaction is not found, 409 if any is locked or
        currently processing. Duplicate IDs in the input are deduplicated
        server-side; the response includes `dedupedFrom` (input length) when
        that differs from `updated`.


        The endpoint does NOT validate that the legs match (opposite directions,
        same amount, same token, etc.). It trusts the caller's selection. After
        grouping, the recommended workflow is Breezing's Auto Apply Account
        feature rather than manually setting accounts on each leg.


        To add transactions to an EXISTING internalId, use PATCH /transactions
        (batch) with `{ updates: { internalId: <existing>, isInternal: true }
        }`.
      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/GroupInternalsBody'
      responses:
        '200':
          description: Transactions grouped successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      internalId:
                        type: integer
                        description: >-
                          The newly minted internalId assigned to every grouped
                          transaction
                      updated:
                        type: integer
                        description: Number of transactions updated
                      dedupedFrom:
                        type: integer
                        description: >-
                          Original input length when duplicate IDs were deduped
                          server-side. Omitted when the input had no duplicates.
                    required:
                      - internalId
                      - updated
                required:
                  - success
                  - data
        '400':
          description: Bad request
          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:
    GroupInternalsBody:
      type: object
      properties:
        ids:
          type: array
          items:
            type: integer
          minItems: 1
          maxItems: 500
          description: >-
            Transaction IDs to group as a single internal transfer (max 500).
            The endpoint allocates a new internalId and assigns it to all listed
            transactions; isInternal is set to true. Duplicate IDs are
            deduplicated server-side.
      required:
        - ids

````