Trade by ID
Fetch one trade’s complete dossier, keyed by its order id: trade details, on-chain settlement transactions, LP info, and admin-only compliance sections, scoped to your workspace.
curl --request GET \
--url https://api.tetrafi.io/api/v1/workspaces/{id}/trades/{orderId} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.tetrafi.io/api/v1/workspaces/{id}/trades/{orderId}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.tetrafi.io/api/v1/workspaces/{id}/trades/{orderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tetrafi.io/api/v1/workspaces/{id}/trades/{orderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tetrafi.io/api/v1/workspaces/{id}/trades/{orderId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.tetrafi.io/api/v1/workspaces/{id}/trades/{orderId}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tetrafi.io/api/v1/workspaces/{id}/trades/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"trade": {},
"settlement": {},
"lp": {},
"orderKind": "<string>",
"substatus": "<string>",
"substatusMessage": "<string>",
"legs": [
{}
],
"member": {
"userId": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"role": "<string>",
"kycStatus": "<string>",
"joinedAt": "2023-11-07T05:31:56Z"
},
"compliance": {},
"snapshotCompliance": {},
"travelRuleTransmission": {},
"complianceProofs": {},
"intent": {},
"fees": {}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}settlement section.
OpenAPI
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.
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.
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
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.
Authorizations
Workspace API key (tfk_test_/tfk_live_); results are scoped to the key's workspace.
Path Parameters
Workspace whose trades are returned - results are scoped to it
Order id from the trades list - trades are keyed by order id, not transaction hash
Response
Successful Response
Full trade dossier keyed by order id. The settlement section carries the on-chain transaction hashes.
Section A: trade details - the list-item fields plus fill time and slippage tolerance
Section B: on-chain settlement - per-stage transaction references (submit/fill/proof/finalise and a generic transactions list), including the settlement transaction hashes
Section C: LP info
Canonical route-aware order kind - omitted for non-route orders
Finer-grained state within the coarse status
Human-readable elaboration of substatus
Per-leg execution for multi-leg route orders; omitted for single-leg orders
Member identity attached to a trade - present for admin/owner callers only.
Show child attributes
Show child attributes
Compliance summary - admin/owner callers only
Per-order compliance snapshot captured at creation - admin/owner callers only
Latest Travel Rule transmission record - admin/owner callers only
Cryptographic and provenance proofs - admin/owner callers only
ERC-7683 intent envelope captured at submission - admin/owner callers only
Fee breakdown: gas, protocol fee, solver fee, relayer tips - omitted when the order predates fee capture