POST /api/v3/brokerage/orders endpoint handles all order types through a flexible order_configuration object. This guide walks you through each step of the process and shows you concrete examples for the most common order types.
Prerequisites
Before placing orders, make sure you have:- A valid JWT token (see Authentication)
- Sufficient funds in your Coinbase account for the order side and size
- The correct
product_idfor the trading pair you want to trade (e.g.,BTC-USD)
Place an order
1
Choose your product and side
Every order targets a specific trading pair called a product. Products follow the format
BASE-QUOTE (e.g., BTC-USD, ETH-USDC). You can retrieve the full list of available products with GET /api/v3/brokerage/products.Along with the product, you must specify a side:For example, a
BUY on BTC-USD spends US dollars to acquire Bitcoin; a SELL on BTC-USD sells Bitcoin for US dollars.2
Choose your order type and set parameters
The
order_configuration object determines the order type and its parameters. Each type uses a distinct key inside order_configuration:For market buys, use
quote_size to specify how many dollars (or quote currency units) to spend. For market sells, use base_size to specify how much of the base asset to sell.3
Submit POST /api/v3/brokerage/orders
Send a
POST request to https://api.coinbase.com/api/v3/brokerage/orders with your JWT in the Authorization header and a JSON body containing at minimum:client_order_id— a unique string you generate to identify this orderproduct_id— the trading pairside—BUYorSELLorder_configuration— the order type object with its parameters
4
Handle the response and confirm your order ID
A successful response returns
"success": true along with an order_id (a UUID assigned by Coinbase) and an order_configuration echo. Store the order_id — you will need it to query order status, cancel the order, or reconcile fills.If the request fails, the response body contains a preview_failure_reason or error_response field explaining why. See the Error handling section below for common error codes.Code examples
Market buy order
A market buy executes immediately at the best available price. Usequote_size to specify the amount of quote currency (e.g., USD) you want to spend.
Limit sell order
A limit sell places an order on the order book that executes only when the market price reaches your specifiedlimit_price or better. The order remains open until filled or cancelled (gtc = good-till-cancelled).
Stop-limit order
A stop-limit order triggers a limit order when the market reaches yourstop_price. Use STOP_DIRECTION_STOP_UP to trigger on a price rise, or STOP_DIRECTION_STOP_DOWN to trigger on a price drop.
Success response
A successfulPOST /orders response looks like this:
Error handling
When"success": false or the HTTP status is 4xx, the response includes an error code you can use to diagnose the problem programmatically.