# POST Cancel All Orders

## Cancel all open orders across all accounts

<mark style="color:orange;">`POST`</mark> `/v1/api/orders/cancelall`

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Code Examples**

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

```python
import requests

token = 'my-secret-token'

url = "https://app.crosstrade.io/v1/api/orders/cancelall"
headers = {
    "Authorization": f"Bearer {token}",
    "Content-Type": "application/json"
}
data = {}

try:
    response = requests.post(url, headers=headers, json=data)
    print(f"Response Code: {response.status_code}, Response Text: {response.text}")
except Exception as e:
    print(f"An error occurred: {e}")
```

{% endtab %}
{% endtabs %}

***

**Response**

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

```json
{
    "orderIds": [
        "ddc3f4c244b047fda3f4d9f8f44bc8f3",
        "b415488f31ff454682a947684e871a90",
        "179b24c22fbd47e98b95b63c8ebd6aa4",
        "68d01307c4bf4a6382bb863b42748a28",
        "148230092d2144f4b0efa686bf6cb515",
        "37101553a8ab466eb2f4f3b138954317",
        "2ff65c7460b042da98d5e2936d5a3314",
        "46feaed8d96e4261bb0b65fb3f04e417",
        "78a571a7ebd9470e8b36af4cbf49809f",
        "cfb62ddf171f4e6c9f7ac65939845ea1"
    ],
    "success": true
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Invalid request"
}
```

{% endtab %}
{% endtabs %}

#### WebSocket API

This request can also be made over the WebSocket API.

```json
{
  "action": "rpc",
  "id": "my-request-id",
  "api": "CancelAllOrders",
  "args": {}
}
```
