Skip to main content

Withdraw Order

This API is used to withdraw an open order.

SDK Links

Python
longport.openapi.TradeContext.cancel_order
Rust
longport::trade::TradeContext#cancel_order
Go
TradeContext.CancelOrder
Node.js
TradeContext#cancelOrder

Request

HTTP MethodDELETE
HTTP URL/v1/trade/order

Parameters

Content-Type: application/json; charset=utf-8

NameTypeRequiredDescription
order_idstringYESOrder ID

Request Example

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

{
"code": 0,
"message": "success",
"data": {}
}

Response Status

StatusDescriptionSchema
200The submission was successful and the order was commissioned.None
400The withdrawal was rejected with an incorrect request parameter.None