Orders
Create Order
REST API
- Introduction
- Accounts
- Convert
- Data API
- Fees
- Futures
- Orders
- Payment Methods
- Perpetuals
- Portfolios
- Products
- Public
Orders
Create Order
Create an order with a specified product_id
(asset-pair), side
(buy/sell), etc.
POST
/
api
/
v3
/
brokerage
/
orders
Copy
Ask AI
curl --request POST \
--url https://api.coinbase.com/api/v3/brokerage/orders \
--header 'Content-Type: application/json' \
--data '{
"client_order_id": "0000-00000-000000",
"product_id": "BTC-USD",
"side": "<any>",
"order_configuration": {
"market_market_ioc": {
"quote_size": "10.00",
"base_size": "0.001",
"rfq_disabled": true
},
"sor_limit_ioc": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"rfq_disabled": true
},
"limit_limit_gtc": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"post_only": false,
"rfq_disabled": true
},
"limit_limit_gtd": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"end_time": "2021-05-31T09:59:59.000Z",
"post_only": false
},
"limit_limit_fok": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"rfq_disabled": true
},
"twap_limit_gtd": {
"quote_size": "10.00",
"base_size": "0.001",
"start_time": "2021-05-31T07:59:59.000Z",
"end_time": "2021-05-31T09:59:59.000Z",
"limit_price": "10000.00",
"number_buckets": "5",
"bucket_size": "2.00",
"bucket_duration": "300s"
},
"stop_limit_stop_limit_gtc": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_price": "20000.00",
"stop_direction": "<any>"
},
"stop_limit_stop_limit_gtd": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_price": "20000.00",
"end_time": "2021-05-31T09:59:59.000Z",
"stop_direction": "<any>"
},
"trigger_bracket_gtc": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_trigger_price": "20000.00"
},
"trigger_bracket_gtd": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_trigger_price": "20000.00",
"end_time": "2021-05-31T09:59:59.000Z"
}
},
"leverage": "2.0",
"margin_type": "<any>",
"retail_portfolio_id": "11111111-1111-1111-1111-111111111111",
"preview_id": "b40bbff9-17ce-4726-8b64-9de7ae57ad26",
"attached_order_configuration": {
"market_market_ioc": {
"quote_size": "10.00",
"base_size": "0.001",
"rfq_disabled": true
},
"sor_limit_ioc": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"rfq_disabled": true
},
"limit_limit_gtc": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"post_only": false,
"rfq_disabled": true
},
"limit_limit_gtd": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"end_time": "2021-05-31T09:59:59.000Z",
"post_only": false
},
"limit_limit_fok": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"rfq_disabled": true
},
"twap_limit_gtd": {
"quote_size": "10.00",
"base_size": "0.001",
"start_time": "2021-05-31T07:59:59.000Z",
"end_time": "2021-05-31T09:59:59.000Z",
"limit_price": "10000.00",
"number_buckets": "5",
"bucket_size": "2.00",
"bucket_duration": "300s"
},
"stop_limit_stop_limit_gtc": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_price": "20000.00",
"stop_direction": "<any>"
},
"stop_limit_stop_limit_gtd": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_price": "20000.00",
"end_time": "2021-05-31T09:59:59.000Z",
"stop_direction": "<any>"
},
"trigger_bracket_gtc": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_trigger_price": "20000.00"
},
"trigger_bracket_gtd": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_trigger_price": "20000.00",
"end_time": "2021-05-31T09:59:59.000Z"
}
}
}'
Copy
Ask AI
{
"success": true,
"success_response": {
"order_id": "11111-00000-000000",
"product_id": "BTC-USD",
"side": "<any>",
"client_order_id": "0000-00000-000000"
},
"error_response": {
"error": "<any>",
"message": "The order configuration was invalid",
"error_details": "Market orders cannot be placed with empty order sizes",
"preview_failure_reason": "<any>",
"new_order_failure_reason": "<any>"
},
"order_configuration": {
"market_market_ioc": {
"quote_size": "10.00",
"base_size": "0.001",
"rfq_disabled": true
},
"sor_limit_ioc": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"rfq_disabled": true
},
"limit_limit_gtc": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"post_only": false,
"rfq_disabled": true
},
"limit_limit_gtd": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"end_time": "2021-05-31T09:59:59.000Z",
"post_only": false
},
"limit_limit_fok": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"rfq_disabled": true
},
"twap_limit_gtd": {
"quote_size": "10.00",
"base_size": "0.001",
"start_time": "2021-05-31T07:59:59.000Z",
"end_time": "2021-05-31T09:59:59.000Z",
"limit_price": "10000.00",
"number_buckets": "5",
"bucket_size": "2.00",
"bucket_duration": "300s"
},
"stop_limit_stop_limit_gtc": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_price": "20000.00",
"stop_direction": "<any>"
},
"stop_limit_stop_limit_gtd": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_price": "20000.00",
"end_time": "2021-05-31T09:59:59.000Z",
"stop_direction": "<any>"
},
"trigger_bracket_gtc": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_trigger_price": "20000.00"
},
"trigger_bracket_gtd": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_trigger_price": "20000.00",
"end_time": "2021-05-31T09:59:59.000Z"
}
}
}
Body
application/json
Response
200
application/json
A successful response.
The response is of type object
.
Was this page helpful?
Copy
Ask AI
curl --request POST \
--url https://api.coinbase.com/api/v3/brokerage/orders \
--header 'Content-Type: application/json' \
--data '{
"client_order_id": "0000-00000-000000",
"product_id": "BTC-USD",
"side": "<any>",
"order_configuration": {
"market_market_ioc": {
"quote_size": "10.00",
"base_size": "0.001",
"rfq_disabled": true
},
"sor_limit_ioc": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"rfq_disabled": true
},
"limit_limit_gtc": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"post_only": false,
"rfq_disabled": true
},
"limit_limit_gtd": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"end_time": "2021-05-31T09:59:59.000Z",
"post_only": false
},
"limit_limit_fok": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"rfq_disabled": true
},
"twap_limit_gtd": {
"quote_size": "10.00",
"base_size": "0.001",
"start_time": "2021-05-31T07:59:59.000Z",
"end_time": "2021-05-31T09:59:59.000Z",
"limit_price": "10000.00",
"number_buckets": "5",
"bucket_size": "2.00",
"bucket_duration": "300s"
},
"stop_limit_stop_limit_gtc": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_price": "20000.00",
"stop_direction": "<any>"
},
"stop_limit_stop_limit_gtd": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_price": "20000.00",
"end_time": "2021-05-31T09:59:59.000Z",
"stop_direction": "<any>"
},
"trigger_bracket_gtc": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_trigger_price": "20000.00"
},
"trigger_bracket_gtd": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_trigger_price": "20000.00",
"end_time": "2021-05-31T09:59:59.000Z"
}
},
"leverage": "2.0",
"margin_type": "<any>",
"retail_portfolio_id": "11111111-1111-1111-1111-111111111111",
"preview_id": "b40bbff9-17ce-4726-8b64-9de7ae57ad26",
"attached_order_configuration": {
"market_market_ioc": {
"quote_size": "10.00",
"base_size": "0.001",
"rfq_disabled": true
},
"sor_limit_ioc": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"rfq_disabled": true
},
"limit_limit_gtc": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"post_only": false,
"rfq_disabled": true
},
"limit_limit_gtd": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"end_time": "2021-05-31T09:59:59.000Z",
"post_only": false
},
"limit_limit_fok": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"rfq_disabled": true
},
"twap_limit_gtd": {
"quote_size": "10.00",
"base_size": "0.001",
"start_time": "2021-05-31T07:59:59.000Z",
"end_time": "2021-05-31T09:59:59.000Z",
"limit_price": "10000.00",
"number_buckets": "5",
"bucket_size": "2.00",
"bucket_duration": "300s"
},
"stop_limit_stop_limit_gtc": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_price": "20000.00",
"stop_direction": "<any>"
},
"stop_limit_stop_limit_gtd": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_price": "20000.00",
"end_time": "2021-05-31T09:59:59.000Z",
"stop_direction": "<any>"
},
"trigger_bracket_gtc": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_trigger_price": "20000.00"
},
"trigger_bracket_gtd": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_trigger_price": "20000.00",
"end_time": "2021-05-31T09:59:59.000Z"
}
}
}'
Copy
Ask AI
{
"success": true,
"success_response": {
"order_id": "11111-00000-000000",
"product_id": "BTC-USD",
"side": "<any>",
"client_order_id": "0000-00000-000000"
},
"error_response": {
"error": "<any>",
"message": "The order configuration was invalid",
"error_details": "Market orders cannot be placed with empty order sizes",
"preview_failure_reason": "<any>",
"new_order_failure_reason": "<any>"
},
"order_configuration": {
"market_market_ioc": {
"quote_size": "10.00",
"base_size": "0.001",
"rfq_disabled": true
},
"sor_limit_ioc": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"rfq_disabled": true
},
"limit_limit_gtc": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"post_only": false,
"rfq_disabled": true
},
"limit_limit_gtd": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"end_time": "2021-05-31T09:59:59.000Z",
"post_only": false
},
"limit_limit_fok": {
"quote_size": "10.00",
"base_size": "0.001",
"limit_price": "10000.00",
"rfq_disabled": true
},
"twap_limit_gtd": {
"quote_size": "10.00",
"base_size": "0.001",
"start_time": "2021-05-31T07:59:59.000Z",
"end_time": "2021-05-31T09:59:59.000Z",
"limit_price": "10000.00",
"number_buckets": "5",
"bucket_size": "2.00",
"bucket_duration": "300s"
},
"stop_limit_stop_limit_gtc": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_price": "20000.00",
"stop_direction": "<any>"
},
"stop_limit_stop_limit_gtd": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_price": "20000.00",
"end_time": "2021-05-31T09:59:59.000Z",
"stop_direction": "<any>"
},
"trigger_bracket_gtc": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_trigger_price": "20000.00"
},
"trigger_bracket_gtd": {
"base_size": "0.001",
"limit_price": "10000.00",
"stop_trigger_price": "20000.00",
"end_time": "2021-05-31T09:59:59.000Z"
}
}
}
Assistant
Responses are generated using AI and may contain mistakes.