# Cancel All Orders

<mark style="color:red;">**`DELETE`**</mark> `https://api.sfox.com/v1/orders/open`

Cancel all open orders.

### Responses

<details>

<summary><mark style="color:green;">200</mark></summary>

Responds with an array of all of the orders listed in the request that were able to begin cancelation (`Cancel Pending`) or were successfully canceled (`Canceled`)

```json
{ 
  "orders": [
    {"id": 2, "status": "Cancel pending"},
    {"id": 3, "status": "Canceled"}
  ]
}
```

</details>

### Example Requests

{% tabs %}
{% tab title="Shell" %}

```bash
curl -X DELETE \
  -H 'Authorization: Bearer <API_TOKEN>' \
  'https://api.sfox.com/v1/orders/open'
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const axios = require('axios');

axios({
  method: 'delete',
  url: 'https://api.sfox.com/v1/orders/open',
  headers: {
    'Authorization': 'Bearer <API_KEY>'
  }
}).then(response => {
  console.log(response)
}).catch(err => {
  console.error(err)
});
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

data = requests.delete(
  "https://api.sfox.com/v1/orders/open",
  headers={
    "Authorization": "Bearer <API_KEY>",
  }
)
print(data)
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://docs.sfox.com/rest-api/orders/cancel-all-orders.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
