Python (SDK)
from finance_dev import FinanceDev, models
with FinanceDev(
security=models.Security(
client_id="<YOUR_CLIENT_ID_HERE>",
client_secret="<YOUR_CLIENT_SECRET_HERE>",
),
) as fd_client:
res = fd_client.predictions.orders.replace_prediction_order(order_id="2a410d83-6352-4c2f-b168-8300471c5472", account_id="ACCOUNT-0001", price="0.45", quantity="20")
assert res.object is not None
# Handle response
print(res.object)import { FinanceDev } from "@ariesdotcom/finance-dev";
const financeDev = new FinanceDev({
security: {
clientID: "<YOUR_CLIENT_ID_HERE>",
clientSecret: "<YOUR_CLIENT_SECRET_HERE>",
},
});
async function run() {
const result = await financeDev.predictions.orders.replacePredictionOrder({
orderId: "2a410d83-6352-4c2f-b168-8300471c5472",
body: {
accountId: "ACCOUNT-0001",
price: "0.45",
},
});
console.log(result);
}
run();curl --request PATCH \
--url https://api.aries.com/v1/predictions/orders/{orderId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "ACCOUNT-0001",
"price": "0.45"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: 'ACCOUNT-0001', price: '0.45'})
};
fetch('https://api.aries.com/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.aries.com/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.aries.com/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.aries.com/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.aries.com/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_body{
"success": true,
"data": {
"accountId": "ACCOUNT-0001",
"avgPx": "0",
"contract": {
"description": "Shelley Moore Capito",
"eventDisplayName": "West Virginia Senate General Election November 3 2026",
"eventId": "AXXWV_110326",
"question": "Will Shelley Moore Capito win the West Virginia general election for US Senate in 2026?",
"state": "ACTIVE",
"resultOutcome": "YES",
"settledAt": "2023-11-07T05:31:56Z",
"settlementValue": "1"
},
"createdAt": "2023-11-07T05:31:56Z",
"cumQty": "0",
"leavesQty": "10",
"orderId": "0b9f3c2e-5d6a-4f1b-8e7c-9a0d1e2f3a4b",
"orderType": "limit",
"outcome": "YES",
"quantity": "10",
"side": "buy",
"state": "pending_new",
"symbol": "HORC_1126_Republican",
"timeInForce": "day",
"updatedAt": "2023-11-07T05:31:56Z",
"workingQuantity": "10",
"certainty": "certain",
"certaintyReason": "<string>",
"clOrdId": "<string>",
"clientOrderRef": "7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11",
"closedAt": "2023-11-07T05:31:56Z",
"expireTime": "2023-11-07T05:31:56Z",
"firstAckAt": "2023-11-07T05:31:56Z",
"pendingAction": "none",
"placedBy": "<string>",
"price": "0.54",
"rejectReason": "<string>",
"rejectText": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"stopPx": "0.50",
"venueOrderId": "<string>",
"version": 123,
"workingOrderType": "<string>",
"workingPrice": "0.54"
}
}
Orders
Replace 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.
PATCH
/
v1
/
predictions
/
orders
/
{orderId}
Python (SDK)
from finance_dev import FinanceDev, models
with FinanceDev(
security=models.Security(
client_id="<YOUR_CLIENT_ID_HERE>",
client_secret="<YOUR_CLIENT_SECRET_HERE>",
),
) as fd_client:
res = fd_client.predictions.orders.replace_prediction_order(order_id="2a410d83-6352-4c2f-b168-8300471c5472", account_id="ACCOUNT-0001", price="0.45", quantity="20")
assert res.object is not None
# Handle response
print(res.object)import { FinanceDev } from "@ariesdotcom/finance-dev";
const financeDev = new FinanceDev({
security: {
clientID: "<YOUR_CLIENT_ID_HERE>",
clientSecret: "<YOUR_CLIENT_SECRET_HERE>",
},
});
async function run() {
const result = await financeDev.predictions.orders.replacePredictionOrder({
orderId: "2a410d83-6352-4c2f-b168-8300471c5472",
body: {
accountId: "ACCOUNT-0001",
price: "0.45",
},
});
console.log(result);
}
run();curl --request PATCH \
--url https://api.aries.com/v1/predictions/orders/{orderId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "ACCOUNT-0001",
"price": "0.45"
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: 'ACCOUNT-0001', price: '0.45'})
};
fetch('https://api.aries.com/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.aries.com/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.aries.com/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.aries.com/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.aries.com/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_body{
"success": true,
"data": {
"accountId": "ACCOUNT-0001",
"avgPx": "0",
"contract": {
"description": "Shelley Moore Capito",
"eventDisplayName": "West Virginia Senate General Election November 3 2026",
"eventId": "AXXWV_110326",
"question": "Will Shelley Moore Capito win the West Virginia general election for US Senate in 2026?",
"state": "ACTIVE",
"resultOutcome": "YES",
"settledAt": "2023-11-07T05:31:56Z",
"settlementValue": "1"
},
"createdAt": "2023-11-07T05:31:56Z",
"cumQty": "0",
"leavesQty": "10",
"orderId": "0b9f3c2e-5d6a-4f1b-8e7c-9a0d1e2f3a4b",
"orderType": "limit",
"outcome": "YES",
"quantity": "10",
"side": "buy",
"state": "pending_new",
"symbol": "HORC_1126_Republican",
"timeInForce": "day",
"updatedAt": "2023-11-07T05:31:56Z",
"workingQuantity": "10",
"certainty": "certain",
"certaintyReason": "<string>",
"clOrdId": "<string>",
"clientOrderRef": "7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11",
"closedAt": "2023-11-07T05:31:56Z",
"expireTime": "2023-11-07T05:31:56Z",
"firstAckAt": "2023-11-07T05:31:56Z",
"pendingAction": "none",
"placedBy": "<string>",
"price": "0.54",
"rejectReason": "<string>",
"rejectText": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"stopPx": "0.50",
"venueOrderId": "<string>",
"version": 123,
"workingOrderType": "<string>",
"workingPrice": "0.54"
}
}
This endpoint is in closed beta. It is available only to accounts enrolled in the beta. 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
Path Parameters
Body
application/json
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.
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?