Place 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 POST 'http://127.0.0.1:48180/v1/orders' \
-H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN" \
-H 'Content-Type: application/json' \
-d '{
"connection_id": 12,
"instrument": "binance:futures:BTCUSDT",
"side": "buy",
"type": "limit",
"price": "67000.1",
"size": "0.012",
"reduce_only": false,
"post_only": false,
"time_in_force": "gtc",
"client_key": "bot-42"
}'Places a limit or a market order. A repeat with the same client_key returns the previous answer and places no second order. The terminal remembers the last 1000 keys.
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
application/json- body
connection_id*integerint64instrument*stringInstrument address, exchange:market:symbol.
side*string"buy""sell"type*stringA limit order needs price. A market order takes none.
"limit""market"price?stringDecimal string.
size?stringSize in the base coin. Exactly one of size and notional.
notional?stringAmount in the quote currency. Exactly one of size and notional.
reduce_only?booleanfalsepost_only?booleanfalsetime_in_force?stringWithout it the default of the exchange applies.
"gtc""ioc""fok""post_only"client_key?stringIdempotency key of the client.
The terminal accepted the command. The order appears in account.orders under key.
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 POST 'http://127.0.0.1:48180/v1/orders' \ -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN" \ -H 'Content-Type: application/json' \ -d '{ "connection_id": 12, "instrument": "binance:futures:BTCUSDT", "side": "buy", "type": "limit", "price": "67000.1", "size": "0.012", "reduce_only": false, "post_only": false, "time_in_force": "gtc", "client_key": "bot-42"}'{ "accepted": true, "operation_id": "173029440000000001", "key": "t-173029440000000001", "connection_id": 12, "instrument": "binance:futures:BTCUSDT"}