curl --request POST \
--url https://api.tradearies.dev/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"
}
'import requests
url = "https://api.tradearies.dev/v1/predictions/orders"
payload = {
"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"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)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.tradearies.dev/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.tradearies.dev/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.tradearies.dev/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.tradearies.dev/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.tradearies.dev/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",
"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",
"price": "0.54",
"rejectReason": "<string>",
"rejectText": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"stopPx": "0.50",
"venueOrderId": "<string>",
"workingOrderType": "<string>",
"workingPrice": "0.54"
}
}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.
curl --request POST \
--url https://api.tradearies.dev/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"
}
'import requests
url = "https://api.tradearies.dev/v1/predictions/orders"
payload = {
"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"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)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.tradearies.dev/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.tradearies.dev/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.tradearies.dev/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.tradearies.dev/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.tradearies.dev/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",
"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",
"price": "0.54",
"rejectReason": "<string>",
"rejectText": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"stopPx": "0.50",
"venueOrderId": "<string>",
"workingOrderType": "<string>",
"workingPrice": "0.54"
}
}https://api.tradearies.dev). 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.- Unknown fields are rejected with
400UNKNOWN_FIELD.
orderType and timeInForce:
| Field | Required when |
|---|---|
price | orderType is limit or stop_limit |
stopPx | orderType is stop or stop_limit |
expireTime | timeInForce is gtd |
Retry safely with clientOrderRef
clientOrderRef is an idempotency key scoped to the account. A retry with the same value returns the order already placed instead of placing a second one. Reusing a value for a different order on the same account returns 409 CLIENT_ORDER_REF_IN_USE.
Send a clientOrderRef on every order. Without one, you cannot safely retry after a 504.
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
clientOrderRef.
504 without a clientOrderRef. 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" \
-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. |
401 | — | Missing or invalid credentials. |
409 | CLIENT_ORDER_REF_IN_USE | clientOrderRef is already used on this account by another order. |
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
OAuth2 Bearer token: obtain an access token from the token endpoint and send it in the Authorization header.
- Authorization URL
- https://app.aries.com/oauth2/authorize
- Token URL
- https://api.aries.com/v1/oauth2/token
- Refresh URL
- https://api.aries.com/v1/oauth2/token
- Token URL
- https://api.aries.com/v1/oauth2/token
- Refresh URL
- https://api.aries.com/v1/oauth2/token
Body
Unknown fields are rejected with 400. The user is always the authenticated caller and cannot be named in the body.
The account to place the order on.
"ACCOUNT-0001"
limit, stop, stop_limit, market_to_limit "limit"
The binary outcome the order trades. It is never inferred from side.
YES, NO "YES"
Number of contracts as an exact decimal string. Must be greater than zero.
"10"
buy, sell "buy"
Prediction-market contract symbol, as returned by search or Get Event Contracts.
"HORC_1126_Republican"
day, gtc, ioc, fok, gtd "day"
Idempotency key. A retry with the same value on the same account returns the order already placed instead of placing a second. Send one on every order so a 504 can be retried safely.
"7d1c8e0a-4b8f-4e3a-9f43-2a6b1d0c9e11"
Required when timeInForce is gtd.
Limit price as an exact decimal string. Required for limit and stop_limit.
"0.54"
Stop price as an exact decimal string. Required for stop and stop_limit.
"0.50"
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?