> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upsidemax.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# cancelAll: Cancel All Open Orders for One Contract

> Cancel every open limit and conditional order for a specific contract in one request. The response reports how many orders of each type were removed.

The `cancelAll` action removes all open orders — both limit and conditional (take-profit / stop-loss) — for a specified contract in a single signed request. Use this when you need to flatten your order book exposure for a contract quickly without tracking individual order IDs.

## Endpoint

```
POST https://dev.upsidemax.xyz/exchange
Content-Type: application/json
```

## Request Body

```json theme={"system"}
{
  "action": {
    "type": "cancelAll",
    "a": 1
  },
  "signature": { "r": "0x...", "s": "0x...", "v": 28 },
  "nonce": 1778844423100
}
```

## Action Fields

<ParamField body="type" type="string" required>
  Fixed value: `"cancelAll"`.
</ParamField>

<ParamField body="a" type="int32" required>
  **asset** — The integer contract ID for which all open orders should be cancelled. Only orders on this contract are affected; orders on other contracts remain untouched.
</ParamField>

## Response

```json theme={"system"}
{
  "status": "ok",
  "response": {
    "type": "cancelAll",
    "data": { "limitCancelled": 2, "conditionalCancelled": 0 }
  }
}
```

### Response Fields

<ResponseField name="limitCancelled" type="int">
  The number of resting limit orders that were cancelled for the specified contract.
</ResponseField>

<ResponseField name="conditionalCancelled" type="int">
  The number of conditional orders (take-profit and stop-loss) that were cancelled for the specified contract.
</ResponseField>

<Note>
  If there are no open orders for the contract, the call still succeeds and both counts will be `0`. This makes `cancelAll` safe to call defensively at the start of a session or strategy reset.
</Note>

<Warning>
  `cancelAll` is scoped to a **single contract** per request. To cancel all orders across multiple contracts, send one `cancelAll` request per contract, each with its own signed nonce.
</Warning>
