Cancel an order
Build your request
Change the values and the command follows. The token is never typed here: the command reads it from the SPECTRE_LOCAL_API_TOKEN environment variable. Run it in your own terminal.
curl -X DELETE 'http://127.0.0.1:48180/v1/orders/t-173029440000000001?connection_id=12&instrument=binance:futures:BTCUSDT' \ -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"
Sends the cancel to the exchange. The confirmation arrives in the stream.
bearerToken trading:writeAuthorizationBearer <token>The Local API token: spt_ and 64 hex characters. Copy it from Settings App → General → Local API. It is accepted only in the Authorization header. The names listed with an operation are the scopes it requires. The token of the terminal carries all of them.
Scope: trading:write
id*stringThe order key of the terminal, t-…, or the order id of the exchange.
connection_id*integerThe connection of the instrument.
int64instrument*stringInstrument address, exchange:market:symbol.
The terminal accepted the command. key is null.
application/json- response
The answer of every trading, trigger and leverage command.
accepted*booleanAccepted by the terminal, not by the exchange.
operation_id*stringThe id of the operation in the trading operations log of the terminal. The key of a placed order is t- and this id.
key*|The key of the placed order, t-…, or of the placed trigger: sl_…, tp_… or stop_…. null for cancels, amendments and leverage.
connection_id*integerint64instrument*stringcurl -X DELETE 'http://127.0.0.1:48180/v1/orders/t-173029440000000001?connection_id=12&instrument=binance:futures:BTCUSDT' \ -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"{ "accepted": true, "operation_id": "173029440000000003", "key": null, "connection_id": 12, "instrument": "binance:futures:BTCUSDT"}Cancel all orders of an instrument POST
Works like the space bar in the order book. Trigger orders are not touched.
Close a position POST
Closes the position of the instrument the way the window does. On futures it sends a market order for the size of the position. On spot it cancels all orders and closes the position in one command.