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

# POST /api/v3/brokerage/orders/batch_cancel — Cancel Orders

> POST /api/v3/brokerage/orders/batch_cancel — cancel one or more open orders in a single request by order ID. Returns per-order success or failure results.

The Cancel Orders endpoint lets you cancel one or more open orders in a single request by providing a list of order IDs. This is more efficient than issuing individual cancel requests when you need to cancel multiple orders at once. The response includes a result for each order ID you submitted, so you can identify exactly which cancellations succeeded and which failed — even within a single batch.

## Endpoint

```
POST https://api.coinbase.com/api/v3/brokerage/orders/batch_cancel
```

## Authentication

This endpoint requires a valid **JWT Bearer token** passed in the `Authorization` header:

```
Authorization: Bearer $JWT
```

## Request Body

**order\_ids** `array of strings` *required*

A list of order UUIDs to cancel. You can include up to **100** order IDs per request. Each ID must correspond to an open order owned by the authenticated user.

## Response Fields

**results** `array`

An array containing one result object per order ID submitted in the request.

**Result object fields**

**order\_id** `string`

The order ID from your request.

**success** `boolean`

Whether the cancellation request for this order was accepted. A value of `true` means the cancel was submitted; it does not guarantee the order was not already filled.

**failure\_reason** `string`

If `success` is `false`, this field describes why the cancellation failed. Common values include `UNKNOWN_CANCEL_ORDER` (order not found or already closed) and `COMMANDER_REJECTED_CANCEL_ORDER`.

> [!NOTE]
>
> **Partial success is possible.** Coinbase processes each cancellation independently within the batch. Some orders in your list may cancel successfully while others fail — for example, if an order was already filled or does not belong to your account. Always check the `success` field on each individual result object.

## Examples

```bash cURL theme={null}
curl -X POST \
  -H "Authorization: Bearer $JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "order_ids": [
      "d4e5f6a7-b8c9-0123-def0-234567890123",
      "e5f6a7b8-c9d0-1234-ef01-345678901234"
    ]
  }' \
  'https://api.coinbase.com/api/v3/brokerage/orders/batch_cancel'
```

```python Python theme={null}
import requests

headers = {
    "Authorization": f"Bearer {jwt_token}",
    "Content-Type": "application/json"
}
payload = {
    "order_ids": [
        "d4e5f6a7-b8c9-0123-def0-234567890123",
        "e5f6a7b8-c9d0-1234-ef01-345678901234"
    ]
}
response = requests.post(
    "https://api.coinbase.com/api/v3/brokerage/orders/batch_cancel",
    json=payload,
    headers=headers
)
results = response.json()["results"]

for result in results:
    if result["success"]:
        print(f"Cancelled: {result['order_id']}")
    else:
        print(f"Failed to cancel {result['order_id']}: {result['failure_reason']}")
```

### Example Request

```json theme={null}
{
  "order_ids": [
    "d4e5f6a7-b8c9-0123-def0-234567890123",
    "e5f6a7b8-c9d0-1234-ef01-345678901234"
  ]
}
```

### Example Response

```json theme={null}
{
  "results": [
    {
      "order_id": "d4e5f6a7-b8c9-0123-def0-234567890123",
      "success": true,
      "failure_reason": ""
    },
    {
      "order_id": "e5f6a7b8-c9d0-1234-ef01-345678901234",
      "success": false,
      "failure_reason": "UNKNOWN_CANCEL_ORDER"
    }
  ]
}
```

In this example, the first order was cancelled successfully, while the second failed — likely because it had already been filled or cancelled before this request was processed.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.