Cancel an async order
curl --request POST \
--url https://api.anchorage-staging.com/v2/trading/async-order/cancel \
--header 'Api-Access-Key: <api-key>'import requests
url = "https://api.anchorage-staging.com/v2/trading/async-order/cancel"
headers = {"Api-Access-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'Api-Access-Key': '<api-key>'}};
fetch('https://api.anchorage-staging.com/v2/trading/async-order/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"orderId": "c6d8c4a8-e883-4ae3-9f35-4a35d06c383d",
"clOrderId": "40d846b7-6efb-48fa-acc9-dcace827c927",
"subaccountId": "a05a846f-4ef0-11ed-a291-dafe71b41c83",
"symbol": "BTC-USD",
"side": "BUY",
"orderQty": "1.0",
"currency": "BTC",
"counterCurrency": "USD",
"orderType": "STOP_LIMIT",
"limitPrice": "22840.9299",
"timeInForce": "GTC",
"orderStatus": "PENDING_CANCEL",
"avgPx": "22840.9299",
"avgPxAllIn": "22863.7708299",
"leavesQty": "0.0",
"cancelQty": "0.0",
"cumQty": "1.0",
"counterQty": "22840.9299",
"counterQtyAllIn": "22866.2799",
"totalFee": "25.35",
"feeCurrency": "USD",
"submitTime": "2023-03-07T19:49:06.286737Z",
"transactTime": "2023-03-07T19:49:06.314322Z"
}
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}Permissions required: Execute trades
Cancels an async order.
POST
/
trading
/
async-order
/
cancel
Cancel an async order
curl --request POST \
--url https://api.anchorage-staging.com/v2/trading/async-order/cancel \
--header 'Api-Access-Key: <api-key>'import requests
url = "https://api.anchorage-staging.com/v2/trading/async-order/cancel"
headers = {"Api-Access-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'Api-Access-Key': '<api-key>'}};
fetch('https://api.anchorage-staging.com/v2/trading/async-order/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"orderId": "c6d8c4a8-e883-4ae3-9f35-4a35d06c383d",
"clOrderId": "40d846b7-6efb-48fa-acc9-dcace827c927",
"subaccountId": "a05a846f-4ef0-11ed-a291-dafe71b41c83",
"symbol": "BTC-USD",
"side": "BUY",
"orderQty": "1.0",
"currency": "BTC",
"counterCurrency": "USD",
"orderType": "STOP_LIMIT",
"limitPrice": "22840.9299",
"timeInForce": "GTC",
"orderStatus": "PENDING_CANCEL",
"avgPx": "22840.9299",
"avgPxAllIn": "22863.7708299",
"leavesQty": "0.0",
"cancelQty": "0.0",
"cumQty": "1.0",
"counterQty": "22840.9299",
"counterQtyAllIn": "22866.2799",
"totalFee": "25.35",
"feeCurrency": "USD",
"submitTime": "2023-03-07T19:49:06.286737Z",
"transactTime": "2023-03-07T19:49:06.314322Z"
}
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}{
"message": "Missing required field 'amount'."
}Authorizations
An API key associated with a security role
Query Parameters
The orderId for the async order to cancel
The clOrderId for the async order to cancel
Response
Successfully cancel an ansyc order
Show child attributes
Show child attributes
Was this page helpful?
⌘I