The Advanced Trade Orders endpoints cover the full order lifecycle: previewing, submitting, editing, cancelling, and querying historical orders and fills. TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/tiagosiebler/coinbase-api/llms.txt
Use this file to discover all available pages before exploring further.
client_order_id field is optional — if omitted, the SDK automatically generates a unique value prefixed with cbnode. Bracket and stop-limit order types are supported alongside standard market and limit orders.
submitOrder
Create a new order. Theorder_configuration field determines the order type and time-in-force. Exactly one configuration key must be provided.
| Auth | Required |
| HTTP | POST /api/v3/brokerage/orders |
The trading pair to trade, e.g.
BTC-USD or ETH-USDC.Order direction. Must be
"BUY" or "SELL".Exactly one order type object. See the configuration types table below.
A unique client-supplied identifier. The SDK auto-generates one (prefixed
cbnode) if omitted. Custom values must also start with cbnode.Leverage multiplier for margin/futures orders, e.g.
"3".Margin mode for leveraged orders. One of
"CROSS" or "ISOLATED".An optional secondary order configuration attached to this order (e.g. a take-profit or stop-loss leg).
The
preview_id returned by previewOrder() — links this order to a prior preview.Order configuration types
| Key | Description | Required fields |
|---|---|---|
market_market_ioc | Market order, immediate-or-cancel | base_size or quote_size |
limit_limit_gtc | Limit order, good-till-cancelled | base_size, limit_price |
limit_limit_gtd | Limit order, good-till-date | base_size, limit_price, end_time |
limit_limit_fok | Limit order, fill-or-kill | base_size, limit_price |
sor_limit_ioc | SOR limit, immediate-or-cancel | base_size, limit_price |
stop_limit_stop_limit_gtc | Stop-limit, good-till-cancelled | base_size, limit_price, stop_price, stop_direction |
stop_limit_stop_limit_gtd | Stop-limit, good-till-date | base_size, limit_price, stop_price, stop_direction, end_time |
trigger_bracket_gtc | Bracket order, good-till-cancelled | base_size, limit_price, stop_trigger_price |
trigger_bracket_gtd | Bracket order, good-till-date | base_size, limit_price, stop_trigger_price, end_time |
twap_limit_gtd | TWAP limit, good-till-date | quote_size, base_size, start_time, end_time, limit_price |
Promise<AdvTradeSubmitOrderResponse> — contains success boolean, an optional success_response with order_id, product_id, side, and client_order_id, and an optional error_response on failure.
cancelOrders
Initiate cancel requests for one or more orders in a single batch call. A maximum of 100 order IDs may be submitted per request.| Auth | Required |
| HTTP | POST /api/v3/brokerage/orders/batch_cancel |
Array of order IDs to cancel. Maximum 100 entries per request.
Promise<AdvTradeCancelOrdersResponse> — an object with a results array. Each entry contains order_id, success boolean, and failure_reason.
updateOrder
Edit the price or size of an existing open limit GTC order. Note the queue-position rules: increasing size or changing price moves your order to the back of the queue; decreasing size keeps your place.| Auth | Required |
| HTTP | POST /api/v3/brokerage/orders/edit |
The ID of the order to edit. Only open limit GTC orders can be edited.
New limit price as a decimal string, e.g.
"62000.00".New base size as a decimal string, e.g.
"0.002".Promise<AdvTradeEditOrderResponse> — contains success boolean, an optional success_response with order_id, and an optional error_response detailing failure reasons.
updateOrderPreview
Preview the outcome of editing an order — including slippage, new totals, and best bid/ask — before committing the change.| Auth | Required |
| HTTP | POST /api/v3/brokerage/orders/edit_preview |
The ID of the order to preview editing.
Proposed new limit price as a decimal string.
Proposed new base size as a decimal string.
Promise<AdvTradeEditOrderPreviewResponse> — includes slippage, order_total, commission_total, quote_size, base_size, best_bid, best_ask, average_filled_price, and any errors.
getOrders
List historical orders filtered by optional query parameters. Open orders are limited to a maximum of 1,000 results. Thestart_date and end_date filters do not apply to open orders.
| Auth | Required |
| HTTP | GET /api/v3/brokerage/orders/historical/batch |
Filter to specific order IDs.
Filter by one or more product IDs, e.g.
["BTC-USD", "ETH-USD"].Filter by product type:
"SPOT", "FUTURE", or "UNKNOWN_PRODUCT_TYPE".Filter by status strings, e.g.
["OPEN"], ["FILLED"], ["CANCELLED"].Filter by time-in-force values, e.g.
["GOOD_UNTIL_CANCELLED"].Filter by order type strings, e.g.
["LIMIT"], ["MARKET"].Filter to
"BUY" or "SELL" orders only.RFC3339 timestamp. Start of the date range for filled/cancelled orders.
RFC3339 timestamp. End of the date range.
Filter by order placement source:
"UNKNOWN_PLACEMENT_SOURCE", "RETAIL_SIMPLE", or "RETAIL_ADVANCED".Filter futures by contract expiry:
"UNKNOWN_CONTRACT_EXPIRY_TYPE", "PERPETUAL", or "EXPIRING".Filter orders by asset identifiers.
Maximum number of orders to return per page.
Pagination cursor from a previous response.
Sort results by
"UNKNOWN_SORT_BY", "LIMIT_PRICE", or "LAST_FILL_TIME".Promise<{ orders: AdvTradeOrder[]; has_next: boolean; cursor?: string; sequence?: number }>.
getFills
Retrieve a list of fills (trade executions) filtered by order, product, or time range.| Auth | Required |
| HTTP | GET /api/v3/brokerage/orders/historical/fills |
Filter fills for specific order IDs.
Filter fills for specific trade IDs.
Filter fills for specific products.
RFC3339 timestamp. Return fills at or after this sequence time.
RFC3339 timestamp. Return fills at or before this sequence time.
Filter fills by retail portfolio ID.
Maximum number of fills to return per page.
Pagination cursor from a previous response.
Sort fills by
"UNKNOWN_SORT_BY", "PRICE", or "TRADE_TIME".Promise<{ fills: AdvTradeFill[]; cursor?: string }> — each AdvTradeFill contains entry_id, trade_id, order_id, price, size, commission, side, and RFC3339 trade_time.
getOrder
Retrieve a single historical order by its order ID.| Auth | Required |
| HTTP | GET /api/v3/brokerage/orders/historical/{order_id} |
The unique order ID returned by
submitOrder().Optionally filter by client-supplied order ID.
Return values expressed in this currency, e.g.
"EUR".Promise<{ order: AdvTradeOrder }> — the full order record including status, filled_size, average_filled_price, total_fees, and order_configuration.
previewOrder
Simulate submitting an order to see the estimated total, commission, leverage parameters, and possible errors — without actually placing the order.| Auth | Required |
| HTTP | POST /api/v3/brokerage/orders/preview |
The trading pair to preview, e.g.
"BTC-USD"."BUY" or "SELL".The order configuration to preview. Uses the same structure as
submitOrder().Leverage multiplier for margin/futures previews.
"ISOLATED" or "CROSS".Optional retail portfolio ID to associate with the preview.
Promise<AdvTradeOrderPreview> — includes order_total, commission_total, base_size, quote_size, best_bid, best_ask, slippage, leverage, preview_id, and buffer fields for leveraged positions.
closePosition
Place an order that closes any open position for the specified futures or perpetuals product. The SDK auto-generatesclient_order_id if omitted.
| Auth | Required |
| HTTP | POST /api/v3/brokerage/orders/close_position |
The futures or perpetuals product ID whose open position should be closed.
Optional client-supplied identifier. Auto-generated if omitted.
Quantity to close. Omit to close the entire open position.
Promise<AdvTradeClosePositionResponse> — contains success, an optional success_response with order details, and an optional error_response.