跳至主要内容

撤銷活動委托單

HTTP 請求

POST /spot/v3/private/cancel-order

請求參數

參數是否必須類型說明
orderIdfalsestring訂單ID. 當orderLinkId為空時, 則必傳
orderLinkIdfalsestring用戶自定義ID. 當orderId為空時, 則必傳
orderCategoryfalseinteger訂單類型. 默認為0:普通訂單; 1止盈止損訂單,若是止盈止損則必傳

返回參數

參數類型說明
orderIdstring訂單ID
orderLinkIdstring自定義訂單ID,用戶自己生成
symbolstring幣對名稱
statusstring訂單狀態
accountIdstring賬戶ID
orderPricestring訂單價格
createTimestring訂單創建時間
orderQtystring訂單數量
execQtystring成交數量
timeInForcestring執行策略
orderTypestring訂單類型, LIMIT/MARKET/LIMIT_MAKER
sidestring買賣方向. BUY:買入, SELL:賣出.

請求示例

curl --location --request POST 'https://api-testnet.bybit.com/spot/v3/private/cancel-order' \
--header 'X-BAPI-SIGN: XXXXX' \
--header 'X-BAPI-API-KEY: {api key}' \
--header 'X-BAPI-TIMESTAMP: 1659078017415' \
--header 'X-BAPI-RECV-WINDOW: 5000' \
--header 'Content-Type: application/json' \
--data-raw '{
"orderId": "1210810256551063296",
"orderLinkId": null
}'

響應示例

{
"retCode": 0,
"retMsg": "OK",
"result": {
"orderId": "1210810256551063296",
"orderLinkId": "spotA0010",
"symbol": "BTCUSDT",
"status": "NEW",
"accountId": "533287",
"createTime": "1659075830464",
"orderPrice": "23500",
"orderQty": "0.01",
"execQty": "0",
"timeInForce": "GTC",
"orderType": "LIMIT",
"side": "SELL"
},
"retExtMap": {},
"retExtInfo": {},
"time": 1659078151226
}