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

# Add Xero Journal Attachment API

> Send a file attached to a Breezing transaction to its Xero manual journal so the receipt or invoice sits next to the entry.



## OpenAPI

````yaml POST /xero/journal-attachments
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/journal-attachments:
    post:
      tags:
        - Xero
      summary: Attach a transaction file to its Xero journal
      description: >-
        Upload one of the transaction's attachments (a receipt, an invoice) to
        the Xero manual journal the transaction was synced to, so the evidence
        sits next to the entry in Xero. Synchronous. The transaction must
        already be synced (400 NOT_SYNCED otherwise) and the attachment must
        belong to it (404). The attachment's `xeroAttachmentId` is set on
        success; attaching the same file again sends the file again under the
        same name (breezing-<attachmentId>.<extension>), so check
        xeroAttachmentId on the attachment first.
      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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/XeroJournalAttachmentBody'
      responses:
        '200':
          description: File attached to the Xero journal
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      attached:
                        type: boolean
                        enum:
                          - true
                    required:
                      - attached
                required:
                  - success
                  - data
        '400':
          description: >-
            Integration not linked, or the transaction is not synced to Xero
            (NOT_SYNCED)
          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: Transaction or attachment 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:
    XeroJournalAttachmentBody:
      type: object
      properties:
        transactionId:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          description: >-
            A transaction already synced to Xero (its journal receives the
            file).
        attachmentId:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          description: >-
            An attachment of that transaction (POST
            /transactions/{id}/attachments or the dashboard upload).
      required:
        - transactionId
        - attachmentId

````

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