curl --request POST \
--url https://api.rivermarkets.com/v1/complex-orders \
--header 'Content-Type: application/json' \
--header 'X-River-Key-Id: <api-key>' \
--header 'X-River-Signature: <api-key>' \
--header 'X-River-Timestamp: <api-key>' \
--data '
{
"subaccount_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"river_id": 123,
"generic_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_river_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_complex_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"iceberg_order_params": {
"buy_flag": true,
"total_qty": 123,
"displayed_qty": 123,
"limit_price": 123,
"post_only": false,
"cancel_order_on_pause": true,
"reload_delay_s": 1800,
"expiry_ts_utc": "2023-11-07T05:31:56Z"
},
"peg_order_params": {
"buy_flag": true,
"total_qty": 123,
"min_price": 0.5,
"max_price": 0.5,
"post_only": false,
"expiry_ts_utc": "2023-11-07T05:31:56Z",
"peg_min_stay_time_s": 1800,
"max_qty_level": 1
},
"smart_taker_order_params": {
"buy_flag": true,
"total_qty": 123,
"limit_price": 123,
"min_qty": 123,
"expiry_ts_utc": "2023-11-07T05:31:56Z"
}
}
'import requests
url = "https://api.rivermarkets.com/v1/complex-orders"
payload = {
"subaccount_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"river_id": 123,
"generic_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_river_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_complex_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"iceberg_order_params": {
"buy_flag": True,
"total_qty": 123,
"displayed_qty": 123,
"limit_price": 123,
"post_only": False,
"cancel_order_on_pause": True,
"reload_delay_s": 1800,
"expiry_ts_utc": "2023-11-07T05:31:56Z"
},
"peg_order_params": {
"buy_flag": True,
"total_qty": 123,
"min_price": 0.5,
"max_price": 0.5,
"post_only": False,
"expiry_ts_utc": "2023-11-07T05:31:56Z",
"peg_min_stay_time_s": 1800,
"max_qty_level": 1
},
"smart_taker_order_params": {
"buy_flag": True,
"total_qty": 123,
"limit_price": 123,
"min_qty": 123,
"expiry_ts_utc": "2023-11-07T05:31:56Z"
}
}
headers = {
"X-River-Key-Id": "<api-key>",
"X-River-Timestamp": "<api-key>",
"X-River-Signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-River-Key-Id': '<api-key>',
'X-River-Timestamp': '<api-key>',
'X-River-Signature': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
subaccount_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
river_id: 123,
generic_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_river_order_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
parent_complex_order_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
},
iceberg_order_params: {
buy_flag: true,
total_qty: 123,
displayed_qty: 123,
limit_price: 123,
post_only: false,
cancel_order_on_pause: true,
reload_delay_s: 1800,
expiry_ts_utc: '2023-11-07T05:31:56Z'
},
peg_order_params: {
buy_flag: true,
total_qty: 123,
min_price: 0.5,
max_price: 0.5,
post_only: false,
expiry_ts_utc: '2023-11-07T05:31:56Z',
peg_min_stay_time_s: 1800,
max_qty_level: 1
},
smart_taker_order_params: {
buy_flag: true,
total_qty: 123,
limit_price: 123,
min_qty: 123,
expiry_ts_utc: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://api.rivermarkets.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.rivermarkets.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',
'river_id' => 123,
'generic_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_river_order_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'parent_complex_order_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'iceberg_order_params' => [
'buy_flag' => true,
'total_qty' => 123,
'displayed_qty' => 123,
'limit_price' => 123,
'post_only' => false,
'cancel_order_on_pause' => true,
'reload_delay_s' => 1800,
'expiry_ts_utc' => '2023-11-07T05:31:56Z'
],
'peg_order_params' => [
'buy_flag' => true,
'total_qty' => 123,
'min_price' => 0.5,
'max_price' => 0.5,
'post_only' => false,
'expiry_ts_utc' => '2023-11-07T05:31:56Z',
'peg_min_stay_time_s' => 1800,
'max_qty_level' => 1
],
'smart_taker_order_params' => [
'buy_flag' => true,
'total_qty' => 123,
'limit_price' => 123,
'min_qty' => 123,
'expiry_ts_utc' => '2023-11-07T05:31:56Z'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-River-Key-Id: <api-key>",
"X-River-Signature: <api-key>",
"X-River-Timestamp: <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.rivermarkets.com/v1/complex-orders"
payload := strings.NewReader("{\n \"subaccount_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"river_id\": 123,\n \"generic_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_river_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_complex_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"iceberg_order_params\": {\n \"buy_flag\": true,\n \"total_qty\": 123,\n \"displayed_qty\": 123,\n \"limit_price\": 123,\n \"post_only\": false,\n \"cancel_order_on_pause\": true,\n \"reload_delay_s\": 1800,\n \"expiry_ts_utc\": \"2023-11-07T05:31:56Z\"\n },\n \"peg_order_params\": {\n \"buy_flag\": true,\n \"total_qty\": 123,\n \"min_price\": 0.5,\n \"max_price\": 0.5,\n \"post_only\": false,\n \"expiry_ts_utc\": \"2023-11-07T05:31:56Z\",\n \"peg_min_stay_time_s\": 1800,\n \"max_qty_level\": 1\n },\n \"smart_taker_order_params\": {\n \"buy_flag\": true,\n \"total_qty\": 123,\n \"limit_price\": 123,\n \"min_qty\": 123,\n \"expiry_ts_utc\": \"2023-11-07T05:31:56Z\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-River-Key-Id", "<api-key>")
req.Header.Add("X-River-Timestamp", "<api-key>")
req.Header.Add("X-River-Signature", "<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.rivermarkets.com/v1/complex-orders")
.header("X-River-Key-Id", "<api-key>")
.header("X-River-Timestamp", "<api-key>")
.header("X-River-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"subaccount_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"river_id\": 123,\n \"generic_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_river_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_complex_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"iceberg_order_params\": {\n \"buy_flag\": true,\n \"total_qty\": 123,\n \"displayed_qty\": 123,\n \"limit_price\": 123,\n \"post_only\": false,\n \"cancel_order_on_pause\": true,\n \"reload_delay_s\": 1800,\n \"expiry_ts_utc\": \"2023-11-07T05:31:56Z\"\n },\n \"peg_order_params\": {\n \"buy_flag\": true,\n \"total_qty\": 123,\n \"min_price\": 0.5,\n \"max_price\": 0.5,\n \"post_only\": false,\n \"expiry_ts_utc\": \"2023-11-07T05:31:56Z\",\n \"peg_min_stay_time_s\": 1800,\n \"max_qty_level\": 1\n },\n \"smart_taker_order_params\": {\n \"buy_flag\": true,\n \"total_qty\": 123,\n \"limit_price\": 123,\n \"min_qty\": 123,\n \"expiry_ts_utc\": \"2023-11-07T05:31:56Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rivermarkets.com/v1/complex-orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-River-Key-Id"] = '<api-key>'
request["X-River-Timestamp"] = '<api-key>'
request["X-River-Signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subaccount_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"river_id\": 123,\n \"generic_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_river_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_complex_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"iceberg_order_params\": {\n \"buy_flag\": true,\n \"total_qty\": 123,\n \"displayed_qty\": 123,\n \"limit_price\": 123,\n \"post_only\": false,\n \"cancel_order_on_pause\": true,\n \"reload_delay_s\": 1800,\n \"expiry_ts_utc\": \"2023-11-07T05:31:56Z\"\n },\n \"peg_order_params\": {\n \"buy_flag\": true,\n \"total_qty\": 123,\n \"min_price\": 0.5,\n \"max_price\": 0.5,\n \"post_only\": false,\n \"expiry_ts_utc\": \"2023-11-07T05:31:56Z\",\n \"peg_min_stay_time_s\": 1800,\n \"max_qty_level\": 1\n },\n \"smart_taker_order_params\": {\n \"buy_flag\": true,\n \"total_qty\": 123,\n \"limit_price\": 123,\n \"min_qty\": 123,\n \"expiry_ts_utc\": \"2023-11-07T05:31:56Z\"\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": {}
}
]
}Create Complex Order
Create a new complex order (conditional or iceberg).
Provide exactly one of conditional_order_params (TP/SL/STOP) or
iceberg_order_params. The body shape determines the complex_order_type.
Returns 202 Accepted with the persisted complex order in PENDING status, enqueued for activation by the appropriate consumer service.
curl --request POST \
--url https://api.rivermarkets.com/v1/complex-orders \
--header 'Content-Type: application/json' \
--header 'X-River-Key-Id: <api-key>' \
--header 'X-River-Signature: <api-key>' \
--header 'X-River-Timestamp: <api-key>' \
--data '
{
"subaccount_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"river_id": 123,
"generic_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_river_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_complex_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"iceberg_order_params": {
"buy_flag": true,
"total_qty": 123,
"displayed_qty": 123,
"limit_price": 123,
"post_only": false,
"cancel_order_on_pause": true,
"reload_delay_s": 1800,
"expiry_ts_utc": "2023-11-07T05:31:56Z"
},
"peg_order_params": {
"buy_flag": true,
"total_qty": 123,
"min_price": 0.5,
"max_price": 0.5,
"post_only": false,
"expiry_ts_utc": "2023-11-07T05:31:56Z",
"peg_min_stay_time_s": 1800,
"max_qty_level": 1
},
"smart_taker_order_params": {
"buy_flag": true,
"total_qty": 123,
"limit_price": 123,
"min_qty": 123,
"expiry_ts_utc": "2023-11-07T05:31:56Z"
}
}
'import requests
url = "https://api.rivermarkets.com/v1/complex-orders"
payload = {
"subaccount_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"river_id": 123,
"generic_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_river_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"parent_complex_order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"iceberg_order_params": {
"buy_flag": True,
"total_qty": 123,
"displayed_qty": 123,
"limit_price": 123,
"post_only": False,
"cancel_order_on_pause": True,
"reload_delay_s": 1800,
"expiry_ts_utc": "2023-11-07T05:31:56Z"
},
"peg_order_params": {
"buy_flag": True,
"total_qty": 123,
"min_price": 0.5,
"max_price": 0.5,
"post_only": False,
"expiry_ts_utc": "2023-11-07T05:31:56Z",
"peg_min_stay_time_s": 1800,
"max_qty_level": 1
},
"smart_taker_order_params": {
"buy_flag": True,
"total_qty": 123,
"limit_price": 123,
"min_qty": 123,
"expiry_ts_utc": "2023-11-07T05:31:56Z"
}
}
headers = {
"X-River-Key-Id": "<api-key>",
"X-River-Timestamp": "<api-key>",
"X-River-Signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-River-Key-Id': '<api-key>',
'X-River-Timestamp': '<api-key>',
'X-River-Signature': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
subaccount_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
river_id: 123,
generic_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_river_order_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
parent_complex_order_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
},
iceberg_order_params: {
buy_flag: true,
total_qty: 123,
displayed_qty: 123,
limit_price: 123,
post_only: false,
cancel_order_on_pause: true,
reload_delay_s: 1800,
expiry_ts_utc: '2023-11-07T05:31:56Z'
},
peg_order_params: {
buy_flag: true,
total_qty: 123,
min_price: 0.5,
max_price: 0.5,
post_only: false,
expiry_ts_utc: '2023-11-07T05:31:56Z',
peg_min_stay_time_s: 1800,
max_qty_level: 1
},
smart_taker_order_params: {
buy_flag: true,
total_qty: 123,
limit_price: 123,
min_qty: 123,
expiry_ts_utc: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://api.rivermarkets.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.rivermarkets.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',
'river_id' => 123,
'generic_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_river_order_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'parent_complex_order_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'iceberg_order_params' => [
'buy_flag' => true,
'total_qty' => 123,
'displayed_qty' => 123,
'limit_price' => 123,
'post_only' => false,
'cancel_order_on_pause' => true,
'reload_delay_s' => 1800,
'expiry_ts_utc' => '2023-11-07T05:31:56Z'
],
'peg_order_params' => [
'buy_flag' => true,
'total_qty' => 123,
'min_price' => 0.5,
'max_price' => 0.5,
'post_only' => false,
'expiry_ts_utc' => '2023-11-07T05:31:56Z',
'peg_min_stay_time_s' => 1800,
'max_qty_level' => 1
],
'smart_taker_order_params' => [
'buy_flag' => true,
'total_qty' => 123,
'limit_price' => 123,
'min_qty' => 123,
'expiry_ts_utc' => '2023-11-07T05:31:56Z'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-River-Key-Id: <api-key>",
"X-River-Signature: <api-key>",
"X-River-Timestamp: <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.rivermarkets.com/v1/complex-orders"
payload := strings.NewReader("{\n \"subaccount_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"river_id\": 123,\n \"generic_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_river_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_complex_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"iceberg_order_params\": {\n \"buy_flag\": true,\n \"total_qty\": 123,\n \"displayed_qty\": 123,\n \"limit_price\": 123,\n \"post_only\": false,\n \"cancel_order_on_pause\": true,\n \"reload_delay_s\": 1800,\n \"expiry_ts_utc\": \"2023-11-07T05:31:56Z\"\n },\n \"peg_order_params\": {\n \"buy_flag\": true,\n \"total_qty\": 123,\n \"min_price\": 0.5,\n \"max_price\": 0.5,\n \"post_only\": false,\n \"expiry_ts_utc\": \"2023-11-07T05:31:56Z\",\n \"peg_min_stay_time_s\": 1800,\n \"max_qty_level\": 1\n },\n \"smart_taker_order_params\": {\n \"buy_flag\": true,\n \"total_qty\": 123,\n \"limit_price\": 123,\n \"min_qty\": 123,\n \"expiry_ts_utc\": \"2023-11-07T05:31:56Z\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-River-Key-Id", "<api-key>")
req.Header.Add("X-River-Timestamp", "<api-key>")
req.Header.Add("X-River-Signature", "<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.rivermarkets.com/v1/complex-orders")
.header("X-River-Key-Id", "<api-key>")
.header("X-River-Timestamp", "<api-key>")
.header("X-River-Signature", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"subaccount_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"river_id\": 123,\n \"generic_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_river_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_complex_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"iceberg_order_params\": {\n \"buy_flag\": true,\n \"total_qty\": 123,\n \"displayed_qty\": 123,\n \"limit_price\": 123,\n \"post_only\": false,\n \"cancel_order_on_pause\": true,\n \"reload_delay_s\": 1800,\n \"expiry_ts_utc\": \"2023-11-07T05:31:56Z\"\n },\n \"peg_order_params\": {\n \"buy_flag\": true,\n \"total_qty\": 123,\n \"min_price\": 0.5,\n \"max_price\": 0.5,\n \"post_only\": false,\n \"expiry_ts_utc\": \"2023-11-07T05:31:56Z\",\n \"peg_min_stay_time_s\": 1800,\n \"max_qty_level\": 1\n },\n \"smart_taker_order_params\": {\n \"buy_flag\": true,\n \"total_qty\": 123,\n \"limit_price\": 123,\n \"min_qty\": 123,\n \"expiry_ts_utc\": \"2023-11-07T05:31:56Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rivermarkets.com/v1/complex-orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-River-Key-Id"] = '<api-key>'
request["X-River-Timestamp"] = '<api-key>'
request["X-River-Signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subaccount_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"river_id\": 123,\n \"generic_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_river_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"parent_complex_order_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"iceberg_order_params\": {\n \"buy_flag\": true,\n \"total_qty\": 123,\n \"displayed_qty\": 123,\n \"limit_price\": 123,\n \"post_only\": false,\n \"cancel_order_on_pause\": true,\n \"reload_delay_s\": 1800,\n \"expiry_ts_utc\": \"2023-11-07T05:31:56Z\"\n },\n \"peg_order_params\": {\n \"buy_flag\": true,\n \"total_qty\": 123,\n \"min_price\": 0.5,\n \"max_price\": 0.5,\n \"post_only\": false,\n \"expiry_ts_utc\": \"2023-11-07T05:31:56Z\",\n \"peg_min_stay_time_s\": 1800,\n \"max_qty_level\": 1\n },\n \"smart_taker_order_params\": {\n \"buy_flag\": true,\n \"total_qty\": 123,\n \"limit_price\": 123,\n \"min_qty\": 123,\n \"expiry_ts_utc\": \"2023-11-07T05:31:56Z\"\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": {}
}
]
}Authorizations
UUID of your API key (from Settings → API Keys).
Current unix seconds. Must be within 30s of server time.
Base64 Ed25519 signature over the canonical request: METHOD\nPATH\nSORTED_QUERY\nTIMESTAMP\nSHA256(body) hex. See /api-reference/authentication for the full recipe.
Body
Request body for creating a complex order.
Provide exactly one of conditional_order_params (TP/SL/STOP) or
iceberg_order_params (iceberg). The active param block determines the
complex_order_type.
Subaccount to create the order under
Instrument ID. Mutually exclusive with generic_asset_id.
Generic asset basket ID. Mutually exclusive with river_id.
Conditional order parameters (TP/SL/STOP)
Show child attributes
Show child attributes
Iceberg order parameters
Show child attributes
Show child attributes
Peg order parameters
Show child attributes
Show child attributes
Smart-taker 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

