Lever Order - Place Bulk Orders And Simultaneously Cancel Specified Orders
Description
Lever order - place bulk orders and simultaneously cancel specified orders
HTTP Request
- POST /open/api/margin/mass_replace
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| api_key | String | Yes | the key is in the user api management |
| time | Long | Yes | it is the current timestamp |
| sign | String | Yes | the string is generated according to signature rule |
| symbol | String | Yes | coin pair, example: btcusdt |
| mass_place | List<Object> | No | order list, which length must be less than 100 |
| >mass_place.volume | String | Yes | order volume |
| >mass_place.price | String | No | order price, when the type is 2, it isn't required |
| >mass_place.side | String | Yes | order side: BUY, SELL |
| >mass_place.type | Integer | Yes | order type: 1 limit,2 market |
| >mass_place.volumeType | Integer | No | order 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 volumeType 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.clientOrderId | String | No | client order ID |
| mass_cancel | List | No | order id list, which length must be less then 1000 |
Request Example
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]'Response Parameters
| Parameter | Type | Description |
|---|---|---|
| mass_cancel | List | order id list |
| mass_place | List | order list, classify based on the status code of the order creation results |
| >mass_place.order_id | List | order id |
| >mass_place.idPrices | String | successful 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\":\"newclient00001\",\"id\":\"443433890506342400\"},{\"side\":\"BUY\",\"price\":\"80100\",\"clientOrderId\":\"newclient00002\",\"id\":\"443433890506342401\"}]",
"order_id": [
443433890506342400,
443433890506342401
]
}
]
},
"message": null,
"traceId": null
}Status Code
| Code | Description |
|---|---|
| 0 | success |
| 1 | system error |
| 2 | parameters error |
| 3 | user's trading has been frozen |
| 5 | fail to place order |
| 31 | the price or amount is less than the minimum value |
| 100004 | illegal parameter |
| 100005 | illegal sign |
| 100007 | illegal ip address |
| 100008 | the request time is expired |
| 10062 | price or volume precision exceeds the maximum limit. |
| 10063 | the volume is less than the minimum value |
| 101151 | there are open liquidation orders for the coin pair |
