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

# Suggest Invoice Matches API

> Get the outgoing Breezing transactions most likely to have paid a received invoice, scored by amount and date, ready to link.



## OpenAPI

````yaml GET /invoices/{id}/suggested-matches
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:
  /invoices/{id}/suggested-matches:
    get:
      tags:
        - Invoices
      summary: Suggest payment matches
      description: >-
        Score the company's outgoing transactions against this invoice and
        return the best candidates (max 10): token amount equal to the invoice
        total in the invoice currency within 1%, or the fiat amount within 1%
        when the company currency equals the invoice currency, inside a date
        window around the invoice/due date. Transactions already linked to any
        invoice of the company are never suggested again. Empty when the invoice
        has no total or currency yet. Link one with POST /invoices/{id}/match.
      parameters:
        - schema:
            type: string
            description: Invoice ID
            example: '42'
          required: true
          description: Invoice ID
          name: id
          in: path
        - 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
      responses:
        '200':
          description: Suggestions computed
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      suggestions:
                        type: array
                        items:
                          type: object
                          properties:
                            trxId:
                              type: number
                            matchedOn:
                              type: string
                              description: >-
                                Which amount arm matched: token amount in the
                                invoice currency, or the company-currency fiat
                                amount.
                            diffRatio:
                              type: string
                              description: Relative amount difference (1% tolerance).
                            daysApart:
                              type: number
                            trx:
                              $ref: '#/components/schemas/InvoiceMatchTransaction'
                          required:
                            - trxId
                            - matchedOn
                            - diffRatio
                            - daysApart
                            - trx
                    required:
                      - suggestions
                required:
                  - success
                  - data
        '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: Invoice 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
        '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:
    InvoiceMatchTransaction:
      type: object
      nullable: true
      properties:
        id:
          type: number
        date:
          type: number
          description: Transaction time (unix ms)
        direction:
          type: string
          nullable: true
        token:
          type: string
          nullable: true
        amount:
          type: string
          nullable: true
        amountFiat:
          type: string
          nullable: true
        walletId:
          type: number
          nullable: true
        transactionId:
          type: string
          nullable: true
          description: External reference (chain hash, exchange id).
        exchangeId:
          type: number
          nullable: true
          description: Set when the transaction is one leg of an exchange trade.
        isLocked:
          type: boolean
        counterparty:
          type: string
          description: >-
            Resolved counterparty (contact name, else address) on the side the
            money went to for an out row.
      required:
        - id
        - date
        - direction
        - token
        - amount
        - amountFiat
        - walletId
        - transactionId
        - exchangeId
        - isLocked
        - counterparty
      description: The linked transaction, null when it has since been deleted.

````

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