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

# Trade by ID

> Returns one trade's full dossier, keyed by its order id: trade details, on-chain settlement (including the settlement transaction hashes), LP info, and - for admin/owner callers - compliance, Travel Rule, proof, intent, and fee sections.



## OpenAPI

````yaml /api-reference/specs/trade-history-api.json get /workspaces/{id}/trades/{orderId}
openapi: 3.1.0
info:
  title: TetraFi Trade History API
  version: '1'
  description: >-
    Read-only, workspace-scoped access to every trade that ran through your
    workspace - filtered lists with offset pagination, single-trade detail keyed
    by order id, and CSV export, across all supported chains.
servers:
  - url: https://api.tetrafi.io/api/v1
security:
  - apiKeyAuth: []
  - bearerAuth: []
paths:
  /workspaces/{id}/trades/{orderId}:
    get:
      summary: Trade by ID
      description: >-
        Returns one trade's full dossier, keyed by its order id: trade details,
        on-chain settlement (including the settlement transaction hashes), LP
        info, and - for admin/owner callers - compliance, Travel Rule, proof,
        intent, and fee sections.
      operationId: getTradeByOrderId
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            title: Workspace Id
            description: Workspace whose trades are returned - results are scoped to it
          description: Workspace whose trades are returned - results are scoped to it
          example: ws_123
        - name: orderId
          in: path
          required: true
          schema:
            type: string
            title: Order Id
            description: >-
              Order id from the trades list - trades are keyed by order id, not
              transaction hash
          description: >-
            Order id from the trades list - trades are keyed by order id, not
            transaction hash
          example: ord_01J49...
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TradeDetail'
        '401':
          description: 'Error Response: Authentication Required'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: 'Error Response: Not found'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    TradeDetail:
      properties:
        trade:
          type: object
          title: Trade
          description: >-
            Section A: trade details - the list-item fields plus fill time and
            slippage tolerance
        settlement:
          type: object
          title: Settlement
          description: >-
            Section B: on-chain settlement - per-stage transaction references
            (submit/fill/proof/finalise and a generic transactions list),
            including the settlement transaction hashes
        orderKind:
          anyOf:
            - type: string
            - type: 'null'
          title: Orderkind
          description: Canonical route-aware order kind - omitted for non-route orders
        substatus:
          anyOf:
            - type: string
            - type: 'null'
          title: Substatus
          description: Finer-grained state within the coarse status
        substatusMessage:
          anyOf:
            - type: string
            - type: 'null'
          title: Substatusmessage
          description: Human-readable elaboration of substatus
        legs:
          anyOf:
            - items:
                type: object
              type: array
            - type: 'null'
          title: Legs
          description: >-
            Per-leg execution for multi-leg route orders; omitted for single-leg
            orders
        member:
          anyOf:
            - $ref: '#/components/schemas/MemberAttribution'
            - type: 'null'
          title: Member
          description: Member who initiated the trade - admin/owner callers only
        lp:
          type: object
          title: Lp
          description: 'Section C: LP info'
        compliance:
          anyOf:
            - type: object
            - type: 'null'
          title: Compliance
          description: Compliance summary - admin/owner callers only
        snapshotCompliance:
          anyOf:
            - type: object
            - type: 'null'
          title: Snapshotcompliance
          description: >-
            Per-order compliance snapshot captured at creation - admin/owner
            callers only
        travelRuleTransmission:
          anyOf:
            - type: object
            - type: 'null'
          title: Travelruletransmission
          description: Latest Travel Rule transmission record - admin/owner callers only
        complianceProofs:
          anyOf:
            - type: object
            - type: 'null'
          title: Complianceproofs
          description: Cryptographic and provenance proofs - admin/owner callers only
        intent:
          anyOf:
            - type: object
            - type: 'null'
          title: Intent
          description: >-
            ERC-7683 intent envelope captured at submission - admin/owner
            callers only
        fees:
          type: object
          title: Fees
          description: >-
            Fee breakdown: gas, protocol fee, solver fee, relayer tips - omitted
            when the order predates fee capture
      type: object
      required:
        - trade
        - settlement
        - lp
      title: TradeDetail
      description: >-
        Full trade dossier keyed by order id. The settlement section carries the
        on-chain transaction hashes.
    ErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
      type: object
      required:
        - error
      title: ErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MemberAttribution:
      properties:
        userId:
          type: string
          title: Userid
        firstName:
          type: string
          title: Firstname
        lastName:
          type: string
          title: Lastname
        email:
          type: string
          title: Email
        role:
          type: string
          title: Role
          description: Workspace role of the member
        kycStatus:
          type: string
          title: Kycstatus
        joinedAt:
          type: string
          format: date-time
          title: Joinedat
      type: object
      required:
        - userId
        - firstName
        - lastName
        - email
        - role
        - kycStatus
        - joinedAt
      title: MemberAttribution
      description: >-
        Member identity attached to a trade - present for admin/owner callers
        only.
    ApiError:
      properties:
        code:
          type: string
          title: Code
          description: Machine-readable error code, e.g. AUTH_REQUIRED
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
      type: object
      required:
        - code
      title: ApiError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Workspace API key (tfk_test_/tfk_live_); results are scoped to the key's
        workspace.
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Workspace-session JWT; results are scoped to the caller's workspace
        membership.

````