Advanced Trade: Orders
resource: orders — place, preview, cancel, and list exchange orders (ORD01–ORD05)
create (ORD01)
Places a live order on the Coinbase exchange.
| Field | Required | Description |
|---|---|---|
productId | ✓ Yes | The trading pair, e.g. BTC-USD. |
side | ✓ Yes | BUY or SELL — accepted case-insensitive, normalized to uppercase. |
orderType | ✓ Yes | limit or market — accepted case-insensitive, normalized to lowercase. Any other value is rejected. |
baseSize | Conditional | Market orders: at least one of baseSize/quoteSize required, positive. Limit orders: required, positive. |
quoteSize | Conditional | Market orders only; see baseSize. |
limitPrice | Limit only | Required and positive when orderType is limit. |
clientOrderId | No | Optional idempotency key. If omitted, a fresh GUID is generated. Must stay the same value across any retry of the same logical attempt — see the callout below. |
Example response:
{
"items": [{
"orderID": "0000-000-000",
"clientOrderID": "3f6a...-guid",
"productID": "BTC-USD",
"side": "BUY",
"status": "OPEN",
"orderType": "limit",
"baseSize": "0.01",
"quoteSize": null,
"limitPrice": "60000.00",
"filledSize": "0",
"averageFilledPrice": null,
"createdTime": "2024-06-01T12:00:00Z"
}]
}
Idempotency matters here.
clientOrderId is this node's only dedup safeguard against double-placing the same order on a network retry. Never regenerate it per HTTP retry attempt — generate it once per logical attempt and reuse it. The operation fails with COINBASE_ORDER_REJECTED if Coinbase's HTTP 200 response body carries success: false (the order was rejected, not accepted, even though the transport call succeeded).
preview (ORD02)
Same config as create, minus clientOrderId — this is a non-mutating dry run, so no idempotency key is needed. Output is the same order-record shape as create, but every field except the size/price inputs you supplied is an estimate.
cancel (ORD03)
Batch-cancels one or more open orders.
| Field | Required | Description |
|---|---|---|
orderIds | ✓ Yes | Comma-separated list or array of order IDs to cancel. |
Output items[] is the subset of orderIds Coinbase confirmed as successfully cancelled — not necessarily all of them.
list (ORD04)
Lists historical and open orders.
| Field | Required | Description |
|---|---|---|
productId | No | Filter to a single trading pair. |
orderStatus | No | Filter by order status. |
startDate | No | Filter to orders created on or after this date. |
endDate | No | Filter to orders created on or before this date. |
limit | No | Maximum number of orders to return. |
Output items[], one entry per order, same shape as create's order record.
get (ORD05)
Returns a single order record.
| Field | Required | Description |
|---|---|---|
orderId | ✓ Yes | The order ID to look up. |