Skip to main content
GET
/
v1
/
portfolios
/
{portfolio_id}
/
orders
/
{order_id}
Get Order by Order ID
curl --request GET \
  --url https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/orders/{order_id}
import requests

url = "https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/orders/{order_id}"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/orders/{order_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/orders/{order_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/orders/{order_id}"

req, _ := http.NewRequest("GET", url, nil)

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/orders/{order_id}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/orders/{order_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
{
  "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,
    "order_edit_history": [
      {
        "price": "<string>",
        "size": "<string>",
        "display_size": "<string>",
        "stop_price": "<string>",
        "stop_limit_price": "<string>",
        "end_time": "2023-11-07T05:31:56Z",
        "accept_time": "2023-11-07T05:31:56Z",
        "client_order_id": "<string>"
      }
    ],
    "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",
    "commission_detail_total": {
      "total_commission": "<string>",
      "client_commission": "<string>",
      "venue_commission": "<string>",
      "ces_commission": "<string>",
      "financing_commission": "<string>",
      "regulatory_commission": "<string>",
      "clearing_commission": "<string>"
    }
  }
}
Use the Prime SDK or CLI to test this endpoint by following the quickstart guide and running with the following examples
OrdersService ordersService = PrimeServiceFactory.createOrdersService(client);

GetOrderByOrderIdRequest request = new GetOrderByOrderIdRequest.Builder()
    .portfolioId("PORTFOLIO_ID_HERE")
    .orderId("ORDER_ID_HERE")
    .build();

GetOrderByOrderIdResponse response = ordersService.getOrderByOrderId(request);
For more information, please visit the Prime Java SDK.

Path Parameters

portfolio_id
string
required

Portfolio ID

order_id
string
required

Order ID

Response

200 - application/json

A successful response.

order
object