> ## 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 Issued Invoice API

> Update an issued invoice in Breezing to mark it as sent, extend its due date, or correct line items, with the total recalculated.



## OpenAPI

````yaml PATCH /sales-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:
  /sales-invoices/{id}:
    patch:
      tags:
        - Issued Invoices
      summary: Update an issued invoice
      description: >-
        Partial update: provided fields are merged over the stored document
        (nested customer/seller fields merge individually; `lines` replaces the
        whole list) and the total is re-derived. Typical uses: flip `status` to
        "sent" (books it), extend `dueDate`, fix a line. A booked invoice keeps
        its dates, currency, lines, accounts, VAT and discount (409) and cannot
        blank its invoice number or customer name (400): move it back to "draft"
        first, which is refused while payments are linked. Returns 404 if not
        found in this company.
      parameters:
        - schema:
            type: string
            description: Issued invoice ID
            example: '12'
          required: true
          description: Issued 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/UpdateIssuedInvoiceBody'
      responses:
        '200':
          description: Invoice saved
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      id:
                        type: number
                      totalAmount:
                        type: string
                        description: The server-derived document total.
                      bookedAt:
                        nullable: true
                        description: When it was booked; null when not in the books.
                    required:
                      - id
                      - totalAmount
                required:
                  - success
                  - data
        '400':
          description: No fields, or an invalid calendar day
          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
        '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:
    UpdateIssuedInvoiceBody:
      type: object
      properties:
        invoiceNumber:
          type: string
          maxLength: 100
        customer:
          type: object
          properties:
            name:
              type: string
              maxLength: 300
            address:
              type: string
              maxLength: 2000
            email:
              type: string
              maxLength: 200
        seller:
          type: object
          properties:
            name:
              type: string
              maxLength: 300
            address:
              type: string
              maxLength: 2000
            email:
              type: string
              maxLength: 200
            taxId:
              type: string
              maxLength: 200
            paymentDetails:
              type: string
              maxLength: 2000
              description: Bank/crypto payment instructions printed on the invoice.
        issueDate:
          type: string
          maxLength: 10
          description: Calendar day yyyy-MM-dd (UTC); "" = unset. An invalid day 400s.
        dueDate:
          type: string
          maxLength: 10
          description: Calendar day yyyy-MM-dd (UTC); "" = unset. An invalid day 400s.
        currency:
          type: string
          minLength: 1
          maxLength: 10
        vatInclusive:
          type: boolean
        discount:
          type: object
          nullable: true
          properties:
            mode:
              type: string
              enum:
                - percent
                - amount
            value:
              type: string
              maxLength: 40
          required:
            - mode
            - value
          description: >-
            Whole-invoice discount applied before VAT, pro-rata across VAT
            groups. Null = none.
        status:
          type: string
          enum:
            - draft
            - sent
            - paid
            - cancelled
        accentId:
          type: string
          maxLength: 20
        lines:
          type: array
          items:
            $ref: '#/components/schemas/IssuedInvoiceLine'
          minItems: 1
          maxItems: 200
          description: Replaces ALL lines when provided.
        notes:
          type: string
          maxLength: 4000
        logoDataUrl:
          type: string
          nullable: true
          maxLength: 400000
    IssuedInvoiceLine:
      type: object
      properties:
        id:
          type: string
          maxLength: 64
          description: Stable row key (optional; the dashboard uses it for edits).
        description:
          type: string
          maxLength: 500
        unit:
          type: string
          enum:
            - qty
            - hours
          description: >-
            "hours" bills time (quantity = hours, unitPrice = hourly rate); the
            math is identical. Default "qty".
        quantity:
          type: string
          maxLength: 40
          example: '2'
        unitPrice:
          type: string
          maxLength: 40
          example: '1500'
        vatName:
          type: string
          maxLength: 120
          description: Tax rate label printed on the document (e.g. "VAT 8.1%").
        vatRate:
          type: string
          maxLength: 40
          description: Percentage applied to the line, e.g. "8.1". "0" for none.
        account:
          type: string
          maxLength: 127
          description: >-
            The revenue account (a chart code, see GET /accounts) the line books
            to. Required on every line with an amount before the invoice can be
            sent.
      required:
        - description
        - quantity
        - unitPrice
        - vatName
        - vatRate

````

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