> ## Documentation Index
> Fetch the complete documentation index at: https://docs.subly.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a transaction by ID

> Retrieves a single transaction by its unique ID.



## OpenAPI

````yaml GET /transactions/{id}
openapi: 3.1.0
info:
  title: Subly API
  description: >-
    The Subly API provides a comprehensive interface to manage your workspace's
    financial data, including expenses, revenue, transactions, and projects.
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: https://web.subly.app/api/v1
    description: Production API Server
security:
  - apiKeyAuth: []
tags:
  - name: Projects
    description: Manage projects to organize your financial items.
  - name: Expenses
    description: >-
      Operations related to workspace expenses, such as subscriptions or
      one-time costs.
  - name: Revenue
    description: Operations related to workspace revenue items.
  - name: Transactions
    description: Operations related to individual financial transactions.
paths:
  /transactions/{id}:
    parameters:
      - name: id
        in: path
        required: true
        description: The unique identifier for the transaction.
        schema:
          type: string
          format: uuid
    get:
      tags:
        - Transactions
      summary: Get a transaction by ID
      description: Retrieves a single transaction by its unique ID.
      responses:
        '200':
          description: The requested transaction.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
components:
  schemas:
    Transaction:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the transaction.
          readOnly: true
        sub_id:
          type: string
          format: uuid
          nullable: true
          description: ID of the linked expense, if applicable.
        revenue_item_id:
          type: string
          format: uuid
          nullable: true
          description: ID of the linked revenue item, if applicable.
        name:
          type: string
          description: A descriptive name for the transaction.
        amount:
          type: number
          format: float
          description: The value of the transaction.
        currency_code:
          type: string
          description: The ISO 4217 currency code for the transaction amount.
        date:
          type: string
          format: date-time
          description: The date and time the transaction occurred.
        type:
          type: string
          enum:
            - expense
            - revenue
          description: The type of transaction.
        category:
          type: string
          description: Organizational category for the transaction.
        tags:
          type: array
          items:
            type: integer
          description: Array of tag IDs.
        website:
          type: string
          format: uri
          description: Associated website, if any.
        workspace_id:
          type: string
          format: uuid
          description: Identifier of the workspace this transaction belongs to.
          readOnly: true
        project_id:
          type: string
          format: uuid
          description: Identifier of the project this transaction is assigned to.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: A message describing the error.
  responses:
    UnauthorizedError:
      description: Authentication error. The API key is missing, invalid, or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFoundError:
      description: The requested resource could not be found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Your private API key for authentication. This key identifies your
        workspace for all requests.

````