const res = await fetch('https://app.trdrs.co/api/trading/order', {
method: 'POST',
headers: {
'content-type': 'application/json',
Authorization: `Bearer ${process.env.TRDRS_API_KEY}`,
},
body: JSON.stringify({
"instrument": "ESU6",
"side": "buy",
"qty": 2,
"clientOrderId": "entry-esu6-1787580900",
"orderType": "limit",
"limitPrice": 6480.5,
"stopLoss": {
"price": 6472.5,
"offsetTicks": 32
},
"takeProfit": {
"price": 6495,
"offsetTicks": 58
},
"tif": "day"
}),
})
const data = await res.json()curl -X POST 'https://app.trdrs.co/api/trading/order' \
-H "Authorization: Bearer $TRDRS_API_KEY" \
-H 'content-type: application/json' \
-d '{"instrument":"ESU6","side":"buy","qty":2,"clientOrderId":"entry-esu6-1787580900","orderType":"limit","limitPrice":6480.5,"stopLoss":{"price":6472.5,"offsetTicks":32},"takeProfit":{"price":6495,"offsetTicks":58},"tif":"day"}'import requests
url = "https://app.trdrs.co/api/trading/order"
payload = {
"instrument": "ESU6",
"side": "buy",
"qty": 2,
"clientOrderId": "entry-esu6-1787580900",
"orderType": "limit",
"limitPrice": 6480.5,
"stopLoss": {
"price": 6472.5,
"offsetTicks": 32
},
"takeProfit": {
"price": 6495,
"offsetTicks": 58
},
"tif": "day"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.trdrs.co/api/trading/order",
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([
'instrument' => 'ESU6',
'side' => 'buy',
'qty' => 2,
'clientOrderId' => 'entry-esu6-1787580900',
'orderType' => 'limit',
'limitPrice' => 6480.5,
'stopLoss' => [
'price' => 6472.5,
'offsetTicks' => 32
],
'takeProfit' => [
'price' => 6495,
'offsetTicks' => 58
],
'tif' => 'day'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.trdrs.co/api/trading/order"
payload := strings.NewReader("{\n \"instrument\": \"ESU6\",\n \"side\": \"buy\",\n \"qty\": 2,\n \"clientOrderId\": \"entry-esu6-1787580900\",\n \"orderType\": \"limit\",\n \"limitPrice\": 6480.5,\n \"stopLoss\": {\n \"price\": 6472.5,\n \"offsetTicks\": 32\n },\n \"takeProfit\": {\n \"price\": 6495,\n \"offsetTicks\": 58\n },\n \"tif\": \"day\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.trdrs.co/api/trading/order")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"instrument\": \"ESU6\",\n \"side\": \"buy\",\n \"qty\": 2,\n \"clientOrderId\": \"entry-esu6-1787580900\",\n \"orderType\": \"limit\",\n \"limitPrice\": 6480.5,\n \"stopLoss\": {\n \"price\": 6472.5,\n \"offsetTicks\": 32\n },\n \"takeProfit\": {\n \"price\": 6495,\n \"offsetTicks\": 58\n },\n \"tif\": \"day\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trdrs.co/api/trading/order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"instrument\": \"ESU6\",\n \"side\": \"buy\",\n \"qty\": 2,\n \"clientOrderId\": \"entry-esu6-1787580900\",\n \"orderType\": \"limit\",\n \"limitPrice\": 6480.5,\n \"stopLoss\": {\n \"price\": 6472.5,\n \"offsetTicks\": 32\n },\n \"takeProfit\": {\n \"price\": 6495,\n \"offsetTicks\": 58\n },\n \"tif\": \"day\"\n}"
response = http.request(request)
puts response.read_body{
"brokerOrderId": "234991458",
"filledQty": 2,
"avgFillPrice": 6480.5,
"warnings": []
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}Place an order
Places a market, limit, stop, or stop-limit order. Optional stopLoss/takeProfit attach exits. Atomic: the exits are placed with the order as one unit or not at all. exitPlan instead applies a saved plan by reference — the plan, the revision you previewed, and the token you were given, never levels; it is mutually exclusive with the plain stopLoss/takeProfit legs (400 if both are present). clientOrderId is the idempotency key: identical ids dedup (409 on a duplicate), so retry the same composed intent with the same id. broker/account query params target one connected account.
const res = await fetch('https://app.trdrs.co/api/trading/order', {
method: 'POST',
headers: {
'content-type': 'application/json',
Authorization: `Bearer ${process.env.TRDRS_API_KEY}`,
},
body: JSON.stringify({
"instrument": "ESU6",
"side": "buy",
"qty": 2,
"clientOrderId": "entry-esu6-1787580900",
"orderType": "limit",
"limitPrice": 6480.5,
"stopLoss": {
"price": 6472.5,
"offsetTicks": 32
},
"takeProfit": {
"price": 6495,
"offsetTicks": 58
},
"tif": "day"
}),
})
const data = await res.json()curl -X POST 'https://app.trdrs.co/api/trading/order' \
-H "Authorization: Bearer $TRDRS_API_KEY" \
-H 'content-type: application/json' \
-d '{"instrument":"ESU6","side":"buy","qty":2,"clientOrderId":"entry-esu6-1787580900","orderType":"limit","limitPrice":6480.5,"stopLoss":{"price":6472.5,"offsetTicks":32},"takeProfit":{"price":6495,"offsetTicks":58},"tif":"day"}'import requests
url = "https://app.trdrs.co/api/trading/order"
payload = {
"instrument": "ESU6",
"side": "buy",
"qty": 2,
"clientOrderId": "entry-esu6-1787580900",
"orderType": "limit",
"limitPrice": 6480.5,
"stopLoss": {
"price": 6472.5,
"offsetTicks": 32
},
"takeProfit": {
"price": 6495,
"offsetTicks": 58
},
"tif": "day"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.trdrs.co/api/trading/order",
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([
'instrument' => 'ESU6',
'side' => 'buy',
'qty' => 2,
'clientOrderId' => 'entry-esu6-1787580900',
'orderType' => 'limit',
'limitPrice' => 6480.5,
'stopLoss' => [
'price' => 6472.5,
'offsetTicks' => 32
],
'takeProfit' => [
'price' => 6495,
'offsetTicks' => 58
],
'tif' => 'day'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.trdrs.co/api/trading/order"
payload := strings.NewReader("{\n \"instrument\": \"ESU6\",\n \"side\": \"buy\",\n \"qty\": 2,\n \"clientOrderId\": \"entry-esu6-1787580900\",\n \"orderType\": \"limit\",\n \"limitPrice\": 6480.5,\n \"stopLoss\": {\n \"price\": 6472.5,\n \"offsetTicks\": 32\n },\n \"takeProfit\": {\n \"price\": 6495,\n \"offsetTicks\": 58\n },\n \"tif\": \"day\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.trdrs.co/api/trading/order")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"instrument\": \"ESU6\",\n \"side\": \"buy\",\n \"qty\": 2,\n \"clientOrderId\": \"entry-esu6-1787580900\",\n \"orderType\": \"limit\",\n \"limitPrice\": 6480.5,\n \"stopLoss\": {\n \"price\": 6472.5,\n \"offsetTicks\": 32\n },\n \"takeProfit\": {\n \"price\": 6495,\n \"offsetTicks\": 58\n },\n \"tif\": \"day\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trdrs.co/api/trading/order")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"instrument\": \"ESU6\",\n \"side\": \"buy\",\n \"qty\": 2,\n \"clientOrderId\": \"entry-esu6-1787580900\",\n \"orderType\": \"limit\",\n \"limitPrice\": 6480.5,\n \"stopLoss\": {\n \"price\": 6472.5,\n \"offsetTicks\": 32\n },\n \"takeProfit\": {\n \"price\": 6495,\n \"offsetTicks\": 58\n },\n \"tif\": \"day\"\n}"
response = http.request(request)
puts response.read_body{
"brokerOrderId": "234991458",
"filledQty": 2,
"avgFillPrice": 6480.5,
"warnings": []
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}Authorizations
Your firm’s API key (the API calls this the tenant key; trdrs_sk_…), server-to-server only.
Body
buy, sell Caller-minted; stable across retries of one intent
market, limit, stop, stop_limit The resting limit a 'stop_limit' entry converts to
Protective stop leg (bracket); price and tick-offset forms per the wire contract
Take-profit leg (the bracket target)
WireExitPlanPlacement (@trdrs/contracts): apply a saved plan to this order by reference. Send the plan, the revision you previewed, and the token you were given; do not send levels. The engine reloads the plan at that revision and refuses an edited plan, a deleted one, a changed account, drift or an expiry.
Show child attributes
Show child attributes
{
"planId": "0f6c2d18-7b4a-4a3e-9d21-8c5e4b0a9f37",
"planRevision": "q2Jm4XxT0aVnR7cLp1sZfE9d",
"previewToken": "WyI3YTFmNGM5M2IyOGQwNWU2Il0.9Qp3Vv1sKdN0yTbXmR7cLh"
}
day, gtc Response
Placed. warnings reports non-fatal degradations (a short fill, unregistered auto-management). Surface them.