> ## 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.

# cancelConditional: Cancel a Single Conditional Order

> Cancel one conditional order by its order ID. Works for TP/SL and standalone triggers. Returns an error if not found or owned by a different user.

The `cancelConditional` action cancels a single conditional order by its order ID. It works for both TP/SL orders created via [`tpSl`](/exchange/tp-sl) and standalone trigger orders. Use this action when you need to cancel a specific leg of a TP/SL setup; to cancel all TP/SL orders for a position at once, use [`cancelTpSl`](/exchange/cancel-tp-sl) instead.

## Endpoint

```
POST https://dev.upsidemax.xyz/exchange
```

## Request

All requests must include an ECDSA signature and a millisecond-precision nonce.

```json theme={"system"}
{
  "action": {
    "type": "cancelConditional",
    "oid": 734796988633055604
  },
  "signature": { "r": "0x...", "s": "0x...", "v": 28 },
  "nonce": 1778858800000
}
```

### Action fields

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

<ParamField body="oid" type="int64" required>
  The conditional order ID to cancel. Must be greater than `0`. You receive this ID in the `tpOrderId` or `slOrderId` field of the [`tpSl`](/exchange/tp-sl) response.
</ParamField>

## Response

### Success

```json theme={"system"}
{
  "status": "ok",
  "response": {
    "type": "cancelConditional",
    "data": { "cancelledCount": 1 }
  }
}
```

### Response fields

<ResponseField name="cancelledCount" type="int">
  The number of orders cancelled. Always `1` on success for this action.
</ResponseField>

## Error reference

| Error                         | Cause                                                                                          |
| ----------------------------- | ---------------------------------------------------------------------------------------------- |
| `OrderNotFound` (`errorCode`) | No conditional order with the given `oid` exists or it has already been filled/cancelled.      |
| `ScopeMismatch` (`errorCode`) | The order exists but belongs to a different user account. You can only cancel your own orders. |
