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

# Collect several invoices with one transaction

> Settles two or more invoices with this transaction as one set: each invoice is paid its full outstanding balance, and the balances must add up to the transaction exactly. One reversible correction moves the payment onto AR; unapplying any invoice in the set unapplies all of them. Audited as an action_request.



## OpenAPI

````yaml /openapi.json post /api/transactions/{id}/collections
openapi: 3.1.0
info:
  title: Equated API
  version: 1.0.0
  description: >-
    Agent-facing accounting API. Authenticate with a bearer token issued from
    Settings → API Keys and MCP, or via the in-app session cookie when called
    from the web client.
servers:
  - url: https://app.equated.co
    description: API server
security: []
paths:
  /api/transactions/{id}/collections:
    post:
      tags:
        - Transactions
      summary: Collect several invoices with one transaction
      description: >-
        Settles two or more invoices with this transaction as one set: each
        invoice is paid its full outstanding balance, and the balances must add
        up to the transaction exactly. One reversible correction moves the
        payment onto AR; unapplying any invoice in the set unapplies all of
        them. Audited as an action_request.
      parameters:
        - schema:
            type: integer
            minimum: 0
            exclusiveMinimum: true
          required: true
          name: id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                documentIds:
                  type: array
                  items:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: true
                  minItems: 2
                  description: >-
                    Two or more confirmed documents, each paid in full; their
                    outstanding balances must add up to the transaction.
                adoptCounterparty:
                  type: boolean
                  description: >-
                    Also make the documents' counterparty the transaction's
                    merchant, in the same action. Every document must name the
                    same one.
              required:
                - documentIds
      responses:
        '200':
          description: Action execution result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionExecuteResult'
      security:
        - bearerAuth: []
components:
  schemas:
    ActionExecuteResult:
      type: object
      properties:
        actionRequestId:
          type: string
          nullable: true
        status:
          type: string
        changed:
          type: boolean
          description: >-
            False when nothing was applied: the row was already in that state,
            or the preview was stale or expired.
        result:
          $ref: '#/components/schemas/ActionMutationResult'
        error:
          type: string
      required:
        - actionRequestId
        - status
        - changed
        - result
    ActionMutationResult:
      type: object
      nullable: true
      properties:
        journalEntryIds:
          type: array
          items:
            type: integer
            minimum: 0
            exclusiveMinimum: true
        documentRelationIds:
          type: array
          items:
            type: integer
            minimum: 0
            exclusiveMinimum: true
        deletedJournalEntryIds:
          type: array
          items:
            type: integer
            minimum: 0
            exclusiveMinimum: true
        voidedJournalEntryIds:
          type: array
          items:
            type: integer
            minimum: 0
            exclusiveMinimum: true
      required:
        - journalEntryIds
        - documentRelationIds
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API token issued from the Equated app under Settings → API Keys and MCP.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.