curl --request PATCH \
--url https://api.tradearies.dev/v1/predictions/orders/{orderId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "ACCOUNT-0001",
"price": "0.45"
}
'import requests
url = "https://api.tradearies.dev/v1/predictions/orders/{orderId}"
payload = {
"accountId": "ACCOUNT-0001",
"price": "0.45"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: 'ACCOUNT-0001', price: '0.45'})
};
fetch('https://api.tradearies.dev/v1/predictions/orders/{orderId}', 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.tradearies.dev/v1/predictions/orders/{orderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => 'ACCOUNT-0001',
'price' => '0.45'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.tradearies.dev/v1/predictions/orders/{orderId}"
payload := strings.NewReader("{\n \"accountId\": \"ACCOUNT-0001\",\n \"price\": \"0.45\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.tradearies.dev/v1/predictions/orders/{orderId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"ACCOUNT-0001\",\n \"price\": \"0.45\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tradearies.dev/v1/predictions/orders/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountId\": \"ACCOUNT-0001\",\n \"price\": \"0.45\"\n}"
response = http.request(request)
puts response.read_bodyReplace Prediction Order
Amends a working prediction-market order’s price, quantity or time in force, and returns as soon as the amend is on its way to the venue.
Use Case: Move a resting order’s limit price, or change its size, without cancelling it.
curl --request PATCH \
--url https://api.tradearies.dev/v1/predictions/orders/{orderId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "ACCOUNT-0001",
"price": "0.45"
}
'import requests
url = "https://api.tradearies.dev/v1/predictions/orders/{orderId}"
payload = {
"accountId": "ACCOUNT-0001",
"price": "0.45"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: 'ACCOUNT-0001', price: '0.45'})
};
fetch('https://api.tradearies.dev/v1/predictions/orders/{orderId}', 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.tradearies.dev/v1/predictions/orders/{orderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => 'ACCOUNT-0001',
'price' => '0.45'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.tradearies.dev/v1/predictions/orders/{orderId}"
payload := strings.NewReader("{\n \"accountId\": \"ACCOUNT-0001\",\n \"price\": \"0.45\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.tradearies.dev/v1/predictions/orders/{orderId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"ACCOUNT-0001\",\n \"price\": \"0.45\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tradearies.dev/v1/predictions/orders/{orderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountId\": \"ACCOUNT-0001\",\n \"price\": \"0.45\"\n}"
response = http.request(request)
puts response.read_bodyhttps://api.tradearies.dev). Request and response shapes may change before general availability.Overview
A replace is asynchronous. The endpoint returns202 Accepted with the order and its amend outstanding (pendingAction is replace). The order keeps working on its current terms until the venue confirms:
- If the venue accepts, the order’s working terms change.
- If the venue refuses, the order keeps its previous terms and the reason is on the order.
Request
SendaccountId and only the terms you want to change. A term you leave out keeps the order’s working value.
{
"accountId": "ACCOUNT-0001",
"price": "0.45"
}
| Field | Notes |
|---|---|
accountId | Required. The account the order is on. You are recorded as the user who asked. |
quantity | New total quantity. It cannot go below what has already executed. |
price | New limit price. |
stopPx | New stop price, for a stop order that has not triggered. |
timeInForce | day, gtc, ioc, fok or gtd. |
expireTime | New expiry, for gtd orders. |
symbol, outcome, side and orderType cannot change. To change them, cancel the order and place a new one. Decimals are exact values sent as JSON strings, and unknown fields are rejected with 400 UNKNOWN_FIELD.
Example
curl -X PATCH "https://api.tradearies.dev/v1/predictions/orders/0192f3a4-5b6c-7d8e-9f01-23456789abcd" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"accountId":"ACCOUNT-0001","price":"0.45"}'
Errors
| Status | code | Meaning |
|---|---|---|
400 | INVALID_ORDER | The amend was refused. message carries the reason, for example no term changed, or a quantity below what has executed. |
400 | EMPTY_BODY, INVALID_JSON, UNKNOWN_FIELD | Missing body, malformed JSON, or a field the endpoint does not accept. |
401 | — | Missing or invalid credentials. |
404 | ORDER_NOT_FOUND | No such order on accountId. |
409 | ORDER_NOT_ACTIONABLE | The order is closed, its state is unknown, an earlier amend or cancel is still awaiting the venue, or the amend would exceed the account’s limits. |
429 | ORDER_ENTRY_AT_CAPACITY | Order entry is at capacity. Nothing was sent; retry shortly. |
503 | ORDER_ENTRY_UNAVAILABLE | Order entry is not accepting requests. Nothing was sent. |
504 | REQUEST_OUTCOME_UNKNOWN | The amend may have reached the venue. Check the order before sending it again. |
Authorizations
OAuth2 Bearer token: obtain an access token from the token endpoint and send it in the Authorization header.
Path Parameters
orderId returned by Place Prediction Order or List Prediction Orders.
Body
Send only the terms to change; a term left out keeps the working order's value. symbol, outcome, side and orderType cannot change, and quantity cannot go below what has executed. Unknown fields are rejected with 400.
The account the order is on.
"ACCOUNT-0001"
New expiry, for gtd orders.
New limit price as an exact decimal string.
"0.45"
New total quantity as an exact decimal string. Must be greater than zero.
"20"
New stop price as an exact decimal string, for an order that has not triggered.
day, gtc, ioc, fok, gtd Response
Amend sent. The venue has not answered yet.
Standard success envelope used by all success responses. data is endpoint-specific.
Was this page helpful?