Submit an order
curl --request POST \ --url http://localhost:3001/orders/submit \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{"account_id":null,"client_order_id":"my-ref-001","instrument_id":null,"limit_price":null,"order_id":"3f6b1c2e-8a4d-4e5f-9b21-1c2d3e4f5a6b","order_type":"market","portfolio_id":"b2c3d4e5-6f70-4812-93a4-556677889900","quantity":1,"side":"buy","symbol":"SPY260918C00770000@OPRA","time_in_force":"day","venue":null}'import requests
url = "http://localhost:3001/orders/submit"
payload = { "account_id": None, "client_order_id": "my-ref-001", "instrument_id": None, "limit_price": None, "order_id": "3f6b1c2e-8a4d-4e5f-9b21-1c2d3e4f5a6b", "order_type": "market", "portfolio_id": "b2c3d4e5-6f70-4812-93a4-556677889900", "quantity": 1, "side": "buy", "symbol": "SPY260918C00770000@OPRA", "time_in_force": "day", "venue": None}headers = { "Authorization": "Bearer <token>", "Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.status_code)use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "http://localhost:3001/orders/submit";
let payload = json!({ "account_id": json!(null), "client_order_id": "my-ref-001", "instrument_id": json!(null), "limit_price": json!(null), "order_id": "3f6b1c2e-8a4d-4e5f-9b21-1c2d3e4f5a6b", "order_type": "market", "portfolio_id": "b2c3d4e5-6f70-4812-93a4-556677889900", "quantity": 1, "side": "buy", "symbol": "SPY260918C00770000@OPRA", "time_in_force": "day", "venue": json!(null) });
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap());
let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .json(&payload) .send() .await;
let status = response.unwrap().status();
dbg!(status);}Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Wire payload for POST /orders/submit. account_id is optional — when omitted it is
resolved from the portfolio’s default_account_id; when present it overrides.
object
Optional account UUID; omit to use the portfolio’s default account.
Example
nullYour own reference string, echoed back on updates.
Example
my-ref-001Instrument surrogate key (BIGINT as string), not a UUID. Omit when naming the
instrument by symbol instead.
Example
nullRequired for limit orders; omit for market.
Example
nullClient-generated UUID; also the idempotency key (a repeat is a 409).
Example
3f6b1c2e-8a4d-4e5f-9b21-1c2d3e4f5a6bPortfolio UUID the order books against.
Example
b2c3d4e5-6f70-4812-93a4-556677889900Example
1The instrument’s venue-native symbol, as an alternative to instrument_id.
Accepts the Symbol@Venue shorthand (SPY260918C00770000@OPRA) or a bare
symbol qualified by the venue field.
Example
SPY260918C00770000@OPRAVenue (MIC) qualifying symbol. Omit when symbol already carries @VENUE,
or when the symbol is unique across venues.
Example
nullResponses
Section titled “Responses”Order accepted and routed
Validation error
No trade grant for principal/portfolio/account
Order already exists
Instrument not found, inactive, no tradeable broker mapping, or rejected by pre-trade risk
Broker rejected the order
No broker adapter configured