Orders
Detach TP/SL bracket leg from an order
Removes the take-profit and/or stop-loss bracket from an existing parent order.
Specify detach_tp: true and/or detach_sl: true to remove the respective leg. The detached child orders are cancelled.
If both legs are detached, the parent order becomes a standalone order with no bracket protection.
This is a direct mutation (not queued).
POST
/
trade
/
order
/
detach-bracket
Detach TP/SL bracket leg from an order
curl --request POST \
--url https://api.hyperprop.com/trade/order/detach-bracket \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"leg": "stop_loss",
"order_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
}
'import requests
url = "https://api.hyperprop.com/trade/order/detach-bracket"
payload = {
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"leg": "stop_loss",
"order_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
account_id: '550e8400-e29b-41d4-a716-446655440000',
leg: 'stop_loss',
order_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7'
})
};
fetch('https://api.hyperprop.com/trade/order/detach-bracket', 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.hyperprop.com/trade/order/detach-bracket",
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([
'account_id' => '550e8400-e29b-41d4-a716-446655440000',
'leg' => 'stop_loss',
'order_id' => '7c9e6679-7425-40de-944b-e07fc1f90ae7'
]),
CURLOPT_HTTPHEADER => [
"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://api.hyperprop.com/trade/order/detach-bracket"
payload := strings.NewReader("{\n \"account_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"leg\": \"stop_loss\",\n \"order_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.hyperprop.com/trade/order/detach-bracket")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"leg\": \"stop_loss\",\n \"order_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperprop.com/trade/order/detach-bracket")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"leg\": \"stop_loss\",\n \"order_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\"\n}"
response = http.request(request)
puts response.read_body{
"code": null,
"data": {
"detached_stop_loss_order": null,
"detached_take_profit_order": {
"bracket_type": "take_profit",
"contract": "MNQU6",
"id": "9b5c4d3e-1f6a-4b8c-0d4e-3a7f9c1e5d82",
"limit_price": 29562.25,
"order_type": "limit",
"quantity": 2,
"side": "sell",
"status": "working"
},
"order": {
"contract": "MNQU6",
"id": "7f3a2b1c-9d4e-4f6a-8b2c-1e5d7a9c3b60",
"limit_price": 29510.25,
"order_type": "limit",
"quantity": 2,
"side": "buy",
"status": "working"
}
},
"error": null,
"success": true
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}{
"code": "RATE_LIMITED",
"data": null,
"error": "Rate limit exceeded for order submissions. Max 10 requests per second per account. Retry after 0.1 seconds.",
"rate_limit": {
"limit": 10,
"remaining": 0,
"reset": 1711800125,
"retry_after": 0.1
},
"success": false
}Body
application/json
Detach bracket leg(s) from an existing parent order
UUID of the trading account
Example:
"550e8400-e29b-41d4-a716-446655440000"
UUID of the parent entry order (or one of its child orders)
Example:
"7c9e6679-7425-40de-944b-e07fc1f90ae7"
Which leg to detach: "take_profit", "stop_loss", or "both" (default)
Example:
"both"
Related topics
Attach TP/SL bracket to an existing orderChangelogSet TP/SL at the position level for one (account, contract) pair.Create or update account lockoutCancel a pending order⌘I
Detach TP/SL bracket leg from an order
curl --request POST \
--url https://api.hyperprop.com/trade/order/detach-bracket \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"leg": "stop_loss",
"order_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
}
'import requests
url = "https://api.hyperprop.com/trade/order/detach-bracket"
payload = {
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"leg": "stop_loss",
"order_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
account_id: '550e8400-e29b-41d4-a716-446655440000',
leg: 'stop_loss',
order_id: '7c9e6679-7425-40de-944b-e07fc1f90ae7'
})
};
fetch('https://api.hyperprop.com/trade/order/detach-bracket', 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.hyperprop.com/trade/order/detach-bracket",
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([
'account_id' => '550e8400-e29b-41d4-a716-446655440000',
'leg' => 'stop_loss',
'order_id' => '7c9e6679-7425-40de-944b-e07fc1f90ae7'
]),
CURLOPT_HTTPHEADER => [
"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://api.hyperprop.com/trade/order/detach-bracket"
payload := strings.NewReader("{\n \"account_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"leg\": \"stop_loss\",\n \"order_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.hyperprop.com/trade/order/detach-bracket")
.header("Content-Type", "application/json")
.body("{\n \"account_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"leg\": \"stop_loss\",\n \"order_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperprop.com/trade/order/detach-bracket")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"account_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"leg\": \"stop_loss\",\n \"order_id\": \"7c9e6679-7425-40de-944b-e07fc1f90ae7\"\n}"
response = http.request(request)
puts response.read_body{
"code": null,
"data": {
"detached_stop_loss_order": null,
"detached_take_profit_order": {
"bracket_type": "take_profit",
"contract": "MNQU6",
"id": "9b5c4d3e-1f6a-4b8c-0d4e-3a7f9c1e5d82",
"limit_price": 29562.25,
"order_type": "limit",
"quantity": 2,
"side": "sell",
"status": "working"
},
"order": {
"contract": "MNQU6",
"id": "7f3a2b1c-9d4e-4f6a-8b2c-1e5d7a9c3b60",
"limit_price": 29510.25,
"order_type": "limit",
"quantity": 2,
"side": "buy",
"status": "working"
}
},
"error": null,
"success": true
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}{
"code": "ERROR_CODE",
"data": null,
"error": "Error message describing what went wrong",
"success": false
}{
"code": "RATE_LIMITED",
"data": null,
"error": "Rate limit exceeded for order submissions. Max 10 requests per second per account. Retry after 0.1 seconds.",
"rate_limit": {
"limit": 10,
"remaining": 0,
"reset": 1711800125,
"retry_after": 0.1
},
"success": false
}