Create Complex Order
curl --request POST \
--url https://api.centosfi.com/v1/complex-orders \
--header 'Content-Type: application/json' \
--data '
{
"subaccount_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"centos_id": 123,
"custom_asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conditional_order_params": {
"trigger_order": {
"qty": 123,
"buy_flag": true,
"price": 0.5,
"stop_order_price": 0.5
},
"stop_order_price": 0.5,
"parent_centos_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_complex_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
'import requests
url = "https://api.centosfi.com/v1/complex-orders"
payload = {
"subaccount_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"centos_id": 123,
"custom_asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conditional_order_params": {
"trigger_order": {
"qty": 123,
"buy_flag": True,
"price": 0.5,
"stop_order_price": 0.5
},
"stop_order_price": 0.5,
"parent_centos_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_complex_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
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({
subaccount_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
centos_id: 123,
custom_asset_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
conditional_order_params: {
trigger_order: {qty: 123, buy_flag: true, price: 0.5, stop_order_price: 0.5},
stop_order_price: 0.5,
parent_centos_order_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
parent_complex_order_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
})
};
fetch('https://api.centosfi.com/v1/complex-orders', 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.centosfi.com/v1/complex-orders",
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([
'subaccount_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'centos_id' => 123,
'custom_asset_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'conditional_order_params' => [
'trigger_order' => [
'qty' => 123,
'buy_flag' => true,
'price' => 0.5,
'stop_order_price' => 0.5
],
'stop_order_price' => 0.5,
'parent_centos_order_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'parent_complex_order_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
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.centosfi.com/v1/complex-orders"
payload := strings.NewReader("{\n \"subaccount_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"centos_id\": 123,\n \"custom_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"conditional_order_params\": {\n \"trigger_order\": {\n \"qty\": 123,\n \"buy_flag\": true,\n \"price\": 0.5,\n \"stop_order_price\": 0.5\n },\n \"stop_order_price\": 0.5,\n \"parent_centos_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_complex_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\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.centosfi.com/v1/complex-orders")
.header("Content-Type", "application/json")
.body("{\n \"subaccount_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"centos_id\": 123,\n \"custom_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"conditional_order_params\": {\n \"trigger_order\": {\n \"qty\": 123,\n \"buy_flag\": true,\n \"price\": 0.5,\n \"stop_order_price\": 0.5\n },\n \"stop_order_price\": 0.5,\n \"parent_centos_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_complex_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.centosfi.com/v1/complex-orders")
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 \"subaccount_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"centos_id\": 123,\n \"custom_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"conditional_order_params\": {\n \"trigger_order\": {\n \"qty\": 123,\n \"buy_flag\": true,\n \"price\": 0.5,\n \"stop_order_price\": 0.5\n },\n \"stop_order_price\": 0.5,\n \"parent_centos_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_complex_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n}"
response = http.request(request)
puts response.read_body{
"complex_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Complex Orders
Create Complex Order
Create a new complex order.
Currently supports conditional orders (TP, SL, STOP). The order is persisted
immediately with PENDING status and queued for activation.
Conditional Order Types:
TP: Take-profit attached to a parent order. Requiresparent_centos_order_idorparent_complex_order_id.SL: Stop-loss attached to a parent order. Requiresparent_centos_order_idorparent_complex_order_id.STOP: Standalone stop order triggered by market price.
Response:
Returns 202 Accepted with the complex order in PENDING status.
POST
/
v1
/
complex-orders
Create Complex Order
curl --request POST \
--url https://api.centosfi.com/v1/complex-orders \
--header 'Content-Type: application/json' \
--data '
{
"subaccount_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"centos_id": 123,
"custom_asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conditional_order_params": {
"trigger_order": {
"qty": 123,
"buy_flag": true,
"price": 0.5,
"stop_order_price": 0.5
},
"stop_order_price": 0.5,
"parent_centos_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_complex_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
'import requests
url = "https://api.centosfi.com/v1/complex-orders"
payload = {
"subaccount_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"centos_id": 123,
"custom_asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conditional_order_params": {
"trigger_order": {
"qty": 123,
"buy_flag": True,
"price": 0.5,
"stop_order_price": 0.5
},
"stop_order_price": 0.5,
"parent_centos_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_complex_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}
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({
subaccount_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
centos_id: 123,
custom_asset_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
conditional_order_params: {
trigger_order: {qty: 123, buy_flag: true, price: 0.5, stop_order_price: 0.5},
stop_order_price: 0.5,
parent_centos_order_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
parent_complex_order_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
})
};
fetch('https://api.centosfi.com/v1/complex-orders', 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.centosfi.com/v1/complex-orders",
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([
'subaccount_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'centos_id' => 123,
'custom_asset_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'conditional_order_params' => [
'trigger_order' => [
'qty' => 123,
'buy_flag' => true,
'price' => 0.5,
'stop_order_price' => 0.5
],
'stop_order_price' => 0.5,
'parent_centos_order_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'parent_complex_order_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
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.centosfi.com/v1/complex-orders"
payload := strings.NewReader("{\n \"subaccount_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"centos_id\": 123,\n \"custom_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"conditional_order_params\": {\n \"trigger_order\": {\n \"qty\": 123,\n \"buy_flag\": true,\n \"price\": 0.5,\n \"stop_order_price\": 0.5\n },\n \"stop_order_price\": 0.5,\n \"parent_centos_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_complex_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\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.centosfi.com/v1/complex-orders")
.header("Content-Type", "application/json")
.body("{\n \"subaccount_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"centos_id\": 123,\n \"custom_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"conditional_order_params\": {\n \"trigger_order\": {\n \"qty\": 123,\n \"buy_flag\": true,\n \"price\": 0.5,\n \"stop_order_price\": 0.5\n },\n \"stop_order_price\": 0.5,\n \"parent_centos_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_complex_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.centosfi.com/v1/complex-orders")
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 \"subaccount_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"centos_id\": 123,\n \"custom_asset_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"conditional_order_params\": {\n \"trigger_order\": {\n \"qty\": 123,\n \"buy_flag\": true,\n \"price\": 0.5,\n \"stop_order_price\": 0.5\n },\n \"stop_order_price\": 0.5,\n \"parent_centos_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_complex_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n}"
response = http.request(request)
puts response.read_body{
"complex_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
application/json
Request body for creating a complex order (conditional order).
Subaccount to create the order under
Instrument ID. Mutually exclusive with custom_asset_id.
Custom asset basket ID. Mutually exclusive with centos_id.
Conditional order parameters
Show child attributes
Show child attributes
Response
Successful Response
Schema for a complex order response (unified across all complex order types).
Unique complex order identifier
⌘I

