Order Status
Read the lifecycle state of a submitted order: pending while it progresses, then the terminal settled or failed. The same transitions stream over WebSocket, and because settlement is delivery-versus-payment, a failed order refunds the escrowed input rather than losing funds.
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 Router API
version: '1'
description: >-
Multi-source routing over every eligible execution source. One intent fans out across
direct DEX liquidity, the RFQ venue, bridges, issuers, and fiat rails, and comes back
as ranked executable candidates - each stating its own guarantees.
servers:
- url: https://api.tetrafi.io/api/v1/router
description: >-
Router 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 route against test corridors, tfk_live_ for production.
security:
- apiKeyAuth: []
paths:
/orders/{id}:
get:
summary: Order Status
description: >-
Returns the lifecycle state of a submitted order: pending while it progresses, then
the terminal settled or failed. The same transitions arrive as WebSocket events (order.created,
order.settled, order.failed) on the orders:{id} topic. Because settlement is delivery-versus-payment,
failed never means lost funds - the escrowed input follows 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. pending - accepted and progressing; settled - delivery proven
and funds released (terminal); failed - could not settle before expiry, the escrowed
input follows the refund path (terminal). The same transitions are pushed over WebSocket
as order.created, order.settled, and 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: Delivered amounts keyed by asset, present once the order settles.
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.
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