const res = await fetch('https://app.trdrs.co/api/trading/exits/{id}', {
method: 'DELETE',
headers: { Authorization: `Bearer ${process.env.TRDRS_API_KEY}` },
})
const data = await res.json()curl -X DELETE 'https://app.trdrs.co/api/trading/exits/{id}' \
-H "Authorization: Bearer $TRDRS_API_KEY"import requests
url = "https://app.trdrs.co/api/trading/exits/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.trdrs.co/api/trading/exits/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://app.trdrs.co/api/trading/exits/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://app.trdrs.co/api/trading/exits/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trdrs.co/api/trading/exits/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"bracket": {
"id": "b41e7d2a-9c58-4f03-a6b1-2e8d5c7f0a94",
"state": "active"
},
"refused": null,
"stuck": 0
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}Withdraw a bracket
Cancels every order a bracket rests, then ends it. The position it protected stays open. An order that would not cancel leaves the bracket live, and the answer says so. A bracket waiting on a resting entry the paper book holds it inside leaves the entry resting: the entry is replaced with itself carrying no pairs in the same step that ends the bracket, and the answer’s entryOrderId names the order it rests as afterwards. A hold that refuses new entries refuses that replacement too, and cancelling the entry withdraws its bracket with it.
Required key: Trading API key. A Connect app’s backend can also send it with the app’s API key, and a venue’s backend with its Venue key, which carries trader:trade, each naming one of its own traders in x-trdrs-trader: it then runs on that trader’s own accounts.
const res = await fetch('https://app.trdrs.co/api/trading/exits/{id}', {
method: 'DELETE',
headers: { Authorization: `Bearer ${process.env.TRDRS_API_KEY}` },
})
const data = await res.json()curl -X DELETE 'https://app.trdrs.co/api/trading/exits/{id}' \
-H "Authorization: Bearer $TRDRS_API_KEY"import requests
url = "https://app.trdrs.co/api/trading/exits/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.trdrs.co/api/trading/exits/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://app.trdrs.co/api/trading/exits/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://app.trdrs.co/api/trading/exits/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.trdrs.co/api/trading/exits/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"bracket": {
"id": "b41e7d2a-9c58-4f03-a6b1-2e8d5c7f0a94",
"state": "active"
},
"refused": null,
"stuck": 0
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}{
"error": "invalid_instrument"
}Authorizations
The Trading API key (trdrs_sk_…), for market data, orders and account state on the accounts its owner holds. Use it server-to-server, and keep it on your server. Its scope is named trading in the API.
Path Parameters
The bracket's id.
Query Parameters
The provider the account is at, such as rithmic or paper. Omit it to use your default provider. An unknown value is refused with 400, never replaced with another provider.
The account number at that provider. It must be one of your own accounts, or the call is refused with 400.
Response
The bracket is withdrawn.
A bracket after a protection, a change or a withdrawal.
The bracket.
Show child attributes
Show child attributes
{
"id": "b41e7d2a-9c58-4f03-a6b1-2e8d5c7f0a94",
"state": "active"
}
The provider's reason where it refused a pair, or null. A change of a bracket the provider refuses leaves the bracket as it was. On a protection, the refused pair's part of the position shows as unprotected and the other pairs rest.
How many orders the change meant to cancel that would not cancel and still rest. The bracket keeps them, so the account stream shows them.
On a protection of a resting entry, and on a change or a withdrawal of a bracket waiting on one: the order the entry rests as afterwards. The paper book replaces the entry with itself to change the pairs it carries, so there the entry rests under a new id. Every other provider keeps the entry's id. Absent on every other answer.
"protect-entry-esu6-1787581560"