curl --request GET \
--url https://api.trysoar.com/v1/orders/{order_id} \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.trysoar.com/v1/orders/{order_id}"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.trysoar.com/v1/orders/{order_id}', 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.trysoar.com/v1/orders/{order_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <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"
"net/http"
"io"
)
func main() {
url := "https://api.trysoar.com/v1/orders/{order_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.trysoar.com/v1/orders/{order_id}")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trysoar.com/v1/orders/{order_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"order_id": "<string>",
"ticker": "<string>",
"market_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"event_ticker": "<string>",
"outcome": "yes",
"side": "buy",
"price": 50,
"qty": 1,
"remaining_qty": 1,
"filled_qty": 1,
"status": "accepted",
"time_in_force": "gtc",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"client_order_id": "<string>",
"reserved_cents": 1,
"spent_cents": 2
}{
"code": "invalid_enum_value",
"error": "side must be one of \"buy\", \"sell\", got \"hold\""
}{
"code": "unauthenticated",
"error": "API key or bearer token required"
}{
"code": "forbidden_scope",
"error": "api key lacks scope: trade"
}{
"code": "invalid_request_body",
"error": "<string>",
"details": "<string>"
}{
"code": "rate_limited",
"error": "rate limited (per-api-key)"
}Get an order by id
Poll this for durable fill state after a create returns. 404 covers
both “no such order” and “not yours” — the two are not distinguished, to
prevent order-id enumeration.
curl --request GET \
--url https://api.trysoar.com/v1/orders/{order_id} \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.trysoar.com/v1/orders/{order_id}"
headers = {"X-API-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.trysoar.com/v1/orders/{order_id}', 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.trysoar.com/v1/orders/{order_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <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"
"net/http"
"io"
)
func main() {
url := "https://api.trysoar.com/v1/orders/{order_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.trysoar.com/v1/orders/{order_id}")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trysoar.com/v1/orders/{order_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"order_id": "<string>",
"ticker": "<string>",
"market_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"event_ticker": "<string>",
"outcome": "yes",
"side": "buy",
"price": 50,
"qty": 1,
"remaining_qty": 1,
"filled_qty": 1,
"status": "accepted",
"time_in_force": "gtc",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"client_order_id": "<string>",
"reserved_cents": 1,
"spent_cents": 2
}{
"code": "invalid_enum_value",
"error": "side must be one of \"buy\", \"sell\", got \"hold\""
}{
"code": "unauthenticated",
"error": "API key or bearer token required"
}{
"code": "forbidden_scope",
"error": "api key lacks scope: trade"
}{
"code": "invalid_request_body",
"error": "<string>",
"details": "<string>"
}{
"code": "rate_limited",
"error": "rate limited (per-api-key)"
}Authorizations
Per-user API key. Create and revoke keys from your SOAR account settings. A revoked key stops working within 60 seconds.
Path Parameters
Decimal order_id as returned by POST /orders.
^[0-9]{1,20}$Response
The order.
Decimal digits in a string. It is FNV-derived and routinely exceeds 2^53, so a JSON number would be silently rounded by any JavaScript client and you would then cancel an order that does not exist.
^[0-9]{1,20}$This market's ticker.
The parent event's ticker — the prefix this market's ticker begins with.
Which side of the market. Your position is in this outcome.
unknown is emitted only for a stored value this API version does not
recognise (corruption, or an encoding added after your client was
generated). It is declared so one bad row cannot fail the whole page;
treat it as unparseable data rather than a fourth outcome.
yes, no, unknown See Outcome for when unknown appears.
buy, sell, unknown Your limit price in whole cents, for your own outcome.
1 <= x <= 99Original size in shares.
x >= 0x >= 0x >= 0accepted is a transient projection state visible only on reads,
while the durable state catches up. A create or amend response never
returns it: its status is derived from what the engine actually did.
accepted, open, partially_filled, filled, canceled, expired gtc rests until filled or canceled. ioc fills what it can
immediately and cancels the rest. fok fills entirely or not at all.
Omitted means gtc — an order that would silently become ioc dies the
moment it fails to cross.
gtc, ioc, fok, unknown On a read, when the engine sequenced the order. On a create or
amend response, the gateway's submit instant instead — the engine's
reply carries no timestamp, and the authoritative one is only visible
to the projection. The two are within a millisecond, but they are not
the same clock: re-sending an idempotent client_order_id returns the
same order with a fresh created_at. Key on order_id, not on this.
Echoed on the create response when you supplied one. Not stored,
so it is absent from every read (GET /orders, GET /orders/{order_id}) — keep your own mapping. order_id is derived
deterministically from it, so re-sending the identical create is
also a safe way to recover the id.
64Cash locked by this order. Present on reads only — a create or
amend response omits it, because the engine reports the caller's
account-wide reserve there rather than this order's share, and one
field name cannot mean both. For the account-wide figure use
reserved_cents on /portfolio/balance.
x >= 0Present only on the create response of a budget order: the exact
realized cash cost of the execution — fill flow plus taker fees,
cent for cent what left your balance. Absent on qty orders and on
every read (the projection does not store it); reconcile historical
executions against /portfolio/fills. On a budget order the
executed size is qty (= filled_qty), so spent_cents / qty is
your realized average cost per share, fees included.
x >= 1Was this page helpful?