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.orders.preview(request={
"price": "150.00",
"qty": "10",
"side": models.OrderSideEnum.BUY,
"symbol": "AAPL",
"time_in_force": models.OrderRequestTimeInForceEnum.DAY,
"trading_account_id": "TEST-ACCOUNT-001",
"type": models.OrderTypeEnum.LIMIT,
})
assert res.preview_order_response is not None
# Handle response
print(res.preview_order_response)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.orders.preview({
price: "150.00",
qty: "10",
side: "BUY",
symbol: "AAPL",
timeInForce: "DAY",
tradingAccountId: "TEST-ACCOUNT-001",
type: "LIMIT",
});
console.log(result);
}
run();curl --request POST \
--url https://api.aries.com/v1/orders/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"price": "150.00",
"qty": "10",
"side": "BUY",
"symbol": "AAPL",
"timeInForce": "DAY",
"tradingAccountId": "TEST-ACCOUNT-001",
"type": "LIMIT"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
price: '150.00',
qty: '10',
side: 'BUY',
symbol: 'AAPL',
timeInForce: 'DAY',
tradingAccountId: 'TEST-ACCOUNT-001',
type: 'LIMIT'
})
};
fetch('https://api.aries.com/v1/orders/preview', 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/orders/preview",
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([
'price' => '150.00',
'qty' => '10',
'side' => 'BUY',
'symbol' => 'AAPL',
'timeInForce' => 'DAY',
'tradingAccountId' => 'TEST-ACCOUNT-001',
'type' => 'LIMIT'
]),
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/orders/preview"
payload := strings.NewReader("{\n \"price\": \"150.00\",\n \"qty\": \"10\",\n \"side\": \"BUY\",\n \"symbol\": \"AAPL\",\n \"timeInForce\": \"DAY\",\n \"tradingAccountId\": \"TEST-ACCOUNT-001\",\n \"type\": \"LIMIT\"\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/orders/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"price\": \"150.00\",\n \"qty\": \"10\",\n \"side\": \"BUY\",\n \"symbol\": \"AAPL\",\n \"timeInForce\": \"DAY\",\n \"tradingAccountId\": \"TEST-ACCOUNT-001\",\n \"type\": \"LIMIT\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aries.com/v1/orders/preview")
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 \"price\": \"150.00\",\n \"qty\": \"10\",\n \"side\": \"BUY\",\n \"symbol\": \"AAPL\",\n \"timeInForce\": \"DAY\",\n \"tradingAccountId\": \"TEST-ACCOUNT-001\",\n \"type\": \"LIMIT\"\n}"
response = http.request(request)
puts response.read_body{
"buyingPowerImpact": "120.0975",
"commission": "0",
"estimatedCost": "240.25",
"estimatedMargin": "60.04875",
"fees": "0",
"numDayTrades": 0,
"optionFees": "0",
"optionPremium": "0",
"optionRequirement": "0",
"warnRuleId": "0"
}Preview Order
Simulates an order submission to calculate estimated costs, fees, commissions, and buying power impact before actual execution. Returns detailed breakdown of order economics without committing to the trade.
Use Case: Review total order costs and verify buying power sufficiency before placing trades to avoid rejections and unexpected fees.
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.orders.preview(request={
"price": "150.00",
"qty": "10",
"side": models.OrderSideEnum.BUY,
"symbol": "AAPL",
"time_in_force": models.OrderRequestTimeInForceEnum.DAY,
"trading_account_id": "TEST-ACCOUNT-001",
"type": models.OrderTypeEnum.LIMIT,
})
assert res.preview_order_response is not None
# Handle response
print(res.preview_order_response)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.orders.preview({
price: "150.00",
qty: "10",
side: "BUY",
symbol: "AAPL",
timeInForce: "DAY",
tradingAccountId: "TEST-ACCOUNT-001",
type: "LIMIT",
});
console.log(result);
}
run();curl --request POST \
--url https://api.aries.com/v1/orders/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"price": "150.00",
"qty": "10",
"side": "BUY",
"symbol": "AAPL",
"timeInForce": "DAY",
"tradingAccountId": "TEST-ACCOUNT-001",
"type": "LIMIT"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
price: '150.00',
qty: '10',
side: 'BUY',
symbol: 'AAPL',
timeInForce: 'DAY',
tradingAccountId: 'TEST-ACCOUNT-001',
type: 'LIMIT'
})
};
fetch('https://api.aries.com/v1/orders/preview', 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/orders/preview",
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([
'price' => '150.00',
'qty' => '10',
'side' => 'BUY',
'symbol' => 'AAPL',
'timeInForce' => 'DAY',
'tradingAccountId' => 'TEST-ACCOUNT-001',
'type' => 'LIMIT'
]),
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/orders/preview"
payload := strings.NewReader("{\n \"price\": \"150.00\",\n \"qty\": \"10\",\n \"side\": \"BUY\",\n \"symbol\": \"AAPL\",\n \"timeInForce\": \"DAY\",\n \"tradingAccountId\": \"TEST-ACCOUNT-001\",\n \"type\": \"LIMIT\"\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/orders/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"price\": \"150.00\",\n \"qty\": \"10\",\n \"side\": \"BUY\",\n \"symbol\": \"AAPL\",\n \"timeInForce\": \"DAY\",\n \"tradingAccountId\": \"TEST-ACCOUNT-001\",\n \"type\": \"LIMIT\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aries.com/v1/orders/preview")
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 \"price\": \"150.00\",\n \"qty\": \"10\",\n \"side\": \"BUY\",\n \"symbol\": \"AAPL\",\n \"timeInForce\": \"DAY\",\n \"tradingAccountId\": \"TEST-ACCOUNT-001\",\n \"type\": \"LIMIT\"\n}"
response = http.request(request)
puts response.read_body{
"buyingPowerImpact": "120.0975",
"commission": "0",
"estimatedCost": "240.25",
"estimatedMargin": "60.04875",
"fees": "0",
"numDayTrades": 0,
"optionFees": "0",
"optionPremium": "0",
"optionRequirement": "0",
"warnRuleId": "0"
}Authorizations
Body
Same shape as Place Order — fill out exactly what you would send to actually place the order. The preview just returns cost/fees/buying-power numbers without putting the order on the market.
- Option 1
- Option 2
Request body for placing a live order through the core trading API. Use Preview Order first when available, then submit this only after the user confirms the trade.
Which direction to trade in. Pick one:
BUY— buying shares or contracts (opens a long position or closes an existing short).SELL— selling shares or contracts you already hold (closes a long position).SELL_SHORT— selling shares you do not own (opens a short position). Subject to short-sale regulations.BUY_TO_COVER— buying shares to close an open short position.
BUY, SELL, SELL_SHORT, BUY_TO_COVER "BUY"
How long the order should stay alive before automatically cancelling. Pick one:
DAY— Active until the end of today's regular trading session, then cancelled if not filled. The default choice for most orders.GTC— Good 'Til Cancelled. Stays open across multiple trading days until you cancel it (the broker may cap at 60–90 days).IOC— Immediate Or Cancel. Fill whatever you can right now; cancel the rest immediately. Useful when you want partial fills but no resting order.FOK— Fill Or Kill. Fill the entire order immediately, or cancel it entirely. No partial fills allowed.EXTENDED_HOURS— Active during pre-market and after-hours trading sessions in addition to regular hours.AT_THE_OPENING— Execute at the official market open price; if it can't fill at open, it's cancelled.AT_THE_CLOSE— Execute at the official market close price; if it can't fill at close, it's cancelled.
DAY, GTC, IOC, FOK, EXTENDED_HOURS, AT_THE_OPENING, AT_THE_CLOSE, ATO, ATC, EXT "DAY"
How the order is priced. Pick one:
MARKET— Execute immediately at the best available price. Fast and guaranteed to fill, but no price guarantee — the actual fill price can move during execution.LIMIT— Execute only at the limitpriceor better (lower for buys, higher for sells). Gives you price control, no execution guarantee. Requires thepricefield.STOP— Sits inactive until the market hitsstopPrice, then converts to a market order. Common for stop-loss exits. Requires thestopPricefield.STOP_LIMIT— Sits inactive until the market hitsstopPrice, then converts to a limit order atprice. More control thanSTOP, but the limit may not fill. Requires bothstopPriceandprice.
MARKET, LIMIT, STOP, STOP_LIMIT "LIMIT"
Response
Order preview calculated successfully
Response schema for order preview (PreviewOrdResponse)
Was this page helpful?