> ## 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 — Create a New Order

> POST /api/v3/brokerage/orders — place a market, limit, or stop-limit order to buy or sell crypto on Coinbase Advanced Trade. Supports GTC and GTD orders.

The Create Order endpoint lets you place a new trade order on Coinbase Advanced Trade. You can submit market orders for immediate execution at the current price, limit orders that fill at a specified price or better, or stop-limit orders that trigger only when the market reaches a defined stop price. Every request requires a unique `client_order_id` for idempotency and an `order_configuration` object that specifies the order type and its parameters.

## Endpoint

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

## Authentication

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

```
Authorization: Bearer $JWT
```

## Request Body

**client\_order\_id** `string` *required*

A unique ID you generate for this order. Used to ensure idempotency — submitting the same `client_order_id` more than once will not create duplicate orders. Use a UUID or similarly unique value.

**product\_id** `string` *required*

The trading pair for the order (e.g., `BTC-USD`, `ETH-USD`). Must be a valid, active product on Coinbase Advanced Trade.

**side** `string` *required*

The direction of the order. Must be `BUY` or `SELL`.

**order\_configuration** `object` *required*

Defines the order type and its associated parameters. Exactly one of the following sub-objects must be provided:

**market\_market\_ioc — Market Order (Immediate or Cancel)**

Executes immediately at the best available market price. Provide either `quote_size` or `base_size`, but not both.

**quote\_size** `string`

Amount in quote currency to spend (for BUY) or receive (for SELL). For example, `"100"` buys \$100 worth of BTC.

**base\_size** `string`

Amount in base currency to buy or sell. For example, `"0.01"` buys or sells 0.01 BTC.

**limit\_limit\_gtc — Limit Order (Good Till Cancelled)**

Places a limit order that remains open until filled or manually cancelled.

**base\_size** `string` *required*

Amount of base currency to buy or sell (e.g., `"0.01"` for 0.01 BTC).

**limit\_price** `string` *required*

The maximum price you are willing to pay (BUY) or the minimum price you are willing to accept (SELL).

**post\_only** `boolean`

If `true`, the order will only be placed if it will enter the order book as a maker order. The order is rejected if it would execute immediately as a taker.

**limit\_limit\_gtd — Limit Order (Good Till Date)**

A limit order that automatically expires at the specified time if not filled.

**base\_size** `string` *required*

Amount of base currency to buy or sell.

**limit\_price** `string` *required*

The limit price for the order.

**end\_time** `string` *required*

ISO 8601 expiry timestamp. The order is cancelled at this time if not yet filled (e.g., `"2024-12-31T23:59:59Z"`).

**post\_only** `boolean`

If `true`, the order will only rest on the book as a maker order.

**stop\_limit\_stop\_limit\_gtc — Stop-Limit Order (Good Till Cancelled)**

Places a limit order that is activated only when the market price reaches the specified stop price.

**base\_size** `string` *required*

Amount of base currency to buy or sell once triggered.

**limit\_price** `string` *required*

The limit price at which the order should execute after being triggered.

**stop\_price** `string` *required*

The price at which the stop-limit order is triggered.

**stop\_direction** `string` *required*

Direction that triggers the stop. One of:

* `STOP_DIRECTION_STOP_UP` — triggers when price rises to or above `stop_price`
* `STOP_DIRECTION_STOP_DOWN` — triggers when price falls to or below `stop_price`

**leverage** `string`

Leverage multiplier for futures orders (e.g., `"5"` for 5× leverage). Omit for spot orders.

**margin\_type** `string`

Margin mode for futures orders. One of `CROSS` or `ISOLATED`. Omit for spot orders.

## Response Fields

**success** `boolean`

Indicates whether the order was successfully submitted.

**order\_id** `string`

The Coinbase-assigned unique identifier for the created order.

**client\_order\_id** `string`

The `client_order_id` you supplied in the request.

**success\_response** `object`

Present when `success` is `true`. Contains confirmation details.

**success\_response fields**

**order\_id** `string`

The Coinbase-assigned order ID.

**product\_id** `string`

The trading pair the order was placed on.

**side** `string`

The order side — `BUY` or `SELL`.

**client\_order\_id** `string`

The client-supplied order ID echoed back.

**order\_configuration** `object`

The order configuration as accepted by the exchange.

**error\_response** `object`

Present when `success` is `false`. Contains details about why the order was rejected.

**error\_response fields**

**error** `string`

A short error code identifying the failure type (e.g., `INSUFFICIENT_FUND`).

**message** `string`

A human-readable description of the error.

**error\_details** `string`

Additional context or technical details about the error.

**new\_order\_failure\_reason** `string`

Specific reason the order creation failed (e.g., `UNKNOWN_FAILURE_REASON`, `INSUFFICIENT_FUND`).

> [!WARNING]
>
> **`client_order_id` is idempotent.** If you submit a request with a `client_order_id` that matches an order you have already created, Coinbase will **not** create a second order. Instead, it returns the existing order details. Always generate a new unique `client_order_id` for each intended new order.

> [!NOTE]
>
> **`post_only` for limit orders:** Setting `post_only: true` guarantees your limit order will be added to the order book as a maker order and will never execute as a taker. If the order would match an existing order immediately, it is rejected rather than filled. This is useful for strategies where you want to avoid taker fees.

## Examples

### Market Buy

```bash cURL theme={null}
curl -X POST \
  -H "Authorization: Bearer $JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "client_order_id": "11111111-1111-1111-1111-111111111111",
    "product_id": "BTC-USD",
    "side": "BUY",
    "order_configuration": {
      "market_market_ioc": {
        "quote_size": "100"
      }
    }
  }' \
  'https://api.coinbase.com/api/v3/brokerage/orders'
```

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

headers = {
    "Authorization": f"Bearer {jwt_token}",
    "Content-Type": "application/json"
}
payload = {
    "client_order_id": str(uuid.uuid4()),
    "product_id": "BTC-USD",
    "side": "BUY",
    "order_configuration": {
        "market_market_ioc": {
            "quote_size": "100"
        }
    }
}
response = requests.post(
    "https://api.coinbase.com/api/v3/brokerage/orders",
    json=payload,
    headers=headers
)
result = response.json()
```

```json Market Buy Response theme={null}
{
  "success": true,
  "order_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
  "client_order_id": "11111111-1111-1111-1111-111111111111",
  "success_response": {
    "order_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
    "product_id": "BTC-USD",
    "side": "BUY",
    "client_order_id": "11111111-1111-1111-1111-111111111111",
    "order_configuration": {
      "market_market_ioc": {
        "quote_size": "100"
      }
    }
  }
}
```

***

### Limit Sell

```bash cURL theme={null}
curl -X POST \
  -H "Authorization: Bearer $JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "client_order_id": "22222222-2222-2222-2222-222222222222",
    "product_id": "BTC-USD",
    "side": "SELL",
    "order_configuration": {
      "limit_limit_gtc": {
        "base_size": "0.01",
        "limit_price": "50000",
        "post_only": false
      }
    }
  }' \
  'https://api.coinbase.com/api/v3/brokerage/orders'
```

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

headers = {
    "Authorization": f"Bearer {jwt_token}",
    "Content-Type": "application/json"
}
payload = {
    "client_order_id": str(uuid.uuid4()),
    "product_id": "BTC-USD",
    "side": "SELL",
    "order_configuration": {
        "limit_limit_gtc": {
            "base_size": "0.01",
            "limit_price": "50000",
            "post_only": False
        }
    }
}
response = requests.post(
    "https://api.coinbase.com/api/v3/brokerage/orders",
    json=payload,
    headers=headers
)
result = response.json()
```

```json Limit Sell Response theme={null}
{
  "success": true,
  "order_id": "d4e5f6a7-b8c9-0123-def0-234567890123",
  "client_order_id": "22222222-2222-2222-2222-222222222222",
  "success_response": {
    "order_id": "d4e5f6a7-b8c9-0123-def0-234567890123",
    "product_id": "BTC-USD",
    "side": "SELL",
    "client_order_id": "22222222-2222-2222-2222-222222222222",
    "order_configuration": {
      "limit_limit_gtc": {
        "base_size": "0.01",
        "limit_price": "50000",
        "post_only": false
      }
    }
  }
}
```

***

### Stop-Limit Sell (Stop-Loss)

This example places a stop-limit sell order that triggers if BTC-USD falls to $43,000, submitting a limit sell at $42,500. This is a common stop-loss pattern to cap downside risk on a long position.

```bash cURL theme={null}
curl -X POST \
  -H "Authorization: Bearer $JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "client_order_id": "33333333-3333-3333-3333-333333333333",
    "product_id": "BTC-USD",
    "side": "SELL",
    "order_configuration": {
      "stop_limit_stop_limit_gtc": {
        "base_size": "0.01",
        "limit_price": "42500",
        "stop_price": "43000",
        "stop_direction": "STOP_DIRECTION_STOP_DOWN"
      }
    }
  }' \
  'https://api.coinbase.com/api/v3/brokerage/orders'
```

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

headers = {
    "Authorization": f"Bearer {jwt_token}",
    "Content-Type": "application/json"
}
payload = {
    "client_order_id": str(uuid.uuid4()),
    "product_id": "BTC-USD",
    "side": "SELL",
    "order_configuration": {
        "stop_limit_stop_limit_gtc": {
            "base_size": "0.01",
            "limit_price": "42500",
            "stop_price": "43000",
            "stop_direction": "STOP_DIRECTION_STOP_DOWN"
        }
    }
}
response = requests.post(
    "https://api.coinbase.com/api/v3/brokerage/orders",
    json=payload,
    headers=headers
)
result = response.json()
```

```json Stop-Limit Response theme={null}
{
  "success": true,
  "order_id": "e5f6a7b8-c9d0-1234-ef01-345678901234",
  "client_order_id": "33333333-3333-3333-3333-333333333333",
  "success_response": {
    "order_id": "e5f6a7b8-c9d0-1234-ef01-345678901234",
    "product_id": "BTC-USD",
    "side": "SELL",
    "client_order_id": "33333333-3333-3333-3333-333333333333",
    "order_configuration": {
      "stop_limit_stop_limit_gtc": {
        "base_size": "0.01",
        "limit_price": "42500",
        "stop_price": "43000",
        "stop_direction": "STOP_DIRECTION_STOP_DOWN"
      }
    }
  }
}
```


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