Skip to content

Order - Place Bulk Orders And Simultaneously Cancel Specified Orders V2

Description

Place bulk orders and simultaneously cancel specified orders

HTTP Request

  • POST /open/api/mass_replaceV2

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYesthe key is in the user api management
timeLongYesit is the current timestamp
signStringYesthe string is generated according to signature rule
symbolStringYescoin pair, example: btcusdt
mass_placeList<Object>Noorder list, which length must be less than 100
>mass_place.volumeStringYesorder volume
>mass_place.priceStringNoorder price, when the type is 2, it isn't required
>mass_place.sideStringYesorder side: BUY, SELL
>mass_place.typeIntegerYesorder type: 1 limit,2 market
>mass_place.volumeTypeIntegerNoorder volume type
1 amount value volume, e.g. buy or sell with a total value of 1000 USDT.
2 base coin amount volume, e.g. buy or sell 1 BTC.
If the order is limit order (type = 1), then vlumeType must be 2. If it is market order (type = 2), whether it's a buy or sell order, volumeType can be either 1 or 2
>mass_place.clientOrderIdStringNoclient order ID
mass_cancelListNoorder id list, which length must be less then 1000

Request Example

http
curl -X POST 'https://openapi.100ex.com/open/api/mass_replaceV2' \
-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.00003,"volumeType":1},{"price":"80100","side":"BUY","type":1,"volume":0.00004,"volumeType":1,"clientOrderId":"newclient00001"},{"price":"80200","side":"BUY","type":1,"volume":0.00005,"volumeType":1,"clientOrderId":"newclient00002"}]&mass_cancel=[410821764591910912,410811372104843264]'

Response Parameters

ParameterTypeDescription
mass_cancelListorder id list
mass_placeListorder list, classify based on the status code of the order creation results
>mass_place.order_idListorder id
>mass_place.idPricesStringsuccessful order list information

Response Example

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

Status Code

CodeDescription
0success
1system error
2parameters error
3user's trading has been frozen
5fail to place order
9the trading was froze
31the price or amount is less than the minimum value
35placing orders is not allowed
100004illegal parameter
100005illegal sign
100007illegal ip address
100008the request time is expired
10062price or volume precision exceeds the maximum limit.
10063the volume is less than the minimum value
101151there are open liquidation orders for the coin pair
210006this user isn't in the whitelist of open-api
210014Spot bulk order exceeds the maximum limit
210015Spot bulk cancellation exceeds the maximum limit