Skip to content

杠杆订单 - 一次性批量发单,同时撤回指定订单

描述

一次性批量发单,同时撤回指定订单

HTTP请求

  • POST /open/api/margin/mass_replace

请求参数

参数名参数类型是否必须描述
api_keyStringapi管理的key
timeLong当下时间戳
signString经过签名规则产生的字串
symbolString币对,如"BTCUSDT"
mass_placeList<Object>订单阵列,长度需要<=100
>mass_place.volumeInteger订单数量
>mass_place.priceDecimal订单价格(市价单不需要填)
>mass_place.sideString买卖方向: BUY, SELL
>mass_place.typeInteger订单类型: 1限价委托, 2市价委托
>mass_place.volumeTypeInteger订单数量类型: 1金额价值, 2基准货币。若side=sell || type=1,则volumeType=2。default=1
>mass_place.clientOrderIdString自定义订单ID
mass_cancelList订单id阵列,长度需要<=1000

请求示例

http
curl -X POST 'https://openapi.100ex.com/open/api/margin/mass_replace' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'api_key=*********&time=1736303665297&sign=*********&symbol=BTCUSDT&symbol=BTCUSDT&mass_place=[{"price":"80000","side":"BUY","type":1,"volume":0.01,"volumeType":2,"clientOrderId": "newclient00001"},{"price":"80100","side":"BUY","type":1,"volume":0.01,"volumeType":2,"clientOrderId": "newclient00002"}]&mass_cancel=[409005316844290048,409005316844290049]'

返回参数

返回字段字段类型字段说明
mass_cancelList订单id阵列
mass_placeList订单阵列。依照订单建立结果的状态码分类
>mass_place.order_idList订单id
>mass_place.idPricesString成功订单数组信息

返回示例

json
{
    "code": "0",
    "msg": "suc",
    "data": {
        "mass_cancel": [
            {}
        ],
        "mass_place": [
            {
                "msg": "suc",
                "code": "0",
                "idPrices": "[{\"side\":\"BUY\",\"price\":\"80000\",\"clientOrderId\":\"newclient00001\",\"id\":\"443433890506342400\"},{\"side\":\"BUY\",\"price\":\"80100\",\"clientOrderId\":\"newclient00002\",\"id\":\"443433890506342401\"}]",
                "order_id": [
                    443433890506342400,
                    443433890506342401
                ]
            }
        ]
    },
    "message": null,
    "traceId": null
}

状态码

状态码说明
0成功
1系统错误
2参数错误
3用户交易被冻结
5下单失败
31价格或者金额小于最小值
100004请求参数不合法
100005参数签名错误
100007非法IP
100008请求时间过期
10062价格或数量精度超过最大限制
10063数量小于最小值
101151当前币对有未完结爆仓单!