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

# Update Invoice API

> Edit the review fields of a received invoice in Breezing, including dates, amounts, GL account, tax rate, and vendor details.



## OpenAPI

````yaml PATCH /invoices/{id}
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}:
    patch:
      tags:
        - Invoices
      summary: Edit a received invoice (review)
      description: >-
        Partial update of the review fields (only provided fields change; null
        clears a nullable field). Explicit input is validated, never silently
        dropped: a malformed day or decimal 400s.


        Rules mirrored from the dashboard: a "processing" invoice 409s (the scan
        is still running); an APPROVED invoice is immutable on every
        journal-relevant field (documentType, invoiceDate, glImpactDate,
        currency, amounts, account, vat, exchangeRate) and 409s when one is
        touched. Unapprove first, edit, re-approve. Notes, due date and vendor
        identity details stay editable after approval. Changing vendorName or
        invoiceNumber recomputes the possible-duplicate flag.


        Coding follows the invoice while it is in review: a changed account or
        vat is stamped onto every transaction linked to the invoice in the same
        call (history saved before the write; locked or processing rows keep
        their coding and come back as warnings), and codingApplied counts the
        rows written. A vendorName that resolves to an entity contact fills
        EMPTY coding from the entity defaults (defaultAccount / defaultVat);
        saved or explicitly sent coding is never overwritten.
      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/UpdateInvoiceBody'
      responses:
        '200':
          description: Invoice updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      updated:
                        type: integer
                      codingApplied:
                        type: integer
                        description: >-
                          Linked transactions that received the changed account
                          / vat in this call (0 unless the coding changed on a
                          review invoice with matched payments).
                      warnings:
                        type: array
                        items:
                          type: string
                        description: >-
                          Non-fatal notes (a locked transaction that kept its
                          coding, an unset AP Clearing account, ...).
                    required:
                      - updated
                      - codingApplied
                      - warnings
                required:
                  - success
                  - data
        '400':
          description: Bad request (no fields, malformed value)
          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: Invoice is still scanning, or approved and immutable
          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:
    UpdateInvoiceBody:
      type: object
      properties:
        documentType:
          type: string
          enum:
            - invoice
            - receipt
            - credit_note
            - other
          description: >-
            invoice, receipt and credit_note book journals (a credit note
            reverses them); other never books.
        vendorName:
          type: string
          nullable: true
          maxLength: 300
        vendorVatId:
          type: string
          nullable: true
          maxLength: 100
        vendorIban:
          type: string
          nullable: true
          maxLength: 100
        invoiceNumber:
          type: string
          nullable: true
          maxLength: 100
        invoiceDate:
          type: string
          nullable: true
          description: yyyy-MM-dd (UTC). Null clears. An impossible day 400s.
        dueDate:
          type: string
          nullable: true
          description: yyyy-MM-dd (UTC). Null clears.
        glImpactDate:
          type: string
          nullable: true
          description: >-
            yyyy-MM-dd (UTC) GL posting day override; null returns to the
            invoice date.
        currency:
          type: string
          nullable: true
          description: ISO 4217 code, e.g. "EUR".
        totalAmount:
          type: string
          nullable: true
          description: Decimal string. A non-decimal 400s.
        netAmount:
          type: string
          nullable: true
        vatAmount:
          type: string
          nullable: true
        account:
          type: string
          maxLength: 100
          description: >-
            GL account CODE from the chart of accounts (GET /company). Free text
            is not resolved.
        vat:
          type: string
          maxLength: 100
          description: Tax rate NAME from the company catalog (GET /taxes) or "no-vat".
        note:
          type: string
          maxLength: 2000
        exchangeRate:
          type: object
          nullable: true
          properties:
            rate:
              type: string
              maxLength: 40
              description: >-
                Positive decimal: how many units of the company currency one
                unit of the invoice currency buys.
          required:
            - rate
          description: >-
            Manual FX rate used at approval instead of the automatic day rate.
            Null returns to automatic. Same-currency invoices ignore it.

````

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