List Order Fills
curl --request GET \
--url https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/orders/{order_id}/fillsimport requests
url = "https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/orders/{order_id}/fills"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/orders/{order_id}/fills', 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}/fills",
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}/fills"
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}/fills")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/orders/{order_id}/fills")
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{
"fills": [
{
"id": "dc376e5b-84fa-4bdf-9f13-537b1bde8fc3",
"order_id": "ba1115bc-7b3c-4b6b-ae38-585f3ab59271",
"product_id": "BTC-USD",
"client_product_id": "BTC-USDC",
"filled_quantity": "100",
"filled_value": "25",
"price": "140.91",
"time": "2021-05-31T11:59:59.000Z",
"commission": "5.55",
"venue": "Coinbase",
"venue_fees": "2.50",
"ces_commission": "1.25",
"commission_detail_total": {
"total_commission": "<string>",
"client_commission": "<string>",
"venue_commission": "<string>",
"ces_commission": "<string>",
"financing_commission": "<string>",
"regulatory_commission": "<string>",
"clearing_commission": "<string>"
}
}
],
"pagination": {
"next_cursor": "<string>",
"sort_direction": "DESC",
"has_next": true
}
}Orders
List Order Fills
Retrieve fills on a given order. This endpoint returns a payload with a default limit of 100 if not specified by the user. The maximum allowed limit is 3000.
GET
/
v1
/
portfolios
/
{portfolio_id}
/
orders
/
{order_id}
/
fills
List Order Fills
curl --request GET \
--url https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/orders/{order_id}/fillsimport requests
url = "https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/orders/{order_id}/fills"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/orders/{order_id}/fills', 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}/fills",
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}/fills"
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}/fills")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.prime.coinbase.com/v1/portfolios/{portfolio_id}/orders/{order_id}/fills")
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{
"fills": [
{
"id": "dc376e5b-84fa-4bdf-9f13-537b1bde8fc3",
"order_id": "ba1115bc-7b3c-4b6b-ae38-585f3ab59271",
"product_id": "BTC-USD",
"client_product_id": "BTC-USDC",
"filled_quantity": "100",
"filled_value": "25",
"price": "140.91",
"time": "2021-05-31T11:59:59.000Z",
"commission": "5.55",
"venue": "Coinbase",
"venue_fees": "2.50",
"ces_commission": "1.25",
"commission_detail_total": {
"total_commission": "<string>",
"client_commission": "<string>",
"venue_commission": "<string>",
"ces_commission": "<string>",
"financing_commission": "<string>",
"regulatory_commission": "<string>",
"clearing_commission": "<string>"
}
}
],
"pagination": {
"next_cursor": "<string>",
"sort_direction": "DESC",
"has_next": true
}
}Use the Prime SDK or CLI to test this endpoint by following the quickstart guide and running with the following examples
For more information, please visit the Prime Java SDK.For more information, please visit the Prime .NET SDK.For more information, please visit the Prime Go SDK.For more information, please visit the Prime Python SDK.For more information, please visit the Prime CLI.For more information, please visit the Prime TS SDK.
- Java
- .NET
- Go
- Python
- CLI
- TS/JS
OrdersService ordersService = PrimeServiceFactory.createOrdersService(client);
ListOrderFillsRequest request = new ListOrderFillsRequest.Builder()
.portfolioId("PORTFOLIO_ID_HERE")
.orderId("ORDER_ID_HERE")
.build();
ListOrderFillsResponse response = ordersService.listOrderFills(request);
var ordersService = new OrdersService(client);
var request = new ListOrderFillsRequest("PORTFOLIO_ID_HERE", "ORDER_ID_HERE");
var response = ordersService.ListOrderFills(request);
ordersService := orders.NewOrdersService(client)
request := &orders.ListOrderFillsRequest{
PortfolioId: "PORTFOLIO_ID_HERE",
OrderId: "ORDER_ID_HERE",
}
response, err := ordersService.ListOrderFills(context.Background(), request)
prime_client = PrimeClient(credentials)
request = ListOrderFillsRequest(
portfolio_id="PORTFOLIO_ID_HERE",
order_id="ORDER_ID_HERE",
)
response = prime_client.list_order_fills(request)
primectl get-order-fills --help
const ordersService = new OrdersService(client);
ordersService.listOrderFills({
portfolioId: 'PORTFOLIO_ID_HERE',
orderId: 'ORDER_ID_HERE',
}).then(async (response) => {
console.log('Fills: ', response);
})
Path Parameters
The portfolio ID associated with the order
The order ID generated by Coinbase
Query Parameters
Cursor used for pagination (last consumed record)
Number of items to retrieve
Sorting order
Available options:
DESC, ASC Was this page helpful?
⌘I