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

# cancelOrder

> Cancel pending limit, market open, or market close orders with the Ostium Builder SDK.

```ts theme={null}
await client.cancelOrder({
  type: CancelOrderType.Limit,
  pairId,
  idx,
});
```

```ts theme={null}
await client.cancelOrder({
  type: CancelOrderType.PendingOpen,
  orderId: 123,
});
```

```ts theme={null}
await client.cancelOrder({
  type: CancelOrderType.PendingClose,
  orderId: 123,
  retry: true,
});
```

## Response schema

```ts theme={null}
interface Response {
  txHash: `0x${string}`;
  smartAccountAddress?: `0x${string}`;
}
```
