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.prediction_orders.create(account_id="ACCOUNT-0001", order_type=models.OrderType.LIMIT, outcome=models.PredOrdersPlaceOrderRequestOutcome.YES, quantity="10", side=models.PredOrdersPlaceOrderRequestSide.BUY, symbol="HORC_1126_Republican", time_in_force=models.PredOrdersPlaceOrderRequestTimeInForce.DAY, idempotency_key="7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11", client_order_ref="7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11", price="0.54", stop_px="0.50")
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.predictionOrders.create({
idempotencyKey: "7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11",
body: {
accountId: "ACCOUNT-0001",
clientOrderRef: "7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11",
orderType: "limit",
outcome: "YES",
price: "0.54",
quantity: "10",
side: "buy",
symbol: "HORC_1126_Republican",
timeInForce: "day",
},
});
console.log(result);
}
run();curl --request POST \
--url https://api.aries.com/v1/predictions/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "ACCOUNT-0001",
"clientOrderRef": "7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11",
"orderType": "limit",
"outcome": "YES",
"price": "0.54",
"quantity": "10",
"side": "buy",
"symbol": "HORC_1126_Republican",
"timeInForce": "day"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountId: 'ACCOUNT-0001',
clientOrderRef: '7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11',
orderType: 'limit',
outcome: 'YES',
price: '0.54',
quantity: '10',
side: 'buy',
symbol: 'HORC_1126_Republican',
timeInForce: 'day'
})
};
fetch('https://api.aries.com/v1/predictions/orders', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => 'ACCOUNT-0001',
'clientOrderRef' => '7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11',
'orderType' => 'limit',
'outcome' => 'YES',
'price' => '0.54',
'quantity' => '10',
'side' => 'buy',
'symbol' => 'HORC_1126_Republican',
'timeInForce' => 'day'
]),
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"
payload := strings.NewReader("{\n \"accountId\": \"ACCOUNT-0001\",\n \"clientOrderRef\": \"7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11\",\n \"orderType\": \"limit\",\n \"outcome\": \"YES\",\n \"price\": \"0.54\",\n \"quantity\": \"10\",\n \"side\": \"buy\",\n \"symbol\": \"HORC_1126_Republican\",\n \"timeInForce\": \"day\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.aries.com/v1/predictions/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"ACCOUNT-0001\",\n \"clientOrderRef\": \"7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11\",\n \"orderType\": \"limit\",\n \"outcome\": \"YES\",\n \"price\": \"0.54\",\n \"quantity\": \"10\",\n \"side\": \"buy\",\n \"symbol\": \"HORC_1126_Republican\",\n \"timeInForce\": \"day\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aries.com/v1/predictions/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountId\": \"ACCOUNT-0001\",\n \"clientOrderRef\": \"7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11\",\n \"orderType\": \"limit\",\n \"outcome\": \"YES\",\n \"price\": \"0.54\",\n \"quantity\": \"10\",\n \"side\": \"buy\",\n \"symbol\": \"HORC_1126_Republican\",\n \"timeInForce\": \"day\"\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
Place Prediction Order
Places a prediction-market order for the authenticated user and returns as soon as the order is on its way to the venue.
Use Case: Buy or sell YES or NO contracts on a prediction-market event.
POST
/
v1
/
predictions
/
orders
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.prediction_orders.create(account_id="ACCOUNT-0001", order_type=models.OrderType.LIMIT, outcome=models.PredOrdersPlaceOrderRequestOutcome.YES, quantity="10", side=models.PredOrdersPlaceOrderRequestSide.BUY, symbol="HORC_1126_Republican", time_in_force=models.PredOrdersPlaceOrderRequestTimeInForce.DAY, idempotency_key="7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11", client_order_ref="7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11", price="0.54", stop_px="0.50")
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.predictionOrders.create({
idempotencyKey: "7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11",
body: {
accountId: "ACCOUNT-0001",
clientOrderRef: "7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11",
orderType: "limit",
outcome: "YES",
price: "0.54",
quantity: "10",
side: "buy",
symbol: "HORC_1126_Republican",
timeInForce: "day",
},
});
console.log(result);
}
run();curl --request POST \
--url https://api.aries.com/v1/predictions/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "ACCOUNT-0001",
"clientOrderRef": "7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11",
"orderType": "limit",
"outcome": "YES",
"price": "0.54",
"quantity": "10",
"side": "buy",
"symbol": "HORC_1126_Republican",
"timeInForce": "day"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountId: 'ACCOUNT-0001',
clientOrderRef: '7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11',
orderType: 'limit',
outcome: 'YES',
price: '0.54',
quantity: '10',
side: 'buy',
symbol: 'HORC_1126_Republican',
timeInForce: 'day'
})
};
fetch('https://api.aries.com/v1/predictions/orders', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => 'ACCOUNT-0001',
'clientOrderRef' => '7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11',
'orderType' => 'limit',
'outcome' => 'YES',
'price' => '0.54',
'quantity' => '10',
'side' => 'buy',
'symbol' => 'HORC_1126_Republican',
'timeInForce' => 'day'
]),
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"
payload := strings.NewReader("{\n \"accountId\": \"ACCOUNT-0001\",\n \"clientOrderRef\": \"7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11\",\n \"orderType\": \"limit\",\n \"outcome\": \"YES\",\n \"price\": \"0.54\",\n \"quantity\": \"10\",\n \"side\": \"buy\",\n \"symbol\": \"HORC_1126_Republican\",\n \"timeInForce\": \"day\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.aries.com/v1/predictions/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"accountId\": \"ACCOUNT-0001\",\n \"clientOrderRef\": \"7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11\",\n \"orderType\": \"limit\",\n \"outcome\": \"YES\",\n \"price\": \"0.54\",\n \"quantity\": \"10\",\n \"side\": \"buy\",\n \"symbol\": \"HORC_1126_Republican\",\n \"timeInForce\": \"day\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aries.com/v1/predictions/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"accountId\": \"ACCOUNT-0001\",\n \"clientOrderRef\": \"7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11\",\n \"orderType\": \"limit\",\n \"outcome\": \"YES\",\n \"price\": \"0.54\",\n \"quantity\": \"10\",\n \"side\": \"buy\",\n \"symbol\": \"HORC_1126_Republican\",\n \"timeInForce\": \"day\"\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
Placement is asynchronous. The endpoint returns202 Accepted with the order as soon as it has been sent to the venue, normally in state pending_new. The venue’s answer (acknowledgement, rejection with its reason, or fills) arrives afterwards. Read it back with Get Prediction Order using the returned orderId.
A 202 means the order was sent. It does not mean the order was accepted by the venue.
Request
{
"accountId": "ACCOUNT-0001",
"clientOrderRef": "7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11",
"symbol": "HORC_1126_Republican",
"outcome": "YES",
"side": "buy",
"orderType": "limit",
"timeInForce": "day",
"quantity": "10",
"price": "0.54"
}
symbolis a contract symbol from search or Get Event Contracts.outcomeis the binary outcome you trade,YESorNO. It is never inferred fromside.quantity,price, andstopPxare exact decimals sent as JSON strings.orderTypeislimitorstop_limit. ForecastEx does not supportstopormarket_to_limitorders, and both are rejected with400.- Unknown fields are rejected with
400UNKNOWN_FIELD.
orderType and timeInForce:
| Field | Required when |
|---|---|
price | orderType is limit or stop_limit |
stopPx | orderType is stop_limit |
expireTime | timeInForce is gtd |
Retry safely with Idempotency-Key
Send an Idempotency-Key header on every order, with a new unique value (such as a UUID) for each order. A retry that repeats the key returns the order that key already placed instead of placing a second one. Keys are scoped to you, the authenticated user.
- Reusing a key with different order terms returns
400INVALID_ORDER. - Sending the header more than once returns
400INVALID_IDEMPOTENCY_KEY. - Without the header, every request places a new order, and you cannot safely retry after a
504.
clientOrderRef is your own reference for the order, unique per account. It is not a retry key: reusing one returns 409 CLIENT_ORDER_REF_IN_USE.
Handling 504 ORDER_OUTCOME_UNKNOWN
A 504 means the call was cut short and the order may have been placed. Do not treat it as a failure. Either:
- look for the order in List Prediction Orders, or
- retry with the same
Idempotency-Key.
504 without an Idempotency-Key. Doing so can place the order twice.
Example
curl -X POST "https://api.tradearies.dev/v1/predictions/orders" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 3f2b9c4e-8a1d-4c6f-b7e2-5d0a9e8c1f34" \
-d '{"accountId":"ACCOUNT-0001","clientOrderRef":"7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11","symbol":"HORC_1126_Republican","outcome":"YES","side":"buy","orderType":"limit","timeInForce":"day","quantity":"10","price":"0.54"}'
Errors
| Status | code | Meaning |
|---|---|---|
400 | INVALID_ORDER | The order was refused. message carries the reason, including refusals from order entry or the venue such as price, tick size, or account setup. |
400 | EMPTY_BODY, INVALID_JSON, UNKNOWN_FIELD | Missing body, malformed JSON, or a field the endpoint does not accept. |
400 | INVALID_IDEMPOTENCY_KEY | The Idempotency-Key header was sent more than once. |
401 | — | Missing or invalid credentials. |
409 | CLIENT_ORDER_REF_IN_USE | clientOrderRef is already used on this account. To retry an order, repeat its Idempotency-Key instead. |
429 | ORDER_ENTRY_AT_CAPACITY | Order entry is at capacity. Nothing was placed; retry shortly. |
503 | ORDER_ENTRY_UNAVAILABLE | Order entry is not accepting orders. Nothing was placed. |
504 | ORDER_OUTCOME_UNKNOWN | The order may have been placed. See above. |
Authorizations
Headers
Body
application/json
Unknown fields are rejected with 400. The user is always the authenticated caller and cannot be named in the body.
Response
Order accepted for sending. state is normally pending_new.
Standard success envelope used by all success responses. data is endpoint-specific.
Was this page helpful?