> For the complete documentation index, see [llms.txt](https://docs.satori.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.satori.finance/api-docs/openapi/rest-api/order-operation-private-operation/batch-cancel-orders.md).

# Batch Cancel orders

**method url**:`/api/third/order/batchCancelEntrust`

**request type**:`POST`

**content type**：application/x-www-form-urlencoded

**need sign:**`true`

**detail**: cancel one by one till fail then break

**request param**:

| param\_name | param note | type  | required | data type | schema  |
| ----------- | ---------- | ----- | -------- | --------- | ------- |
| entrustIds  |            | query | true     | array     | integer |
| timestamp   |            | query | true     | string    |         |

**response param**:

| param\_name | param note | type    | schema |
| ----------- | ---------- | ------- | ------ |
| data        | is success | boolean |        |

**example**:

> 1 Set request parameters, query params:

```
entrustIds:180554928,180554929,180554930
timestamp:1725865024825
```

> 2 Build the Parameters

```
entrustIds=180554928,180554929,180554930&timestamp=1725865024825
```

> 3 Sign the parameter string format, result:

```
0xb431bdc9b2bdd65c37b2eb2dcb337f7f31118933e8a4bdf0dd85825163c98cb36e3eb0fb180fc671388e7225617f1f45b32a7717e12a40fa2c9f3f3893e75a351c
```

> 4 Assemble the complete request

```
curl --location --request POST 'https://zk-test.satori.finance/api/third/order/batchCancelEntrust?entrustIds=180554928,180554929,180554930&timestamp=1725865024825' \
--header 'APIKEY: st_fq6cvRF4fr5tnKiZfrIntRnLfrwxcXjcfr1y8FR7' \
--header 'X-SAPI-SIGN-TYPE: 2' \
--header 'signature: 0xb431bdc9b2bdd65c37b2eb2dcb337f7f31118933e8a4bdf0dd85825163c98cb36e3eb0fb180fc671388e7225617f1f45b32a7717e12a40fa2c9f3f3893e75a351c' \
--header 'Content-Type: text/plain' \
--data ''
```

> 5 Return results

```
{
    "error": false,
    "code": 200,
    "msg": "SUCCESS",
    "data": true,
    "sid": "1809700645462351873"
}
```

**Error Code**:

| code | msg                                             |
| ---- | ----------------------------------------------- |
| 2001 | Illegal parameter:{param0}                      |
| 2103 | Order expired                                   |
| 2125 | The order has been revoked                      |
| 2126 | The order has been completely filled            |
| 2319 | Failed to cancel order:{param0}                 |
| 2329 | The server is updating, please wait a moment... |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.satori.finance/api-docs/openapi/rest-api/order-operation-private-operation/batch-cancel-orders.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
