撤銷訂單
該接口用於訂單撤銷。
SDK Links
Python  | longport.openapi.TradeContext.cancel_order | 
Rust  | longport::trade::TradeContext#cancel_order | 
Go  | TradeContext.CancelOrder | 
Node.js  | TradeContext#cancelOrder | 
Request 
| HTTP Method | DELETE | 
| HTTP URL | /v1/trade/order | 
Parameters 
Content-Type: application/json; charset=utf-8
| Name | Type | Required | Description | 
|---|---|---|---|
| order_id | string | YES | 訂單 ID | 
Request Example 
python
from longport.openapi import TradeContext, Config
config = Config.from_env()
ctx = TradeContext(config)
ctx.cancel_order("709043056541253632")Response 
Response Headers 
- Content-Type: application/json
 
Response Example 
json
{
  "code": 0,
  "message": "success",
  "data": {}
}Response Status 
| Status | Description | Schema | 
|---|---|---|
| 200 | 提交成功,訂單已委托。 | None | 
| 400 | 撤單被拒絕,請求參數錯誤。 | None |