Get Orders
client.V1.Orders.GetOrders(ctx, accountID, query) (*V1OrderGetOrdersResponse, error)
GET/v1/accounts/{account_id}/orders
Get Orders
package main
import (
"context"
"fmt"
"github.com/clear-street/clear-street-go"
"github.com/clear-street/clear-street-go/option"
)
func main() {
client := clearstreet.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.V1.Orders.GetOrders(
context.TODO(),
0,
clearstreet.V1OrderGetOrdersParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}
{
"data": [
{
"account_id": 19816,
"average_fill_price": "149.95",
"client_order_id": "my-ref-id-20251001-001",
"created_at": "2025-10-31T13:30:00.000000000Z",
"filled_quantity": "50",
"id": "0195f6c7-4f64-7e3c-8b0a-1d8e4f5e6a7b",
"instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8",
"instrument_type": "COMMON_STOCK",
"leaves_quantity": "50",
"limit_price": "150.00",
"order_type": "LIMIT",
"quantity": "100",
"side": "BUY",
"status": "PARTIALLY_FILLED",
"stop_price": null,
"symbol": "AAPL",
"time_in_force": "DAY",
"updated_at": "2025-10-31T13:35:10.000000000Z"
},
{
"account_id": 19816,
"average_fill_price": "450.75",
"client_order_id": "my-ref-id-20251001-002",
"created_at": "2025-10-31T14:00:00.000000000Z",
"filled_quantity": "200",
"id": "0195f6c8-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
"instrument_id": "b2b3b4b5-c2c3-d2d3-e2e3-e4e5e6e7e8e9",
"instrument_type": "COMMON_STOCK",
"leaves_quantity": "0",
"limit_price": null,
"order_type": "MARKET",
"quantity": "200",
"side": "SELL",
"status": "FILLED",
"stop_price": null,
"symbol": "MSFT",
"time_in_force": "DAY",
"updated_at": "2025-10-31T14:00:05.000000000Z"
}
],
"error": null,
"metadata": {
"next_page_token": "cGFnZT0yJmxhc3RfaWQ9b3JkXzRjRDVlNkY3ZzhIOWkwSjE=",
"page_number": 1,
"request_id": "d9a4f5b6-c3d4-6e5f-0a1b-7c8d9e0f1a2b",
"total_items": 25,
"total_pages": 3
}
}{
"error": {
"code": 403,
"message": "The caller does not have permission to execute the specified operation"
},
"metadata": {
"request_id": "5518f0c6-58ff-4b4a-81a5-701556d41206"
}
}Returns Examples
{
"data": [
{
"account_id": 19816,
"average_fill_price": "149.95",
"client_order_id": "my-ref-id-20251001-001",
"created_at": "2025-10-31T13:30:00.000000000Z",
"filled_quantity": "50",
"id": "0195f6c7-4f64-7e3c-8b0a-1d8e4f5e6a7b",
"instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8",
"instrument_type": "COMMON_STOCK",
"leaves_quantity": "50",
"limit_price": "150.00",
"order_type": "LIMIT",
"quantity": "100",
"side": "BUY",
"status": "PARTIALLY_FILLED",
"stop_price": null,
"symbol": "AAPL",
"time_in_force": "DAY",
"updated_at": "2025-10-31T13:35:10.000000000Z"
},
{
"account_id": 19816,
"average_fill_price": "450.75",
"client_order_id": "my-ref-id-20251001-002",
"created_at": "2025-10-31T14:00:00.000000000Z",
"filled_quantity": "200",
"id": "0195f6c8-1a2b-7c3d-8e4f-5a6b7c8d9e0f",
"instrument_id": "b2b3b4b5-c2c3-d2d3-e2e3-e4e5e6e7e8e9",
"instrument_type": "COMMON_STOCK",
"leaves_quantity": "0",
"limit_price": null,
"order_type": "MARKET",
"quantity": "200",
"side": "SELL",
"status": "FILLED",
"stop_price": null,
"symbol": "MSFT",
"time_in_force": "DAY",
"updated_at": "2025-10-31T14:00:05.000000000Z"
}
],
"error": null,
"metadata": {
"next_page_token": "cGFnZT0yJmxhc3RfaWQ9b3JkXzRjRDVlNkY3ZzhIOWkwSjE=",
"page_number": 1,
"request_id": "d9a4f5b6-c3d4-6e5f-0a1b-7c8d9e0f1a2b",
"total_items": 25,
"total_pages": 3
}
}{
"error": {
"code": 403,
"message": "The caller does not have permission to execute the specified operation"
},
"metadata": {
"request_id": "5518f0c6-58ff-4b4a-81a5-701556d41206"
}
}