Broker API HubMenu

Cancel an order: broker API endpoints compared

14 documented calls from 10 of the 12 APIs with endpoint records here, and 4 functions and messages from 3 APIs whose interfaces are not HTTP, each with the page it was read on.

Independent and unofficialNewest check

Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.

What this task is

Cancelling withdraws an order that has not filled. It does nothing to a position that is already open: that needs a closing call instead.

A cancel can lose a race with a fill. Treat the reply as a request that was received, then confirm the state of the order before you assume it has gone.

The documented endpoint, API by API

Ordered by the name of the broker or platform API, then by path. The order is not a ranking. Open a row for the parameters, the response and a sample request.

Broker or platformEndpointWhat the record says it doesSource
Capital.comDELETE/api/v1/workingorders/{dealId}Cancel an open limit or stop order by its dealId.open-api.capital.comchecked
DXtrade APIsDELETE/accounts/{accountCode}/orders/{orderCode}Cancel one order on an account, named by the client's order code or by the platform's own code.demo.dx.tradechecked
eToroDELETE/api/v2/trading/execution/demo/orders/{orderId}Asks eToro to cancel a demo order that is waiting for the market to open or for its trigger rate. A 200 means the request was accepted; the order may already have executed.api-portal.etoro.comchecked
eToroDELETE/api/v2/trading/execution/orders/{orderId}Asks for an order on the real account to be cancelled before it executes. A 200 reply means the request was accepted, not that the order was cancelled.api-portal.etoro.comchecked
eToroDELETE/api/v3/trading/execution/demo/orders/{orderId}Asks for a pending order on the demo account to be cancelled. The version 3 form: a 202 reply means the request was queued, not that the order was cancelled.api-portal.etoro.comchecked
eToroDELETE/api/v3/trading/execution/orders/{orderId}Asks for a pending order on the real account to be cancelled. The version 3 form: a 202 reply means the request was queued, not that the order was cancelled.api-portal.etoro.comchecked
IGDELETE/working-orders/otc/{dealId}Delete an OTC working order by its deal identifier. Returns a dealReference.labs.ig.comchecked
Interactive BrokersDELETE/iserver/account/{accountId}/order/{orderId}Cancels an existing order that has not filled.interactivebrokers.comchecked
Match-Trader Platform APIPOST/mtr-api/{SYSTEM_UUID}/pending-order/cancelCancel a pending order before it is executed, named by its id with its instrument, side and type.app.theneo.iochecked
OANDAPUT/v3/accounts/{accountID}/orders/{orderSpecifier}/cancelCancel a pending order by ID or by your client ID prefixed with @.developer.oanda.comchecked
Saxo OpenAPIDELETE/trade/v2/orders/{OrderIds}Cancels one or more open orders. Pass a comma separated list of order ids in the path and the AccountKey as a query parameter.developer.saxochecked
TradeLocker APIDELETE/trade/accounts/{accountId}/ordersCancel every pending order on the account, or only those in one instrument.public-api.tradelocker.comchecked
TradeLocker APIDELETE/trade/orders/{orderId}Cancel one pending order. It works only before the order has been executed.public-api.tradelocker.comchecked
Trading 212DELETE/api/v0/equity/orders/{id}Ask for a pending order to be cancelled. A success reply means the request was accepted, not that the order has gone: it may already be filling.docs.trading212.comchecked

The same task where the interface is not HTTP

Some platform APIs, and the streaming interfaces of some broker APIs, are not sent as HTTP requests. A function is called from a program in its language, and a message is sent over an open connection. None has a method or a path, so each row is labelled with its kind and its interface. A record is put on this page by hand, from what the vendor's page says the call does, and one call can do several jobs, so the same function can be on more than one task page. Ordered by the name of the broker or platform API, then interface, then name.

APICallWhat the record says it doesSource
cTrader Open APImessageProtoOACancelOrderReq cTrader Open APICancels a pending order. The definition allows it only where the access token has trade permission for the account.help.ctrader.comchecked
MetaTrader 4 (MQL4)functionOrderDelete() MQL4Deletes a pending order that was placed earlier.docs.mql4.comchecked
MetaTrader 5 (Python package and MQL5)functionorder_send() MetaTrader5 Python packageSends a trade request from the terminal to the trade server. One call covers a market order, a pending order, a change to an order or position, a cancellation and a close: the request's action field says which.mql5.comchecked
MetaTrader 5 (Python package and MQL5)functionOrderSend() MQL5Sends a trade request to the trade server and waits for its answer. One function covers a market order, a pending order, a change, a cancellation and a close: the action field of the request says which.mql5.comchecked

None documented here yet

These APIs have endpoint records on this site, but none is assigned to this task. That describes this dataset. It is not a statement that the API lacks such a call.

Brokers and platforms with no endpoint records at all are not listed above. The broker directory shows what is recorded for each.

Sections