机器人下单
机器人专用下单接口,不冻结资产、不落库,只发送到撮合引擎。
🔒 需要 IP 白名单授权。
接口信息
- 方法:
POST - 路径:
/api/v1/bot/orders
请求参数(Body)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| symbol | string | 是 | 交易对 |
| side | string | 是 | 方向:buy / sell |
| type | string | 是 | 类型:limit / market_buy / market_sell |
| price | string | 条件 | 价格(限价单必填) |
| qty | string | 条件 | 数量 |
| quote_qty | string | 条件 | 金额(市价买必填) |
| client_order_id | string | 否 | 客户端订单 ID |
| resp_type | string | 否 | 响应类型:ACK(默认)/ RESULT / FULL |
| need_cache | boolean | 否 | 机器人订单是否缓存(默认 false) |
请求示例
{
"symbol": "BTC_USDT",
"side": "buy",
"type": "limit",
"price": "30000",
"qty": "0.1",
"client_order_id": "bot-order-001",
"need_cache": true
}
响应字段
响应字段同"下单"接口。
| 字段 | 类型 | 说明 |
|---|---|---|
| code | integer | 状态码 |
| message | string | 返回消息 |
| data.order_id | string | 订单 ID |
| data.client_order_id | string | 客户端订单 ID |
| data.status | integer | 状态 |
| data.filled_qty | string | 已成交数量 |
| data.filled_quote | string | 已成交金额 |
| data.trades | array | 成交明细 |
响应示例
{
"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
}
]
}
}