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

# Get expense history



## OpenAPI

````yaml /.tooling/schemas/rest/tags/product-finops.json get /finops/v1/transactions/{transaction_id}/expense_history
openapi: 3.1.0
info:
  title: Tesouro Partner API
  version: '2026-09-24'
  description: The Tesouro REST API, for Tesouro partners to integrate with our solution.
  termsOfService: https://tesouro.com/terms
  contact:
    name: Tesouro team
    url: https://tesouro.com/about/
    email: developers@tesouro.com
servers:
  - url: https://api.sandbox.tesouro.com
    description: Sandbox
security: []
tags:
  - name: Accounting connections
  - name: Accounting data pull
  - name: Accounting synchronized records
  - name: Accounting tax rates
  - name: Analytics
  - name: Approval policies
  - name: Approval requests
  - name: Bank details
  - name: Comments
  - name: Cost centers
  - name: Counterpart addresses
  - name: Counterpart bank accounts
  - name: Counterpart contacts
  - name: Counterpart VAT IDs
  - name: Counterparts
  - name: Credit notes
  - name: Custom tax rates
  - name: Delivery notes
  - name: Departments
  - name: Disclosures
  - name: Documents
  - name: Events
  - name: Files
  - name: Ledger accounts
  - name: Locations
  - name: Mail templates
  - name: Mailbox domains
  - name: Mailboxes
  - name: Measure units
  - name: OCR
  - name: OIDC applications
  - name: Organizations
  - name: Overdue reminders
  - name: Payable duplicates
  - name: Payable line items
  - name: Payables
  - name: Payment intents
  - name: Payment links
  - name: Payment methods
  - name: Payment records
  - name: Payment reminders
  - name: Payment terms
  - name: PDF templates
  - name: Products
  - name: Projects
  - name: Purchase orders
  - name: Receipts
  - name: Receivables
  - name: Recurrences
  - name: Roles
  - name: Tags
  - name: Text templates
  - name: Transactions
  - name: Users
  - name: Webhook deliveries
  - name: Webhook subscriptions
paths:
  /finops/v1/transactions/{transaction_id}/expense_history:
    get:
      tags:
        - Transactions
      summary: Get expense history
      operationId: get_transactions_id_expense_history
      parameters:
        - required: true
          schema:
            type: string
            format: date
          example: '2026-09-24'
          name: x-finops-version
          in: header
        - name: transaction_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: event_type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/ExpenseHistoryEventTypeEnum'
              - type: 'null'
          description: Filter by event type (e.g. status_changed)
        - name: order
          in: query
          required: false
          schema:
            enum:
              - asc
              - desc
            type: string
            default: desc
          description: Sort order by timestamp
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 500
            minimum: 1
            default: 100
          description: Maximum number of records to return
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
          description: Number of records to skip
        - name: x-organization-id
          in: header
          required: true
          schema:
            type: string
            format: uuid
            examples:
              - 9d2b4c8f-2087-4738-ba91-7359683c49a4
          description: The ID of the entity that owns the requested resource.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpenseHistoryResponseList'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchemaResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchemaResponse'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchemaResponse'
        '405':
          description: Method Not Allowed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchemaResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchemaResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    ExpenseHistoryEventTypeEnum:
      type: string
      enum:
        - status_changed
        - approval_action
        - expense_created
        - expense_updated
        - submitted
        - approval_requested
        - auto_approved
        - approvals_bypassed
        - reopened
        - canceled
        - deleted
        - receipt_matched
        - receipt_unlinked
        - auto_categorized
        - payment_status_changed
    ExpenseHistoryResponseList:
      properties:
        data:
          items:
            $ref: '#/components/schemas/ExpenseHistoryEntryResponse'
          type: array
        next_pagination_token:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            A token that can be sent in the `pagination_token` query parameter
            to get the next page of results, or `null` if there is no next page
            (i.e. you've reached the last page).
        prev_pagination_token:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            A token that can be sent in the `pagination_token` query parameter
            to get the previous page of results, or `null` if there is no
            previous page (i.e. you've reached the first page).
      type: object
      required:
        - data
    ErrorSchemaResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorSchema'
      type: object
      required:
        - error
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
      type: object
    ExpenseHistoryEntryResponse:
      properties:
        id:
          type: string
          format: uuid
        entity_user_first_name:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The acting user's first name as it read when the row was written.
            Never re-derived, so renaming the user does not change it. Null when
            recorded_by is 'system' and on rows where it was not captured.
        entity_user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          description: >-
            The user who performed the action. Null when recorded_by is
            'system'.
        entity_user_last_name:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The acting user's last name as it read when the row was written.
            Never re-derived, so renaming the user does not change it. Null when
            recorded_by is 'system' and on rows where it was not captured.
        entity_user_role_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          description: >-
            The role the acting user held when the row was written. Null when
            recorded_by is 'system' and on rows where it was not captured.
        entity_user_role_name:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The display name of the role the acting user held when the row was
            written, as it read at that moment. Never re-derived, so renaming or
            re-roling the user does not change it.
        event_data:
          anyOf:
            - $ref: '#/components/schemas/ExpenseStatusChangedEventData'
            - $ref: '#/components/schemas/ApprovalActionEventData'
            - $ref: '#/components/schemas/ExpenseUpdatedEventData'
            - $ref: '#/components/schemas/ExpenseCreatedEventData'
            - $ref: '#/components/schemas/ExpenseSubmittedEventData'
            - $ref: '#/components/schemas/ExpenseApprovalRequestedEventData'
            - $ref: '#/components/schemas/ExpenseAutoApprovedEventData'
            - $ref: '#/components/schemas/ExpenseApprovalsBypassedEventData'
            - $ref: '#/components/schemas/ExpenseDeletedEventData'
            - $ref: '#/components/schemas/ExpenseReceiptMatchedEventData'
            - $ref: '#/components/schemas/ExpenseReceiptUnlinkedEventData'
            - $ref: '#/components/schemas/ExpenseAutoCategorizedEventData'
            - $ref: '#/components/schemas/ExpensePaymentStatusChangedEventData'
            - type: 'null'
          description: >-
            Structured event payload, or null for an event that carries none.
            The shape follows event_type: status_changed reads as
            ExpenseStatusChangedEventData, approval_action as
            ApprovalActionEventData, expense_updated as ExpenseUpdatedEventData,
            and each remaining type as the Expense<Type>EventData member of the
            same name, except reopened and canceled, which are plain status
            transitions and read as ExpenseStatusChangedEventData.
        event_type:
          type: string
          description: The type of the event or change.
        recorded_by:
          type: string
          enum:
            - user
            - system
          description: >-
            Whether the row is attributed to an entity user or to no user:
            'user' when entity_user_id is set, 'system' when it is null.
        timestamp:
          type: string
          format: date-time
          description: When the event occurred.
        transaction_id:
          type: string
          format: uuid
      type: object
      required:
        - id
        - transaction_id
        - event_type
        - event_data
        - entity_user_id
        - entity_user_first_name
        - entity_user_last_name
        - entity_user_role_id
        - entity_user_role_name
        - recorded_by
        - timestamp
    ErrorSchema:
      properties:
        message:
          type: string
      type: object
      required:
        - message
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
        msg:
          type: string
        type:
          type: string
      type: object
      required:
        - loc
        - msg
        - type
    ExpenseStatusChangedEventData:
      properties:
        approval_policy_id:
          anyOf:
            - type: string
            - type: 'null'
        approval_policy_name:
          anyOf:
            - type: string
            - type: 'null'
        approval_policy_process_id:
          anyOf:
            - type: string
            - type: 'null'
        approval_request_id:
          anyOf:
            - type: string
            - type: 'null'
        approval_source:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            How the decision was made: 'policy' when driven by an approval
            policy, otherwise 'force'.
        migrated_action:
          anyOf:
            - type: string
            - type: 'null'
          description: Legacy action value carried over by the history table migration.
        new_status:
          $ref: '#/components/schemas/ExpenseStatusEnum'
          description: The expense status after the transition.
        old_status:
          anyOf:
            - $ref: '#/components/schemas/ExpenseStatusEnum'
            - type: 'null'
          description: The expense status before the transition. Null for migrated rows.
        reject_reason:
          anyOf:
            - type: string
            - type: 'null'
          description: Reason for rejection, if applicable.
      additionalProperties: false
      type: object
      required:
        - new_status
    ApprovalActionEventData:
      properties:
        acted_at:
          anyOf:
            - type: string
            - type: 'null'
          description: ISO timestamp of when the action was performed.
        action:
          type: string
          description: 'The approval action: ''approved'' or ''rejected''.'
        approval_policy_id:
          anyOf:
            - type: string
            - type: 'null'
        approval_policy_name:
          anyOf:
            - type: string
            - type: 'null'
        approval_policy_process_id:
          anyOf:
            - type: string
            - type: 'null'
        approval_request_id:
          anyOf:
            - type: string
            - type: 'null'
        approval_source:
          anyOf:
            - type: string
            - type: 'null'
          description: '''policy'' for policy-based actions.'
        reject_reason:
          anyOf:
            - type: string
            - type: 'null'
          description: Reason for rejection, if applicable.
      additionalProperties: false
      type: object
      required:
        - action
    ExpenseUpdatedEventData:
      properties:
        fields:
          additionalProperties:
            $ref: '#/components/schemas/FieldDiff'
          type: object
      additionalProperties: false
      type: object
    ExpenseCreatedEventData:
      properties:
        created_via:
          type: string
          enum:
            - feed
            - manual
          description: >-
            'feed' when a partner service created it with no entity user,
            otherwise 'manual'.
        department_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Department defaulted from the owner's profile.
        entity_user_id:
          anyOf:
            - type: string
            - type: 'null'
          description: The owner assigned at creation.
        expense_status:
          $ref: '#/components/schemas/ExpenseStatusEnum'
          description: The expense status the row was created with.
        location_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Location defaulted from the owner's profile.
        source_of_data:
          anyOf:
            - additionalProperties:
                $ref: '#/components/schemas/FieldSourceEnum'
              type: object
            - type: 'null'
          description: Per-field source tracking as it stood at creation.
      additionalProperties: false
      type: object
      required:
        - created_via
        - expense_status
    ExpenseSubmittedEventData:
      properties:
        bypass_receipt_validation:
          type: boolean
          description: Whether receipt validation was bypassed.
        new_status:
          $ref: '#/components/schemas/ExpenseStatusEnum'
          description: The expense status after submission.
        no_receipt_reason:
          anyOf:
            - type: string
            - type: 'null'
          description: Reason given when bypassing receipt validation.
        old_status:
          $ref: '#/components/schemas/ExpenseStatusEnum'
          description: The expense status before submission.
      additionalProperties: false
      type: object
      required:
        - old_status
        - new_status
        - bypass_receipt_validation
    ExpenseApprovalRequestedEventData:
      properties:
        approval_policy_id:
          type: string
          description: The policy that matched.
        approval_policy_name:
          anyOf:
            - type: string
            - type: 'null'
          description: Policy name, snapshotted at event time.
        approval_type:
          anyOf:
            - type: string
            - type: 'null'
          description: The policy's approval type.
        approver_ids:
          anyOf:
            - type: array
              items:
                type: string
            - type: 'null'
          description: Designated approvers, if the policy names any.
        required_approval_count:
          anyOf:
            - type: integer
            - type: 'null'
          description: Approvals the policy requires.
      additionalProperties: false
      type: object
      required:
        - approval_policy_id
    ExpenseAutoApprovedEventData:
      properties:
        acted_at:
          type: string
          description: ISO timestamp of the auto-approval, taken from the message.
        approval_policy_id:
          anyOf:
            - type: string
            - type: 'null'
          description: The policy that auto-approved.
        approval_policy_name:
          anyOf:
            - type: string
            - type: 'null'
          description: Policy name, snapshotted at event time.
      additionalProperties: false
      type: object
      required:
        - acted_at
    ExpenseApprovalsBypassedEventData:
      properties:
        bypassed_approver_ids:
          items:
            type: string
          type: array
          description: >-
            The approvers whose pending approval was cancelled by the force
            approval.
        bypassed_approvers:
          items:
            $ref: '#/components/schemas/ExpenseBypassedApprover'
          type: array
          description: The same approvers, named as they read when the row was written.
        event_id:
          type: string
          description: >-
            The producer's identifier for the force approval, stable across a
            redelivery.
      additionalProperties: false
      type: object
      required:
        - bypassed_approver_ids
        - event_id
    ExpenseDeletedEventData:
      properties:
        old_status:
          $ref: '#/components/schemas/ExpenseStatusEnum'
          description: The expense status at the point of deletion.
      additionalProperties: false
      type: object
      required:
        - old_status
    ExpenseReceiptMatchedEventData:
      properties:
        document_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Receipt document id, snapshotted for display.
        link_source:
          $ref: '#/components/schemas/FieldSourceEnum'
          description: '''user'' for a UI-initiated link, ''automatched'' otherwise.'
        merchant_name:
          anyOf:
            - type: string
            - type: 'null'
          description: Merchant name, snapshotted for display.
        receipt_id:
          type: string
          description: The receipt linked to the expense.
      additionalProperties: false
      type: object
      required:
        - link_source
        - receipt_id
    ExpenseReceiptUnlinkedEventData:
      properties:
        receipt_id:
          type: string
          description: The receipt that was unlinked.
      additionalProperties: false
      type: object
      required:
        - receipt_id
    ExpenseAutoCategorizedEventData:
      properties:
        description:
          anyOf:
            - type: string
            - type: 'null'
          description: Memo the enrichment generated.
        ledger_account_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Ledger account the enrichment set.
        source:
          $ref: '#/components/schemas/FieldSourceEnum'
          description: How the values were set. Always 'generated' today.
      additionalProperties: false
      type: object
      required:
        - source
    ExpensePaymentStatusChangedEventData:
      properties:
        new_status:
          $ref: '#/components/schemas/TransactionStatusEnum'
          description: Payment status after the transition.
        old_status:
          anyOf:
            - $ref: '#/components/schemas/TransactionStatusEnum'
            - type: 'null'
          description: Payment status before the transition.
      additionalProperties: false
      type: object
      required:
        - new_status
    ExpenseStatusEnum:
      type: string
      enum:
        - new
        - approve_in_progress
        - approved
        - rejected
        - canceled
        - deleted
    FieldDiff:
      properties:
        new:
          anyOf:
            - {}
            - type: 'null'
        new_label:
          anyOf:
            - type: string
            - type: 'null'
        old:
          anyOf:
            - {}
            - type: 'null'
        old_label:
          anyOf:
            - type: string
            - type: 'null'
        redacted:
          anyOf:
            - type: boolean
            - type: 'null'
      additionalProperties: false
      type: object
      required:
        - new
        - old
    FieldSourceEnum:
      type: string
      enum:
        - user
        - generated
        - automatched
    ExpenseBypassedApprover:
      properties:
        id:
          type: string
          description: The approver whose pending approval was cancelled.
        first_name:
          anyOf:
            - type: string
            - type: 'null'
          description: Their first name as it read at the time.
        last_name:
          anyOf:
            - type: string
            - type: 'null'
          description: Their last name as it read at the time.
      additionalProperties: false
      type: object
      required:
        - id
    TransactionStatusEnum:
      type: string
      enum:
        - created
        - processing
        - succeeded
        - declined
        - refunded
        - failed
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````