> ## 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 Xero Account API

> Update or archive an account in the linked Xero organization from Breezing, addressed by its account code in the chart of accounts.



## OpenAPI

````yaml PATCH /xero/accounts/{code}
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/accounts/{code}:
    patch:
      tags:
        - Xero
      summary: Update a Xero account
      description: >-
        Partial update of one account in the linked Xero organization, addressed
        by its account code as it appears in the chart. Updatable: name, type,
        description, tax type, the payments and expense-claims flags, and status
        (ARCHIVED archives the account at Xero and removes it from the stored
        chart). The code itself never changes: transactions, assets, rules and
        mappings reference accounts by code. Xero applies its own rules (system
        accounts and bank account fields are restricted) and the message of a
        rejected change is returned as a 400. The stored chart entry is updated
        in the same call, so no refresh is needed. Returns 404 when no Xero
        account carries the code and 400 when Xero is not linked. Requires write
        access.
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 64
            description: >-
              The account code as it appears in the chart (URL-encoded when it
              carries reserved characters). For QuickBooks this is the account
              Id.
            example: '1200'
          required: true
          description: >-
            The account code as it appears in the chart (URL-encoded when it
            carries reserved characters). For QuickBooks this is the account Id.
          name: code
          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/UpdateXeroAccountBody'
      responses:
        '200':
          description: Xero account updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    $ref: '#/components/schemas/AccountingAccount'
                required:
                  - success
                  - data
        '400':
          description: Xero not linked, no fields to update, or Xero rejected the change
          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: No Xero account carries this code
          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:
    UpdateXeroAccountBody:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 150
          description: New display name (max 150 chars).
        type:
          type: string
          enum:
            - BANK
            - CURRENT
            - CURRLIAB
            - DEPRECIATN
            - DIRECTCOSTS
            - EQUITY
            - EXPENSE
            - FIXED
            - INVENTORY
            - LIABILITY
            - NONCURRENT
            - OTHERINCOME
            - OVERHEADS
            - PREPAYMENT
            - REVENUE
            - SALES
            - TERMLIAB
            - PAYG
          description: >-
            New Xero account type. Xero refuses a type change on bank accounts
            and on system accounts; its message comes back as a 400.
        description:
          type: string
          maxLength: 4000
          description: New description (not valid for BANK accounts).
        taxType:
          type: string
          description: New default Xero tax type code.
        enablePaymentsToAccount:
          type: boolean
          description: >-
            Whether payments can be applied to the account (required on the AP
            Clearing account used by invoice payments).
        showInExpenseClaims:
          type: boolean
          description: Whether the account is offered on expense claims.
        status:
          type: string
          enum:
            - ACTIVE
            - ARCHIVED
          description: >-
            ARCHIVED archives the account at Xero and removes it from the stored
            chart; ACTIVE restores an archived account.
    AccountingAccount:
      type: object
      properties:
        code:
          type: string
          nullable: true
          description: >-
            Account code/identifier. Use this exact value when setting
            `account`, `assetAccount`, or `feeAssetAccount` on a transaction or
            asset.
        name:
          type: string
          nullable: true
          description: Display name of the account.
        type:
          type: string
          description: >-
            Account type as reported by the accounting platform (e.g. "Bank",
            "Other Current Asset", "EXPENSE").
        classification:
          type: string
          nullable: true
          enum:
            - bank
            - currentAsset
            - fixedAsset
            - nonCurrentAsset
            - currentLiability
            - nonCurrentLiability
            - equity
            - revenue
            - otherIncome
            - costOfSales
            - expense
            - otherExpense
            - null
          description: >-
            Breezing statement classification derived from the account type
            (bank, currentAsset, fixedAsset, nonCurrentAsset, currentLiability,
            nonCurrentLiability, equity, revenue, otherIncome, costOfSales,
            expense, otherExpense), or null when the type could not be
            classified. Decides where the account lands on the Profit and Loss
            and Balance Sheet; editable per account on the Chart of Accounts
            page.
      required:
        - code
        - name
        - type
        - classification

````

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