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.cancel(request={
"orig_cl_ord_id": "ORDER-123456",
"security_type": models.SecurityTypeEnum.CS,
"side": models.OrderSideEnum.BUY,
"symbol": "AAPL",
"trading_account_id": "TEST-ACCOUNT-001",
})
assert res.cancel_ord_response is not None
# Handle response
print(res.cancel_ord_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.cancel({
origClOrdId: "ORDER-123456",
securityType: "CS",
side: "BUY",
symbol: "AAPL",
tradingAccountId: "TEST-ACCOUNT-001",
});
console.log(result);
}
run();curl --request POST \
--url https://api.aries.com/v1/orders/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"origClOrdId": "ORDER-123456",
"securityType": "CS",
"side": "BUY",
"symbol": "AAPL",
"tradingAccountId": "TEST-ACCOUNT-001"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
origClOrdId: 'ORDER-123456',
securityType: 'CS',
side: 'BUY',
symbol: 'AAPL',
tradingAccountId: 'TEST-ACCOUNT-001'
})
};
fetch('https://api.aries.com/v1/orders/cancel', 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/cancel",
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([
'origClOrdId' => 'ORDER-123456',
'securityType' => 'CS',
'side' => 'BUY',
'symbol' => 'AAPL',
'tradingAccountId' => 'TEST-ACCOUNT-001'
]),
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/cancel"
payload := strings.NewReader("{\n \"origClOrdId\": \"ORDER-123456\",\n \"securityType\": \"CS\",\n \"side\": \"BUY\",\n \"symbol\": \"AAPL\",\n \"tradingAccountId\": \"TEST-ACCOUNT-001\"\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/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"origClOrdId\": \"ORDER-123456\",\n \"securityType\": \"CS\",\n \"side\": \"BUY\",\n \"symbol\": \"AAPL\",\n \"tradingAccountId\": \"TEST-ACCOUNT-001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aries.com/v1/orders/cancel")
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 \"origClOrdId\": \"ORDER-123456\",\n \"securityType\": \"CS\",\n \"side\": \"BUY\",\n \"symbol\": \"AAPL\",\n \"tradingAccountId\": \"TEST-ACCOUNT-001\"\n}"
response = http.request(request)
puts response.read_body{
"clOrdId": "ORDER-20260115-002",
"origClOrdId": "ORDER-20260115-001",
"status": "CANCELED",
"success": true,
"text": "Cancel request processed"
}Cancel Order
Cancels an existing open or partially filled order identified by order ID. This action immediately requests order cancellation from the exchange, preventing further execution while preserving any partial fills already completed.
Use Case: Stop unfilled orders when market conditions change or trading strategies need adjustment before complete execution.
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.cancel(request={
"orig_cl_ord_id": "ORDER-123456",
"security_type": models.SecurityTypeEnum.CS,
"side": models.OrderSideEnum.BUY,
"symbol": "AAPL",
"trading_account_id": "TEST-ACCOUNT-001",
})
assert res.cancel_ord_response is not None
# Handle response
print(res.cancel_ord_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.cancel({
origClOrdId: "ORDER-123456",
securityType: "CS",
side: "BUY",
symbol: "AAPL",
tradingAccountId: "TEST-ACCOUNT-001",
});
console.log(result);
}
run();curl --request POST \
--url https://api.aries.com/v1/orders/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"origClOrdId": "ORDER-123456",
"securityType": "CS",
"side": "BUY",
"symbol": "AAPL",
"tradingAccountId": "TEST-ACCOUNT-001"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
origClOrdId: 'ORDER-123456',
securityType: 'CS',
side: 'BUY',
symbol: 'AAPL',
tradingAccountId: 'TEST-ACCOUNT-001'
})
};
fetch('https://api.aries.com/v1/orders/cancel', 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/cancel",
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([
'origClOrdId' => 'ORDER-123456',
'securityType' => 'CS',
'side' => 'BUY',
'symbol' => 'AAPL',
'tradingAccountId' => 'TEST-ACCOUNT-001'
]),
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/cancel"
payload := strings.NewReader("{\n \"origClOrdId\": \"ORDER-123456\",\n \"securityType\": \"CS\",\n \"side\": \"BUY\",\n \"symbol\": \"AAPL\",\n \"tradingAccountId\": \"TEST-ACCOUNT-001\"\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/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"origClOrdId\": \"ORDER-123456\",\n \"securityType\": \"CS\",\n \"side\": \"BUY\",\n \"symbol\": \"AAPL\",\n \"tradingAccountId\": \"TEST-ACCOUNT-001\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aries.com/v1/orders/cancel")
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 \"origClOrdId\": \"ORDER-123456\",\n \"securityType\": \"CS\",\n \"side\": \"BUY\",\n \"symbol\": \"AAPL\",\n \"tradingAccountId\": \"TEST-ACCOUNT-001\"\n}"
response = http.request(request)
puts response.read_body{
"clOrdId": "ORDER-20260115-002",
"origClOrdId": "ORDER-20260115-001",
"status": "CANCELED",
"success": true,
"text": "Cancel request processed"
}Authorizations
Body
Which order to cancel. Required: origClOrdId (the ID returned when the order was placed), tradingAccountId, symbol. side is required; add securityType to disambiguate; for option cancels also include putCall, strikePrice, and maturity, or send an OSI option symbol in symbol and let the backend derive them.
- Option 1
- Option 2
Request body for canceling an open order through the core trading API. Use this when the user wants to stop an order that has not fully filled.
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"
Response
Cancel request submitted successfully
Response returned after requesting an order cancel. Treat it as the cancel result and continue monitoring if the status is pending.
Order status after the cancel request. Typical values after a successful cancel:
PENDING_CANCEL— cancel request accepted by the broker but not yet final. Keep monitoring; will move toCANCELEDonce confirmed.CANCELED— order is fully cancelled; no further fills will occur.REJECTED— the cancel was refused (e.g. the order had already fully filled). The original order is unchanged.
The full FIX OrdStatus enum is supported — see the Place Order response for the complete list of possible values.
NEW, PARTIALLY_FILLED, FILLED, DONE_FOR_DAY, CANCELED, REPLACED, PENDING_CANCEL, STOPPED, REJECTED, SUSPENDED, PENDING_NEW, CALCULATED, EXPIRED, ACCEPTED_FOR_BID, PENDING_REPLACE, SUPERSEDED "CANCELED"
Was this page helpful?