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

# Refresh Xero Invoices API

> Pull outstanding Xero invoices into Breezing so invoice pickers and payment submission flows always work from the latest approved list.



## OpenAPI

````yaml POST /xero/invoices/refresh
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:
  /xero/invoices/refresh:
    post:
      tags:
        - Xero
      summary: Refresh Xero invoices
      description: >-
        Live-fetch outstanding invoices (status AUTHORISED, i.e. approved and
        awaiting payment) from the linked Xero organization AND write the result
        back onto `companies.xeroInvoices` so the Breezing app picks up the
        latest list on next load. Rows are sorted by contact name. The dashboard
        invoice picker uses this same list when booking a transaction as an
        invoice payment in Xero. Returns 400 if Xero is not linked.
      parameters:
        - 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: Xero invoices refreshed
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/XeroInvoice'
                required:
                  - success
                  - data
        '400':
          description: Xero is not linked for this company
          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
        '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:
    XeroInvoice:
      type: object
      properties:
        id:
          type: string
          description: Xero invoice ID (InvoiceID).
        name:
          type: string
          description: Contact name on the invoice.
        ref:
          type: string
          description: >-
            Invoice number, with the Xero reference appended in parentheses when
            set (e.g. "INV-0042 (PO-7)").
        date:
          type: string
          description: Invoice date as reported by Xero (YYYY-MM-DD).
        currency:
          type: string
          description: Invoice currency code (e.g. "USD").
        amountDue:
          type: number
          description: Amount still due on the invoice.

````