# Ws Cancel batch Orders

#### cancel\_batch\_orders

Signature verification: Yes

Interface permission: Trade

Rate Limit: Shared REST frequency limit

Interface description: This interface supports websocket contract batch order cancellation.

### Subscription Address

| Environment                         | Address                        |
| ----------------------------------- | ------------------------------ |
| Online                              | wss\://api.sunx.io/ws/v1/trade |
| Online (preferred by aws customers) | wss\://api.sunx.io/ws/v1/trade |

### Subscription Parameter

| Field Name | Type   | Description                                   |
| ---------- | ------ | --------------------------------------------- |
| op         | string | Required； Operator Name，cancel\_batch\_orders |
| cid        | string | Optional; Requests unique ID                  |
| data       | string | cancellation parameters                       |

### Request Parameter

| Parameter         | Data Type | Required | Description   | Value Range                                                                          | Default Value |
| ----------------- | --------- | -------- | ------------- | ------------------------------------------------------------------------------------ | ------------- |
| contract\_code    | String    | true     | Symbol        |                                                                                      |               |
| order\_id         | String    | false    | Order ID      |                                                                                      |               |
| client\_order\_id | String    | false    | Your order ID | Clients fill and maintain themselves. the value must be in \[1, 9223372036854775807] |               |

### Response Parameter

| Parameter         | Data Type | Required | Description                                   | Value Range                  |
| ----------------- | --------- | -------- | --------------------------------------------- | ---------------------------- |
| code              | int       | true     | Response Code                                 | 200: Success, non 200: Error |
| message           | String    | true     | Response Description                          |                              |
| \<data>           | object    | false    |                                               |                              |
| code              | int       | true     | Order cancellation result                     | 200: Success, non 200: Error |
| message           | String    | true     | Order cancellation result description         |                              |
| order\_id         | String    | true     | Order ID                                      |                              |
| client\_order\_id | String    | true     | Your order ID                                 |                              |
| \</data>          |           | false    |                                               |                              |
| ts                | long      | true     | Time of Respond Generation, Unit: Millisecond |                              |

### Request Example

```
{
  "op": "cancel_batch_orders",
  "cid": "cancel_batch_orders_1240",
  "data": {
    "contract_code": "BTC-USDT",
    "order_id": [
      "1329854623927160832",
      "1329854624082350080"
    ],
    "client_order_id": [
      "1329854623927160832",
      "1329854624082350080"
    ]
  }
}
```

### Example of a Successful Request

```
{
  "code": 200,
  "message": "Success",
  "data": [
    {
      "orderId": "1358944125296009216",
      "clientOrderId": "1358944125296009216",
      "code": 200,
      "message": "Success"
    },
    {
      "orderId": "1358944503467040768",
      "clientOrderId": "1358944503467040768",
      "code": 200,
      "message": "Success"
    }
  ],
  "ts": 1744041034439,
  "cid": "cancel_batch_orders_1240"
}
```
