跳到主要内容

机器人下单

机器人专用下单接口,不冻结资产、不落库,只发送到撮合引擎。

🔒 需要 IP 白名单授权。

接口信息

  • 方法: POST
  • 路径: /api/v1/bot/orders

请求参数(Body)

参数类型必填说明
symbolstring交易对
sidestring方向:buy / sell
typestring类型:limit / market_buy / market_sell
pricestring条件价格(限价单必填)
qtystring条件数量
quote_qtystring条件金额(市价买必填)
client_order_idstring客户端订单 ID
resp_typestring响应类型:ACK(默认)/ RESULT / FULL
need_cacheboolean机器人订单是否缓存(默认 false)

请求示例

{
"symbol": "BTC_USDT",
"side": "buy",
"type": "limit",
"price": "30000",
"qty": "0.1",
"client_order_id": "bot-order-001",
"need_cache": true
}

响应字段

响应字段同"下单"接口。

字段类型说明
codeinteger状态码
messagestring返回消息
data.order_idstring订单 ID
data.client_order_idstring客户端订单 ID
data.statusinteger状态
data.filled_qtystring已成交数量
data.filled_quotestring已成交金额
data.tradesarray成交明细

响应示例

{
"code": 0,
"message": "success",
"data": {
"order_id": "1234567890123456789",
"client_order_id": "bot-order-001",
"status": 1,
"filled_qty": "0.05",
"filled_quote": "1500",
"trades": [
{
"maker_order_id": "1234567890123",
"match_id": "9876543210",
"price": "30000",
"qty": "0.05",
"quote_qty": "1500",
"trade_index": 0
}
]
}
}