curl --request GET \
--url https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/orders/{order_id}{
"order": {
"id": "82c879c1-84e1-44ed-a8c2-1ac239cf09ad",
"user_id": "42",
"portfolio_id": "3e1fe27e-26fe-46d8-b118-c752a2ae6b47",
"product_id": "BTC-USD",
"client_order_id": "f69a20b1-4ac4-420e-90b5-814a12565bfa",
"base_quantity": "50",
"quote_value": "100",
"limit_price": "50.12",
"start_time": "2021-05-31T09:59:59.000Z",
"expiry_time": "2021-05-31T10:59:59.000Z",
"created_at": "2021-05-31T10:59:59.000Z",
"filled_quantity": "100",
"filled_value": "100",
"average_filled_price": "50.19",
"commission": "4.99",
"exchange_fee": "2.50",
"historical_pov": "2.50",
"stop_price": "50.12",
"net_average_filled_price": "57.68",
"user_context": "User initiated cancellation",
"client_product_id": "BTC-USDC",
"post_only": true,
"is_raise_exact": true,
"display_size": "10.5",
"edit_history": [
{
"price": "100",
"base_quantity": "1",
"quote_value": "100",
"display_base_size": "1.00",
"display_quote_size": "1.00",
"stop_price": "120",
"expiry_time": "2021-05-31T10:59:59.000Z",
"accept_time": "2021-06-20T10:59:59.000Z",
"client_order_id": "123"
}
],
"display_quote_size": "100.50",
"display_base_size": "10.5",
"peg_offset_type": "PEG_OFFSET_TYPE_PRICE",
"offset": "100",
"wig_level": "100000"
}
}Retrieve an order by order ID.
curl --request GET \
--url https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/orders/{order_id}{
"order": {
"id": "82c879c1-84e1-44ed-a8c2-1ac239cf09ad",
"user_id": "42",
"portfolio_id": "3e1fe27e-26fe-46d8-b118-c752a2ae6b47",
"product_id": "BTC-USD",
"client_order_id": "f69a20b1-4ac4-420e-90b5-814a12565bfa",
"base_quantity": "50",
"quote_value": "100",
"limit_price": "50.12",
"start_time": "2021-05-31T09:59:59.000Z",
"expiry_time": "2021-05-31T10:59:59.000Z",
"created_at": "2021-05-31T10:59:59.000Z",
"filled_quantity": "100",
"filled_value": "100",
"average_filled_price": "50.19",
"commission": "4.99",
"exchange_fee": "2.50",
"historical_pov": "2.50",
"stop_price": "50.12",
"net_average_filled_price": "57.68",
"user_context": "User initiated cancellation",
"client_product_id": "BTC-USDC",
"post_only": true,
"is_raise_exact": true,
"display_size": "10.5",
"edit_history": [
{
"price": "100",
"base_quantity": "1",
"quote_value": "100",
"display_base_size": "1.00",
"display_quote_size": "1.00",
"stop_price": "120",
"expiry_time": "2021-05-31T10:59:59.000Z",
"accept_time": "2021-06-20T10:59:59.000Z",
"client_order_id": "123"
}
],
"display_quote_size": "100.50",
"display_base_size": "10.5",
"peg_offset_type": "PEG_OFFSET_TYPE_PRICE",
"offset": "100",
"wig_level": "100000"
}
}OrdersService ordersService = PrimeServiceFactory.createOrdersService(client);
GetOrderByOrderIdRequest request = new GetOrderByOrderIdRequest.Builder()
.portfolioId("PORTFOLIO_ID_HERE")
.orderId("ORDER_ID_HERE")
.build();
GetOrderByOrderIdResponse response = ordersService.getOrderByOrderId(request);
A successful response.
Show child attributes
The unique order ID generated by Coinbase
"82c879c1-84e1-44ed-a8c2-1ac239cf09ad"
The ID of the user that created the order
"42"
The ID of the portfolio that owns the order
"3e1fe27e-26fe-46d8-b118-c752a2ae6b47"
The ID of the product being traded by the order
"BTC-USD"
BUY, SELL A client-generated order ID used for reference purposes (note: order will be rejected if this ID is not unique among all currently active orders)
"f69a20b1-4ac4-420e-90b5-814a12565bfa"
MARKET, LIMIT, TWAP, BLOCK, VWAP, STOP_LIMIT, RFQ, PEG Order size in base asset units (either base_quantity or quote_value is required)
"50"
Order size in quote asset units, i.e. the amount the user wants to spend (when buying) or receive (when selling); the quantity in base units will be determined based on the market liquidity and indicated quote_value. Either base_quantity or quote_value is required
"100"
The limit price (required for TWAP, VWAP, LIMIT and STOP_LIMIT orders)
"50.12"
The start time of the order in UTC (only applies to TWAP, VWAP orders.)
"2021-05-31T09:59:59.000Z"
The expiry time of the order in UTC (applies to TWAP, VWAP, LIMIT, and STOP_LIMIT orders with time_in_force set to GTD)
"2021-05-31T10:59:59.000Z"
OPEN, FILLED, CANCELLED, EXPIRED, FAILED, PENDING GOOD_UNTIL_DATE_TIME, GOOD_UNTIL_CANCELLED, IMMEDIATE_OR_CANCEL, FILL_OR_KILL The order creation time as a UTC timestamp
"2021-05-31T10:59:59.000Z"
Size filled (in base asset units)
"100"
Market value filled (in quote asset units)
"100"
Indicates the average filled_price
"50.19"
Total commission paid on this order (in quote asset units) -- only applicable for partially- or fully-filled orders
"4.99"
Fee charged by the exchange for Cost Plus commission configurations. Exchange fee will be 0 for All In commission configurations.
"2.50"
historical pov for the order
"2.50"
Specifies the stop price at which the order activates. The order is activated if the last trade price on Coinbase Exchange crosses the stop price specified on the order
"50.12"
Indicates the average filled_price net of commissions and fees
"57.68"
Indicates a user friendly message for regarding various aspects of the order such as cancellation or rejection reasons
"User initiated cancellation"
The client product ID of the fill indictating the settlment currency
"BTC-USDC"
Post-only flag - indicates whether the order was placed as post-only
true
Indicates if this was a raise exact order (size inclusive of fees for sell orders in quote)
true
Display size for the order
"10.5"
The history of order edits
[
{
"price": "100",
"base_quantity": "1",
"quote_value": "100",
"display_base_size": "1.00",
"display_quote_size": "1.00",
"stop_price": "120",
"expiry_time": "2021-05-31T10:59:59.000Z",
"accept_time": "2021-06-20T10:59:59.000Z",
"client_order_id": "123"
}
]The maximum order size that will show up on venue order books (in quote currency).
"100.50"
The maximum order size that will show up on venue order books (in base currency).
"10.5"
The peg offset type for PEG orders (PRICE, BASIS_POINTS, or CUMULATIVE_DEPTH_IN_BASE_UNITS)
"PEG_OFFSET_TYPE_PRICE"
The offset value for PEG orders
"100"
The wig (would if good) level for PEG orders - best price opposite to limit_price
"100000"
Was this page helpful?