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

# Cancel Order

> Cancel an open order on an on-chain order book

Cancels an open order. Only the original submitter (identified by `userAddress`) can cancel their own orders.

## Authentication

Requires an instance API key with the `trading` service enabled.

## Path Parameters

<ParamField path="orderId" type="string" required>
  The order identifier. Max 100 characters.
</ParamField>

## Request Body

<ParamField body="userAddress" type="string" required>
  EVM address of the user who placed the order. Must match the original order's `userAddress`. Format: `0x[a-fA-F0-9]{40}`.
</ParamField>

<RequestExample>
  ```json theme={null}
  {
    "userAddress": "0x1111111111111111111111111111111111111111"
  }
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "data": {
      "id": "ord_xyz789",
      "status": "CANCELLED",
      "cancelledAt": "2025-01-15T10:35:00.000Z"
    },
    "metadata": {
      "requestId": "550e8400-e29b-41d4-a716-446655440000",
      "timestamp": "2025-01-15T10:35:00.000Z",
      "instanceId": "inst_abc"
    }
  }
  ```
</ResponseExample>

## Error Codes

| Code              | Status | Description                                              |
| ----------------- | ------ | -------------------------------------------------------- |
| `ORDER_NOT_FOUND` | 404    | Order does not exist or does not belong to this instance |
