Python (SDK)
from finance_dev import FinanceDev, models
import os
with FinanceDev(
security=models.Security(
client_id=os.getenv("FINANCEDEV_CLIENT_ID", ""),
client_secret=os.getenv("FINANCEDEV_CLIENT_SECRET", ""),
),
) as fd_client:
res = fd_client.orders.place_order(account_id="TEST-ACCOUNT-001", symbol="AAPL", side=models.OrderSideEnum.BUY, type_=models.OrderTypeEnum.MARKET, qty="10", time_in_force=models.TimeInForceEnum.DAY, client_id="CLIENT-001", price="150.00", stop_price="145.00", currency="USD", legs=[
{
"symbol": "AAPL",
"side": models.Side.BUY,
"ratio_qty": "1",
"security_type": models.SecurityTypeEnum.CS,
"maturity": "2025-01-17",
"strike_price": "150.00",
"position_effect": models.PositionEffect.OPEN,
"put_call": models.OrdLegPutCall.CALL,
},
])
# Handle response
print(res)package hello.world;
import java.lang.Exception;
import org.openapis.openapi.AriesJava;
import org.openapis.openapi.models.components.PlaceOrderRequest;
import org.openapis.openapi.models.errors.ErrorResponse;
import org.openapis.openapi.models.operations.PlaceOrderResponse;
public class Application {
public static void main(String[] args) throws ErrorResponse, Exception {
AriesJava sdk = AriesJava.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
PlaceOrderRequest req = PlaceOrderRequest.builder()
.account("12682708")
.symbol("<value>")
.quantity(451705L)
.orderType("<value>")
.tradeAction("<value>")
.timeInForce("<value>")
.build();
PlaceOrderResponse res = sdk.orders().create()
.request(req)
.call();
if (res.placeOrderResponse().isPresent()) {
// handle response
}
}
}curl --request POST \
--url https://api.tradearies.dev/v1/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account": "<string>",
"symbol": "<string>",
"quantity": 123,
"orderType": "<string>",
"tradeAction": "<string>",
"timeInForce": "<string>",
"route": "<string>",
"limitPrice": "<string>",
"stopPrice": "<string>",
"legs": [
{
"symbol": "<string>",
"ratioQuantity": "<string>",
"tradeAction": "<string>",
"positionEffect": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
account: '<string>',
symbol: '<string>',
quantity: 123,
orderType: '<string>',
tradeAction: '<string>',
timeInForce: '<string>',
route: '<string>',
limitPrice: '<string>',
stopPrice: '<string>',
legs: [
{
symbol: '<string>',
ratioQuantity: '<string>',
tradeAction: '<string>',
positionEffect: '<string>'
}
]
})
};
fetch('https://api.tradearies.dev/v1/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/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([
'account' => '<string>',
'symbol' => '<string>',
'quantity' => 123,
'orderType' => '<string>',
'tradeAction' => '<string>',
'timeInForce' => '<string>',
'route' => '<string>',
'limitPrice' => '<string>',
'stopPrice' => '<string>',
'legs' => [
[
'symbol' => '<string>',
'ratioQuantity' => '<string>',
'tradeAction' => '<string>',
'positionEffect' => '<string>'
]
]
]),
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/orders"
payload := strings.NewReader("{\n \"account\": \"<string>\",\n \"symbol\": \"<string>\",\n \"quantity\": 123,\n \"orderType\": \"<string>\",\n \"tradeAction\": \"<string>\",\n \"timeInForce\": \"<string>\",\n \"route\": \"<string>\",\n \"limitPrice\": \"<string>\",\n \"stopPrice\": \"<string>\",\n \"legs\": [\n {\n \"symbol\": \"<string>\",\n \"ratioQuantity\": \"<string>\",\n \"tradeAction\": \"<string>\",\n \"positionEffect\": \"<string>\"\n }\n ]\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))
}require 'uri'
require 'net/http'
url = URI("https://api.tradearies.dev/v1/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 \"account\": \"<string>\",\n \"symbol\": \"<string>\",\n \"quantity\": 123,\n \"orderType\": \"<string>\",\n \"tradeAction\": \"<string>\",\n \"timeInForce\": \"<string>\",\n \"route\": \"<string>\",\n \"limitPrice\": \"<string>\",\n \"stopPrice\": \"<string>\",\n \"legs\": [\n {\n \"symbol\": \"<string>\",\n \"ratioQuantity\": \"<string>\",\n \"tradeAction\": \"<string>\",\n \"positionEffect\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"orderId": 123,
"status": "<string>"
}{
"error": "<string>",
"codes": [
{
"code": "<string>",
"description": "<string>"
}
]
}Orders
Place Order
Place a new trading order
POST
/
v1
/
orders
Python (SDK)
from finance_dev import FinanceDev, models
import os
with FinanceDev(
security=models.Security(
client_id=os.getenv("FINANCEDEV_CLIENT_ID", ""),
client_secret=os.getenv("FINANCEDEV_CLIENT_SECRET", ""),
),
) as fd_client:
res = fd_client.orders.place_order(account_id="TEST-ACCOUNT-001", symbol="AAPL", side=models.OrderSideEnum.BUY, type_=models.OrderTypeEnum.MARKET, qty="10", time_in_force=models.TimeInForceEnum.DAY, client_id="CLIENT-001", price="150.00", stop_price="145.00", currency="USD", legs=[
{
"symbol": "AAPL",
"side": models.Side.BUY,
"ratio_qty": "1",
"security_type": models.SecurityTypeEnum.CS,
"maturity": "2025-01-17",
"strike_price": "150.00",
"position_effect": models.PositionEffect.OPEN,
"put_call": models.OrdLegPutCall.CALL,
},
])
# Handle response
print(res)package hello.world;
import java.lang.Exception;
import org.openapis.openapi.AriesJava;
import org.openapis.openapi.models.components.PlaceOrderRequest;
import org.openapis.openapi.models.errors.ErrorResponse;
import org.openapis.openapi.models.operations.PlaceOrderResponse;
public class Application {
public static void main(String[] args) throws ErrorResponse, Exception {
AriesJava sdk = AriesJava.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
PlaceOrderRequest req = PlaceOrderRequest.builder()
.account("12682708")
.symbol("<value>")
.quantity(451705L)
.orderType("<value>")
.tradeAction("<value>")
.timeInForce("<value>")
.build();
PlaceOrderResponse res = sdk.orders().create()
.request(req)
.call();
if (res.placeOrderResponse().isPresent()) {
// handle response
}
}
}curl --request POST \
--url https://api.tradearies.dev/v1/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account": "<string>",
"symbol": "<string>",
"quantity": 123,
"orderType": "<string>",
"tradeAction": "<string>",
"timeInForce": "<string>",
"route": "<string>",
"limitPrice": "<string>",
"stopPrice": "<string>",
"legs": [
{
"symbol": "<string>",
"ratioQuantity": "<string>",
"tradeAction": "<string>",
"positionEffect": "<string>"
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
account: '<string>',
symbol: '<string>',
quantity: 123,
orderType: '<string>',
tradeAction: '<string>',
timeInForce: '<string>',
route: '<string>',
limitPrice: '<string>',
stopPrice: '<string>',
legs: [
{
symbol: '<string>',
ratioQuantity: '<string>',
tradeAction: '<string>',
positionEffect: '<string>'
}
]
})
};
fetch('https://api.tradearies.dev/v1/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/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([
'account' => '<string>',
'symbol' => '<string>',
'quantity' => 123,
'orderType' => '<string>',
'tradeAction' => '<string>',
'timeInForce' => '<string>',
'route' => '<string>',
'limitPrice' => '<string>',
'stopPrice' => '<string>',
'legs' => [
[
'symbol' => '<string>',
'ratioQuantity' => '<string>',
'tradeAction' => '<string>',
'positionEffect' => '<string>'
]
]
]),
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/orders"
payload := strings.NewReader("{\n \"account\": \"<string>\",\n \"symbol\": \"<string>\",\n \"quantity\": 123,\n \"orderType\": \"<string>\",\n \"tradeAction\": \"<string>\",\n \"timeInForce\": \"<string>\",\n \"route\": \"<string>\",\n \"limitPrice\": \"<string>\",\n \"stopPrice\": \"<string>\",\n \"legs\": [\n {\n \"symbol\": \"<string>\",\n \"ratioQuantity\": \"<string>\",\n \"tradeAction\": \"<string>\",\n \"positionEffect\": \"<string>\"\n }\n ]\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))
}require 'uri'
require 'net/http'
url = URI("https://api.tradearies.dev/v1/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 \"account\": \"<string>\",\n \"symbol\": \"<string>\",\n \"quantity\": 123,\n \"orderType\": \"<string>\",\n \"tradeAction\": \"<string>\",\n \"timeInForce\": \"<string>\",\n \"route\": \"<string>\",\n \"limitPrice\": \"<string>\",\n \"stopPrice\": \"<string>\",\n \"legs\": [\n {\n \"symbol\": \"<string>\",\n \"ratioQuantity\": \"<string>\",\n \"tradeAction\": \"<string>\",\n \"positionEffect\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"orderId": 123,
"status": "<string>"
}{
"error": "<string>",
"codes": [
{
"code": "<string>",
"description": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Account ID
Trading symbol
Order quantity
Order type (MARKET, LIMIT, STOP, STOP_LIMIT)
Trade action (BUY, SELL)
Time in force (DAY, GTC, IOC, FOK)
Order routing destination
Limit price for limit orders
Stop price for stop orders
Legs for multi-leg orders
Show child attributes
Show child attributes
Was this page helpful?
⌘I