curl --request POST \
--url https://api.tetrafi.io/api/v1/router/orders/preflight \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"quoteResponse": {
"quoteId": "<string>",
"solverId": "<string>",
"validUntil": 123,
"preview": {
"inputs": [
{
"asset": "<string>",
"amount": "<string>",
"decimals": 123,
"symbol": "<string>",
"priceUsd": 123
}
],
"outputs": [
{
"asset": "<string>",
"amount": "<string>",
"minimumAmount": "<string>",
"decimals": 123,
"symbol": "<string>",
"priceUsd": 123,
"receiver": "<string>"
}
]
},
"integrityChecksum": "<string>",
"order": {
"type": "<string>",
"payload": {}
},
"eta": 123,
"routingPath": "<string>",
"platformFeeBps": 123,
"lpSpreadBps": 123,
"composite": {
"legs": [
{}
],
"executionModel": "<string>"
},
"gas": {
"native": "<string>",
"usd": 123
},
"warnings": []
}
}
'import requests
url = "https://api.tetrafi.io/api/v1/router/orders/preflight"
payload = { "quoteResponse": {
"quoteId": "<string>",
"solverId": "<string>",
"validUntil": 123,
"preview": {
"inputs": [
{
"asset": "<string>",
"amount": "<string>",
"decimals": 123,
"symbol": "<string>",
"priceUsd": 123
}
],
"outputs": [
{
"asset": "<string>",
"amount": "<string>",
"minimumAmount": "<string>",
"decimals": 123,
"symbol": "<string>",
"priceUsd": 123,
"receiver": "<string>"
}
]
},
"integrityChecksum": "<string>",
"order": {
"type": "<string>",
"payload": {}
},
"eta": 123,
"routingPath": "<string>",
"platformFeeBps": 123,
"lpSpreadBps": 123,
"composite": {
"legs": [{}],
"executionModel": "<string>"
},
"gas": {
"native": "<string>",
"usd": 123
},
"warnings": []
} }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
quoteResponse: {
quoteId: '<string>',
solverId: '<string>',
validUntil: 123,
preview: {
inputs: [
{
asset: '<string>',
amount: '<string>',
decimals: 123,
symbol: '<string>',
priceUsd: 123
}
],
outputs: [
{
asset: '<string>',
amount: '<string>',
minimumAmount: '<string>',
decimals: 123,
symbol: '<string>',
priceUsd: 123,
receiver: '<string>'
}
]
},
integrityChecksum: '<string>',
order: {type: '<string>', payload: {}},
eta: 123,
routingPath: '<string>',
platformFeeBps: 123,
lpSpreadBps: 123,
composite: {legs: [{}], executionModel: '<string>'},
gas: {native: '<string>', usd: 123},
warnings: []
}
})
};
fetch('https://api.tetrafi.io/api/v1/router/orders/preflight', 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/router/orders/preflight",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'quoteResponse' => [
'quoteId' => '<string>',
'solverId' => '<string>',
'validUntil' => 123,
'preview' => [
'inputs' => [
[
'asset' => '<string>',
'amount' => '<string>',
'decimals' => 123,
'symbol' => '<string>',
'priceUsd' => 123
]
],
'outputs' => [
[
'asset' => '<string>',
'amount' => '<string>',
'minimumAmount' => '<string>',
'decimals' => 123,
'symbol' => '<string>',
'priceUsd' => 123,
'receiver' => '<string>'
]
]
],
'integrityChecksum' => '<string>',
'order' => [
'type' => '<string>',
'payload' => [
]
],
'eta' => 123,
'routingPath' => '<string>',
'platformFeeBps' => 123,
'lpSpreadBps' => 123,
'composite' => [
'legs' => [
[
]
],
'executionModel' => '<string>'
],
'gas' => [
'native' => '<string>',
'usd' => 123
],
'warnings' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tetrafi.io/api/v1/router/orders/preflight"
payload := strings.NewReader("{\n \"quoteResponse\": {\n \"quoteId\": \"<string>\",\n \"solverId\": \"<string>\",\n \"validUntil\": 123,\n \"preview\": {\n \"inputs\": [\n {\n \"asset\": \"<string>\",\n \"amount\": \"<string>\",\n \"decimals\": 123,\n \"symbol\": \"<string>\",\n \"priceUsd\": 123\n }\n ],\n \"outputs\": [\n {\n \"asset\": \"<string>\",\n \"amount\": \"<string>\",\n \"minimumAmount\": \"<string>\",\n \"decimals\": 123,\n \"symbol\": \"<string>\",\n \"priceUsd\": 123,\n \"receiver\": \"<string>\"\n }\n ]\n },\n \"integrityChecksum\": \"<string>\",\n \"order\": {\n \"type\": \"<string>\",\n \"payload\": {}\n },\n \"eta\": 123,\n \"routingPath\": \"<string>\",\n \"platformFeeBps\": 123,\n \"lpSpreadBps\": 123,\n \"composite\": {\n \"legs\": [\n {}\n ],\n \"executionModel\": \"<string>\"\n },\n \"gas\": {\n \"native\": \"<string>\",\n \"usd\": 123\n },\n \"warnings\": []\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tetrafi.io/api/v1/router/orders/preflight")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"quoteResponse\": {\n \"quoteId\": \"<string>\",\n \"solverId\": \"<string>\",\n \"validUntil\": 123,\n \"preview\": {\n \"inputs\": [\n {\n \"asset\": \"<string>\",\n \"amount\": \"<string>\",\n \"decimals\": 123,\n \"symbol\": \"<string>\",\n \"priceUsd\": 123\n }\n ],\n \"outputs\": [\n {\n \"asset\": \"<string>\",\n \"amount\": \"<string>\",\n \"minimumAmount\": \"<string>\",\n \"decimals\": 123,\n \"symbol\": \"<string>\",\n \"priceUsd\": 123,\n \"receiver\": \"<string>\"\n }\n ]\n },\n \"integrityChecksum\": \"<string>\",\n \"order\": {\n \"type\": \"<string>\",\n \"payload\": {}\n },\n \"eta\": 123,\n \"routingPath\": \"<string>\",\n \"platformFeeBps\": 123,\n \"lpSpreadBps\": 123,\n \"composite\": {\n \"legs\": [\n {}\n ],\n \"executionModel\": \"<string>\"\n },\n \"gas\": {\n \"native\": \"<string>\",\n \"usd\": 123\n },\n \"warnings\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tetrafi.io/api/v1/router/orders/preflight")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quoteResponse\": {\n \"quoteId\": \"<string>\",\n \"solverId\": \"<string>\",\n \"validUntil\": 123,\n \"preview\": {\n \"inputs\": [\n {\n \"asset\": \"<string>\",\n \"amount\": \"<string>\",\n \"decimals\": 123,\n \"symbol\": \"<string>\",\n \"priceUsd\": 123\n }\n ],\n \"outputs\": [\n {\n \"asset\": \"<string>\",\n \"amount\": \"<string>\",\n \"minimumAmount\": \"<string>\",\n \"decimals\": 123,\n \"symbol\": \"<string>\",\n \"priceUsd\": 123,\n \"receiver\": \"<string>\"\n }\n ]\n },\n \"integrityChecksum\": \"<string>\",\n \"order\": {\n \"type\": \"<string>\",\n \"payload\": {}\n },\n \"eta\": 123,\n \"routingPath\": \"<string>\",\n \"platformFeeBps\": 123,\n \"lpSpreadBps\": 123,\n \"composite\": {\n \"legs\": [\n {}\n ],\n \"executionModel\": \"<string>\"\n },\n \"gas\": {\n \"native\": \"<string>\",\n \"usd\": 123\n },\n \"warnings\": []\n }\n}"
response = http.request(request)
puts response.read_body{
"quoteId": "<string>",
"ready": true,
"nextActions": [
{
"chainId": 123,
"tx": {
"to": "<string>",
"value": "<string>",
"data": "<string>",
"chainId": 123,
"from": "<string>",
"gas": 123,
"gasPrice": 123
},
"typedData": {
"type": "<string>",
"payload": {}
},
"submitTo": "<string>",
"after": [],
"details": {}
}
],
"lockDetails": {
"signature": "<string>",
"deadline": 123
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Preflight
Check that the candidate you selected is still submit-ready and receive nextActions - an ordered execution plan covering everything between selection and a submitted order: approvals to mine, deposits for bridge legs, the exact payload to sign, and where to send it. Actions marked frequency reusableSetup (like a bounded Permit2 grant) persist across trades and stop appearing once done. Re-run preflight whenever an action lists rerunPreflight in its after steps - multi-leg routes often need a second pass after the first leg mines.
curl --request POST \
--url https://api.tetrafi.io/api/v1/router/orders/preflight \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"quoteResponse": {
"quoteId": "<string>",
"solverId": "<string>",
"validUntil": 123,
"preview": {
"inputs": [
{
"asset": "<string>",
"amount": "<string>",
"decimals": 123,
"symbol": "<string>",
"priceUsd": 123
}
],
"outputs": [
{
"asset": "<string>",
"amount": "<string>",
"minimumAmount": "<string>",
"decimals": 123,
"symbol": "<string>",
"priceUsd": 123,
"receiver": "<string>"
}
]
},
"integrityChecksum": "<string>",
"order": {
"type": "<string>",
"payload": {}
},
"eta": 123,
"routingPath": "<string>",
"platformFeeBps": 123,
"lpSpreadBps": 123,
"composite": {
"legs": [
{}
],
"executionModel": "<string>"
},
"gas": {
"native": "<string>",
"usd": 123
},
"warnings": []
}
}
'import requests
url = "https://api.tetrafi.io/api/v1/router/orders/preflight"
payload = { "quoteResponse": {
"quoteId": "<string>",
"solverId": "<string>",
"validUntil": 123,
"preview": {
"inputs": [
{
"asset": "<string>",
"amount": "<string>",
"decimals": 123,
"symbol": "<string>",
"priceUsd": 123
}
],
"outputs": [
{
"asset": "<string>",
"amount": "<string>",
"minimumAmount": "<string>",
"decimals": 123,
"symbol": "<string>",
"priceUsd": 123,
"receiver": "<string>"
}
]
},
"integrityChecksum": "<string>",
"order": {
"type": "<string>",
"payload": {}
},
"eta": 123,
"routingPath": "<string>",
"platformFeeBps": 123,
"lpSpreadBps": 123,
"composite": {
"legs": [{}],
"executionModel": "<string>"
},
"gas": {
"native": "<string>",
"usd": 123
},
"warnings": []
} }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
quoteResponse: {
quoteId: '<string>',
solverId: '<string>',
validUntil: 123,
preview: {
inputs: [
{
asset: '<string>',
amount: '<string>',
decimals: 123,
symbol: '<string>',
priceUsd: 123
}
],
outputs: [
{
asset: '<string>',
amount: '<string>',
minimumAmount: '<string>',
decimals: 123,
symbol: '<string>',
priceUsd: 123,
receiver: '<string>'
}
]
},
integrityChecksum: '<string>',
order: {type: '<string>', payload: {}},
eta: 123,
routingPath: '<string>',
platformFeeBps: 123,
lpSpreadBps: 123,
composite: {legs: [{}], executionModel: '<string>'},
gas: {native: '<string>', usd: 123},
warnings: []
}
})
};
fetch('https://api.tetrafi.io/api/v1/router/orders/preflight', 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/router/orders/preflight",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'quoteResponse' => [
'quoteId' => '<string>',
'solverId' => '<string>',
'validUntil' => 123,
'preview' => [
'inputs' => [
[
'asset' => '<string>',
'amount' => '<string>',
'decimals' => 123,
'symbol' => '<string>',
'priceUsd' => 123
]
],
'outputs' => [
[
'asset' => '<string>',
'amount' => '<string>',
'minimumAmount' => '<string>',
'decimals' => 123,
'symbol' => '<string>',
'priceUsd' => 123,
'receiver' => '<string>'
]
]
],
'integrityChecksum' => '<string>',
'order' => [
'type' => '<string>',
'payload' => [
]
],
'eta' => 123,
'routingPath' => '<string>',
'platformFeeBps' => 123,
'lpSpreadBps' => 123,
'composite' => [
'legs' => [
[
]
],
'executionModel' => '<string>'
],
'gas' => [
'native' => '<string>',
'usd' => 123
],
'warnings' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tetrafi.io/api/v1/router/orders/preflight"
payload := strings.NewReader("{\n \"quoteResponse\": {\n \"quoteId\": \"<string>\",\n \"solverId\": \"<string>\",\n \"validUntil\": 123,\n \"preview\": {\n \"inputs\": [\n {\n \"asset\": \"<string>\",\n \"amount\": \"<string>\",\n \"decimals\": 123,\n \"symbol\": \"<string>\",\n \"priceUsd\": 123\n }\n ],\n \"outputs\": [\n {\n \"asset\": \"<string>\",\n \"amount\": \"<string>\",\n \"minimumAmount\": \"<string>\",\n \"decimals\": 123,\n \"symbol\": \"<string>\",\n \"priceUsd\": 123,\n \"receiver\": \"<string>\"\n }\n ]\n },\n \"integrityChecksum\": \"<string>\",\n \"order\": {\n \"type\": \"<string>\",\n \"payload\": {}\n },\n \"eta\": 123,\n \"routingPath\": \"<string>\",\n \"platformFeeBps\": 123,\n \"lpSpreadBps\": 123,\n \"composite\": {\n \"legs\": [\n {}\n ],\n \"executionModel\": \"<string>\"\n },\n \"gas\": {\n \"native\": \"<string>\",\n \"usd\": 123\n },\n \"warnings\": []\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tetrafi.io/api/v1/router/orders/preflight")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"quoteResponse\": {\n \"quoteId\": \"<string>\",\n \"solverId\": \"<string>\",\n \"validUntil\": 123,\n \"preview\": {\n \"inputs\": [\n {\n \"asset\": \"<string>\",\n \"amount\": \"<string>\",\n \"decimals\": 123,\n \"symbol\": \"<string>\",\n \"priceUsd\": 123\n }\n ],\n \"outputs\": [\n {\n \"asset\": \"<string>\",\n \"amount\": \"<string>\",\n \"minimumAmount\": \"<string>\",\n \"decimals\": 123,\n \"symbol\": \"<string>\",\n \"priceUsd\": 123,\n \"receiver\": \"<string>\"\n }\n ]\n },\n \"integrityChecksum\": \"<string>\",\n \"order\": {\n \"type\": \"<string>\",\n \"payload\": {}\n },\n \"eta\": 123,\n \"routingPath\": \"<string>\",\n \"platformFeeBps\": 123,\n \"lpSpreadBps\": 123,\n \"composite\": {\n \"legs\": [\n {}\n ],\n \"executionModel\": \"<string>\"\n },\n \"gas\": {\n \"native\": \"<string>\",\n \"usd\": 123\n },\n \"warnings\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tetrafi.io/api/v1/router/orders/preflight")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quoteResponse\": {\n \"quoteId\": \"<string>\",\n \"solverId\": \"<string>\",\n \"validUntil\": 123,\n \"preview\": {\n \"inputs\": [\n {\n \"asset\": \"<string>\",\n \"amount\": \"<string>\",\n \"decimals\": 123,\n \"symbol\": \"<string>\",\n \"priceUsd\": 123\n }\n ],\n \"outputs\": [\n {\n \"asset\": \"<string>\",\n \"amount\": \"<string>\",\n \"minimumAmount\": \"<string>\",\n \"decimals\": 123,\n \"symbol\": \"<string>\",\n \"priceUsd\": 123,\n \"receiver\": \"<string>\"\n }\n ]\n },\n \"integrityChecksum\": \"<string>\",\n \"order\": {\n \"type\": \"<string>\",\n \"payload\": {}\n },\n \"eta\": 123,\n \"routingPath\": \"<string>\",\n \"platformFeeBps\": 123,\n \"lpSpreadBps\": 123,\n \"composite\": {\n \"legs\": [\n {}\n ],\n \"executionModel\": \"<string>\"\n },\n \"gas\": {\n \"native\": \"<string>\",\n \"usd\": 123\n },\n \"warnings\": []\n }\n}"
response = http.request(request)
puts response.read_body{
"quoteId": "<string>",
"ready": true,
"nextActions": [
{
"chainId": 123,
"tx": {
"to": "<string>",
"value": "<string>",
"data": "<string>",
"chainId": 123,
"from": "<string>",
"gas": 123,
"gasPrice": 123
},
"typedData": {
"type": "<string>",
"payload": {}
},
"submitTo": "<string>",
"after": [],
"details": {}
}
],
"lockDetails": {
"signature": "<string>",
"deadline": 123
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Service-account API key (tfk_test_/tfk_live_).
Body
The candidate to preflight, passed back exactly as it appeared in the quotes response. The plan is computed against this candidate's terms and the user's current on-chain state.
Show child attributes
Show child attributes
Response
Successful Response
Candidate the plan applies to.
True when nothing stands between you and submission - the remaining nextActions are just the signature and the POST.
Ordered execution plan; empty when the candidate is immediately submittable.
Show child attributes
Show child attributes
Lock mechanism preflight selected for pulling the input - your code stays the same whichever it picks.
Permit2, EIP-3009, ResourceLock Permit2 funding lock: one reusable approval of the Permit2 contract, after which each order authorizes its own pull inside the signature.
- Permit2Lock
- Eip3009Authorization
- ResourceLock
Show child attributes
Show child attributes