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

# Polymarket Cancel Order

Cancel open orders on Polymarket. Supports cancelling a single order by ID, multiple orders by ID array, all orders for a specific market/asset, or all open orders. Ideal for: risk management, portfolio rebalancing, automated safety nets, order cleanup.

![Polymarket Cancel Order logo](https://cdn.b3.fun/b3os-icons/polymarket-icon.png)
Catalog action Utility wallet

Cancel open orders on Polymarket. Supports cancelling a single order by ID, multiple orders by ID array, all orders for a specific market/asset, or all open orders. Ideal for: risk management, portfolio rebalancing, automated safety nets, order cleanup.

**Review wallet and value movement**

This action can require a wallet connector, gas, token movement, or an external side effect. Test with simulation or a controlled amount before using it in a live workflow.

## At a Glance

| Field | Value |
| --- | --- |
| Action ID | `polymarket-cancel-order` |
| Category | Utility |
| Connector | `wallet` |
| Requires gas | No |
| Funds movement | None declared |
| Tags | `polymarket`, `trading`, `orders`, `write` |

## Payload Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `mode` | `string` | Yes | Cancel mode. 'single' cancels one order by ID. 'batch' cancels multiple by ID array. 'market' cancels all orders for a specific market or asset. 'all' cancels every open order. |
| `orderId` | `string` | No | Order ID to cancel \(required for mode 'single'\). |
| `orderIds` | `array` | No | Array of order IDs to cancel \(required for mode 'batch'\). Max 100. |
| `market` | `string` | No | Market condition ID — cancel all orders for this market \(used with mode 'market'\). |
| `assetId` | `string` | No | Asset/token ID — cancel all orders for this asset \(used with mode 'market'\). |

## Result Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | `string` | Yes | Overall cancellation status. |
| `cancelledCount` | `number` | No | Number of orders successfully cancelled. |
| `cancelledOrderIds` | `array` | No | IDs of cancelled orders \(when available from the API response\). |
| `notCancelled` | `object` | No | Map of order IDs that failed to cancel with their error reasons. |
| `message` | `string` | No | Additional context about the cancellation result. |

## Examples

**Workflow node**

```json
{
  "type": "polymarket-cancel-order",
  "payload": {
    "mode": "single"
  },
  "children": [],
  "connector": {
    "type": "wallet",
    "id": "conn_wallet"
  }
}
```
  **Test with API**

```bash
curl -X POST "https://api.b3os.org/v1/actions/polymarket-cancel-order/test" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "inputs": {
    "mode": "single"
  }
}'
```

**Use expressions for dynamic values**

Payload fields can use workflow expressions such as `{{$trigger.body.amount}}`, `{{$nodes.fetch.result.price}}`, and `{{$props.asset}}` when the value should come from a trigger, prior node, or reusable workflow prop.