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

# Get Event Transaction

> Returns a single financial transaction by ID, including line items (itemizations).

**Required permission:** `company.event:export`




## OpenAPI

````yaml /openapi/generated-external-api.yaml get /api/external/companies/{companyId}/events/{eventId}/financials/transactions/{transactionId}
openapi: 3.0.3
info:
  title: AI Insurance External API
  description: External API for AI Insurance platform
  version: 1.0.0
  contact:
    email: support@aiinsurance.io
servers:
  - url: https://app.aiinsurance.io
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/external/companies/{companyId}/events/{eventId}/financials/transactions/{transactionId}:
    get:
      tags:
        - Event Financials
      summary: Get Event Transaction
      description: >
        Returns a single financial transaction by ID, including line items
        (itemizations).


        **Required permission:** `company.event:export`
      operationId: getEventTransaction
      parameters:
        - $ref: '#/components/parameters/companyId'
        - $ref: '#/components/parameters/eventId'
        - $ref: '#/components/parameters/transactionId'
      responses:
        '200':
          description: Transaction details with line items
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventTransactionDetail'
              examples:
                withLineItems:
                  summary: Transaction with line items
                  value:
                    id: 550e8400-e29b-41d4-a716-446655440010
                    eventId: 550e8400-e29b-41d4-a716-446655440001
                    payeeId: 550e8400-e29b-41d4-a716-446655440051
                    transactionType: alae_invoice
                    status: owed
                    amount: 75000
                    invoiceNumber: INV-2025-002
                    invoiceDate: '2025-01-18'
                    dueDate: '2025-02-18'
                    paidDate: null
                    description: Legal fees
                    voidReason: null
                    isDraft: false
                    isForwardedInvoice: false
                    lineItems:
                      - id: 550e8400-e29b-41d4-a716-446655440060
                        lineItemName: Legal Fees
                        description: Initial consultation
                        amount: 50000
                      - id: 550e8400-e29b-41d4-a716-446655440061
                        lineItemName: Legal Fees
                        description: Document review
                        amount: 25000
                    createdAt: '2025-01-18T09:00:00.000Z'
                    createdBy: google-oauth2|123456789
                    updatedAt: null
                    updatedBy: null
                nonItemized:
                  summary: Non-itemized transaction (empty line items)
                  value:
                    id: 550e8400-e29b-41d4-a716-446655440010
                    eventId: 550e8400-e29b-41d4-a716-446655440001
                    payeeId: 550e8400-e29b-41d4-a716-446655440050
                    transactionType: indemnity_invoice
                    status: paid
                    amount: 500000
                    invoiceNumber: INV-2025-001
                    invoiceDate: '2025-01-15'
                    dueDate: '2025-02-15'
                    paidDate: '2025-01-20'
                    description: Initial claim payment
                    voidReason: null
                    isDraft: false
                    isForwardedInvoice: false
                    lineItems: []
                    createdAt: '2025-01-15T10:30:00.000Z'
                    createdBy: google-oauth2|123456789
                    updatedAt: '2025-01-20T14:00:00.000Z'
                    updatedBy: google-oauth2|123456789
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: Event or transaction not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                eventNotFound:
                  summary: Event not found
                  value:
                    error:
                      code: NOT_FOUND
                      message: Event not found
                transactionNotFound:
                  summary: Transaction not found
                  value:
                    error:
                      code: NOT_FOUND
                      message: Transaction not found
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    companyId:
      name: companyId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Company identifier
    eventId:
      name: eventId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Event identifier
    transactionId:
      name: transactionId
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Transaction identifier
  schemas:
    EventTransactionDetail:
      type: object
      description: A financial transaction with full details including line items
      allOf:
        - $ref: '#/components/schemas/EventTransaction'
        - type: object
          properties:
            lineItems:
              type: array
              items:
                $ref: '#/components/schemas/EventTransactionLineItem'
              description: Line items (itemizations) for the transaction
    ErrorResponse:
      type: object
      description: Standard error response for all external API endpoints
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Machine-readable error code
              example: VALIDATION_ERROR
            message:
              type: string
              description: Human-readable error message
              example: 'submissionId: Required field is missing'
            details:
              type: array
              description: Additional details for validation errors (field-level errors)
              items:
                type: object
                properties:
                  field:
                    type: string
                    description: The field that caused the error
                    example: submissionId
                  message:
                    type: string
                    description: Description of the field error
                    example: Required field is missing
    EventTransaction:
      type: object
      description: A financial transaction associated with an event
      properties:
        id:
          type: string
          format: uuid
          description: Transaction identifier
        eventId:
          type: string
          format: uuid
          description: Associated event identifier
        payeeId:
          type: string
          format: uuid
          nullable: true
          description: Associated payee identifier
        transactionType:
          type: string
          description: >-
            Transaction category identifier (e.g., "indemnity_invoice",
            "alae_invoice")
        status:
          $ref: '#/components/schemas/EventTransactionStatus'
        amount:
          type: integer
          description: Transaction amount in cents
        invoiceNumber:
          type: string
          nullable: true
          description: Invoice number for the transaction
        invoiceDate:
          type: string
          format: date
          nullable: true
          description: Invoice date (YYYY-MM-DD)
        dueDate:
          type: string
          format: date
          nullable: true
          description: Payment due date (YYYY-MM-DD)
        paidDate:
          type: string
          format: date
          nullable: true
          description: Date the transaction was paid (YYYY-MM-DD)
        description:
          type: string
          nullable: true
          description: Transaction description
        voidReason:
          type: string
          nullable: true
          description: Reason for voiding the transaction (only present if status is void)
        isDraft:
          type: boolean
          description: Whether the transaction is a draft
        isForwardedInvoice:
          type: boolean
          description: Whether the transaction is a forwarded invoice
        createdAt:
          type: string
          format: date-time
          description: When the transaction was created (ISO 8601)
        createdBy:
          type: string
          nullable: true
          description: User ID who created the transaction
        updatedAt:
          type: string
          format: date-time
          nullable: true
          description: When the transaction was last updated (ISO 8601)
        updatedBy:
          type: string
          nullable: true
          description: User ID who last updated the transaction
    EventTransactionLineItem:
      type: object
      description: A line item within an event transaction
      properties:
        id:
          type: string
          format: uuid
          description: Line item identifier
        lineItemName:
          type: string
          description: Account/category name for the line item
        description:
          type: string
          nullable: true
          description: Description of the line item
        amount:
          type: integer
          description: >-
            Line item amount in cents (signed - positive for debits on
            debit-normal accounts, negative for credits)
    EventTransactionStatus:
      type: string
      description: Status of a financial transaction
      enum:
        - owed
        - paid
        - approved
        - void
  responses:
    Unauthorized:
      description: Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingApiKey:
              summary: Missing API key
              value:
                error:
                  code: UNAUTHORIZED
                  message: Authorization header is required
            bearerTokenNotAllowed:
              summary: Bearer token used instead of API key
              value:
                error:
                  code: UNAUTHORIZED
                  message: External API endpoints require API key authentication
    Forbidden:
      description: Forbidden - Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            insufficientPermissions:
              summary: Insufficient permissions
              value:
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to perform this action
    InternalServerError:
      description: Internal Server Error - Unexpected error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internalError:
              summary: Unexpected server error
              value:
                error:
                  code: INTERNAL_ERROR
                  message: An unexpected error occurred. Please try again later.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication. Include your API key in the Authorization
        header.

````