Get Order By ID
client.V1.Orders.GetOrderByID(ctx, orderID, query) (*V1OrderGetOrderByIDResponse, error)
GET/v1/accounts/{account_id}/orders/{order_id}
Get Order By ID
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.GetOrderByID(
context.TODO(),
"order_id",
clearstreet.V1OrderGetOrderByIDParams{
AccountID: 0,
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}
{
"data": {
"account_id": 19816,
"average_fill_price": "149.95",
"created_at": "2025-10-31T13:30:00.000000000Z",
"filled_quantity": "50",
"id": "my-ref-id-20251001-001",
"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"
},
"error": null,
"metadata": {
"request_id": "0c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"code": 403,
"message": "The caller does not have permission to execute the specified operation"
},
"metadata": {
"request_id": "5518f0c6-58ff-4b4a-81a5-701556d41206"
}
}{
"error": {
"code": 404,
"message": "Order 97dfdcfe503f425c8367ca10928e2499 not found for account 100001"
},
"metadata": {
"request_id": "efbd46f4-4bfc-455b-bae0-ee13f84360ba"
}
}Returns Examples
{
"data": {
"account_id": 19816,
"average_fill_price": "149.95",
"created_at": "2025-10-31T13:30:00.000000000Z",
"filled_quantity": "50",
"id": "my-ref-id-20251001-001",
"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"
},
"error": null,
"metadata": {
"request_id": "0c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f"
}
}{
"error": {
"code": 403,
"message": "The caller does not have permission to execute the specified operation"
},
"metadata": {
"request_id": "5518f0c6-58ff-4b4a-81a5-701556d41206"
}
}{
"error": {
"code": 404,
"message": "Order 97dfdcfe503f425c8367ca10928e2499 not found for account 100001"
},
"metadata": {
"request_id": "efbd46f4-4bfc-455b-bae0-ee13f84360ba"
}
}