Order Status
Track a submitted order through its lifecycle. Statuses are lowercase: pending while the order progresses, then exactly one terminal state - settled or failed. Delivery-or-refund settlement means failed never strands funds: the escrowed input returns along the refund path.
curl --request GET \
--url https://api.tetrafi.io/api/v1/rfq/orders/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.tetrafi.io/api/v1/rfq/orders/{id}"
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/rfq/orders/{id}', 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/rfq/orders/{id}",
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/rfq/orders/{id}"
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/rfq/orders/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tetrafi.io/api/v1/rfq/orders/{id}")
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{
"status": "pending",
"txHash": "<string>",
"settledAmounts": {},
"settledAt": "2023-11-07T05:31:56Z",
"failure": {
"code": "<string>",
"message": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}OpenAPI
openapi: 3.1.0
info:
title: TetraFi RFQ API
version: '1'
description: >-
Firm, escrow-backed quotes from competing solvers and LPs. Every quote is a signed commitment
priced from the counterparty's own inventory - executable exactly as returned, with no re-pricing
and no last look - and every order settles through a delivery-or-refund escrow: the output
is delivered or the input comes back, never limbo.
servers:
- url: https://api.tetrafi.io/api/v1/rfq
description: >-
RFQ namespace base URL. The chain is no longer part of the URL - every asset in an intent
names its network via chainId. The same host serves the sandbox: authenticate with a tfk_test_
key to quote against test corridors, tfk_live_ for production.
security:
- apiKeyAuth: []
paths:
/orders/{id}:
get:
summary: Order Status
description: >-
Returns where a submitted order stands in its lifecycle. Statuses are lowercase: `pending`
while the order progresses, then exactly one terminal state - `settled` or `failed`. The
same transitions arrive as WebSocket events (order.created, order.settled, order.failed)
on the orders:{id} topic, so polling is optional. Because settlement is delivery-or-refund,
`failed` never strands funds: the escrowed input is returned along the refund path.
operationId: getOrderStatus
parameters:
- name: id
in: path
required: true
schema:
type: string
title: Order Id
description: Order identifier returned by POST /orders.
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/OrderStatusResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
components:
schemas:
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
OrderStatus:
type: string
enum:
- pending
- settled
- failed
title: OrderStatus
description: >-
Order lifecycle state, lowercase. pending - accepted and progressing; settled - delivery
proven and funds released (terminal); failed - the order could not settle inside its window,
so the escrowed input follows the refund path (terminal, never lost funds). Each transition
is also pushed over WebSocket as order.created, order.settled, or order.failed on the
orders:{id} topic.
OrderStatusResponse:
properties:
status:
$ref: '#/components/schemas/OrderStatus'
txHash:
anyOf:
- type: string
- type: 'null'
title: Txhash
description: Settlement transaction hash - present once a settlement transaction has
been broadcast.
settledAmounts:
anyOf:
- additionalProperties:
type: string
type: object
- type: 'null'
title: Settledamounts
description: Base-unit amounts actually delivered, keyed by asset, populated once the
order settles.
settledAt:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Settledat
description: When delivery was proven on-chain, on settled orders.
failure:
anyOf:
- type: object
properties:
code:
type: string
title: Code
description: Machine-readable failure reason.
message:
type: string
title: Message
description: Human-readable failure explanation.
- type: 'null'
title: Failure
description: >-
Populated on failed orders. The escrowed input follows the refund path - a failure
is never lost funds.
type: object
required:
- status
title: OrderStatusResponse
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: Service-account API key (tfk_test_/tfk_live_).
Authorizations
Service-account API key (tfk_test_/tfk_live_).
Path Parameters
Order identifier returned by POST /orders.
Response
Successful Response
Order lifecycle state, lowercase. pending - accepted and progressing; settled - delivery proven and funds released (terminal); failed - the order could not settle inside its window, so the escrowed input follows the refund path (terminal, never lost funds). Each transition is also pushed over WebSocket as order.created, order.settled, or order.failed on the orders:{id} topic.
pending, settled, failed Settlement transaction hash - present once a settlement transaction has been broadcast.
Base-unit amounts actually delivered, keyed by asset, populated once the order settles.
Show child attributes
Show child attributes
When delivery was proven on-chain, on settled orders.
Populated on failed orders. The escrowed input follows the refund path - a failure is never lost funds.
Show child attributes
Show child attributes