curl --request PUT \
--url https://api.trysoar.com/v1/orders/{order_id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"price": 42,
"qty": 100
}
'import requests
url = "https://api.trysoar.com/v1/orders/{order_id}"
payload = {
"price": 42,
"qty": 100
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({price: 42, qty: 100})
};
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 => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'price' => 42,
'qty' => 100
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.trysoar.com/v1/orders/{order_id}"
payload := strings.NewReader("{\n \"price\": 42,\n \"qty\": 100\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-KEY", "<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.put("https://api.trysoar.com/v1/orders/{order_id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"price\": 42,\n \"qty\": 100\n}")
.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::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"price\": 42,\n \"qty\": 100\n}"
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": "insufficient_balance",
"error": "insufficient balance"
}{
"code": "rate_limited",
"error": "rate limited (per-api-key)"
}{
"code": "result_unknown",
"error": "engine result unknown"
}Amend a resting order's price or size
Changes the price and/or remaining size of an order you own in one round
trip instead of cancel-then-recreate. Send at least one of price or
qty; an omitted field keeps its current value.
Price-time priority survives only when price is unchanged and qty
does not increase. Any price change, or any increase in size, makes
this a new order with a new timestamp and therefore a new place in the
queue. This is engine behaviour, not a gateway policy — size down freely,
but requote knowing you go to the back.
curl --request PUT \
--url https://api.trysoar.com/v1/orders/{order_id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"price": 42,
"qty": 100
}
'import requests
url = "https://api.trysoar.com/v1/orders/{order_id}"
payload = {
"price": 42,
"qty": 100
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({price: 42, qty: 100})
};
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 => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'price' => 42,
'qty' => 100
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.trysoar.com/v1/orders/{order_id}"
payload := strings.NewReader("{\n \"price\": 42,\n \"qty\": 100\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-KEY", "<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.put("https://api.trysoar.com/v1/orders/{order_id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"price\": 42,\n \"qty\": 100\n}")
.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::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"price\": 42,\n \"qty\": 100\n}"
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": "insufficient_balance",
"error": "insufficient balance"
}{
"code": "rate_limited",
"error": "rate limited (per-api-key)"
}{
"code": "result_unknown",
"error": "engine result unknown"
}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}$Body
Response
The amended 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?