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

# Record Invoice Payment API

> Record the Xero or QuickBooks payment for a published Breezing bill that still has an amount to pay, using its matched transactions.



## OpenAPI

````yaml POST /invoices/{id}/record-payment
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}/record-payment:
    post:
      tags:
        - Invoices
      summary: Record the provider payment for a published bill
      description: >-
        The standalone payment step for a published bill that still has
        something to pay. Xero direct settlement: records one payment for every
        matched transaction that has none yet, the same step publish runs, with
        the same payments list. Clearing mode and QuickBooks: applies the
        clearing-account payment for the full bill total, dated at the latest
        matched transaction day. 400 when the invoice is not published at that
        provider, when no transaction is matched, or when the provider refuses
        the payment; 409 when everything is already recorded.
      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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvoiceProviderBody'
      responses:
        '200':
          description: Payment attempted
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      payment:
                        type: string
                      paymentId:
                        type: string
                        nullable: true
                        description: >-
                          The payment recorded by this call (the latest one for
                          Xero direct settlement).
                      payments:
                        type: array
                        items:
                          $ref: '#/components/schemas/InvoiceMatchPayment'
                      warnings:
                        type: array
                        items:
                          type: string
                        description: >-
                          Non-fatal notes (a locked transaction that kept its
                          coding, an unset AP Clearing account, ...).
                    required:
                      - payment
                      - paymentId
                      - warnings
                required:
                  - success
                  - data
        '400':
          description: Not published, no matches, or the provider refused
          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: 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
        '409':
          description: Payment already recorded
          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:
    InvoiceProviderBody:
      type: object
      properties:
        provider:
          type: string
          enum:
            - xero
            - qbo
          description: >-
            Accounting provider. The company must be connected to it (GET
            /company: xeroLinked / qboLinked).
      required:
        - provider
    InvoiceMatchPayment:
      type: object
      properties:
        trxId:
          type: number
        status:
          type: string
          enum:
            - recorded
            - alreadyRecorded
            - skipped
            - failed
        accountCode:
          type: string
          nullable: true
          description: The asset account of the transaction the payment draws on.
        amount:
          type: string
          nullable: true
        paymentId:
          type: string
          nullable: true
        reason:
          type: string
          nullable: true
          description: Why the match was skipped or refused, null otherwise.
      required:
        - trxId
        - status
        - accountCode
        - amount
        - paymentId
        - reason

````

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