List Locates
client.V1.Locates.GetLocates(ctx, accountID, query) (*V1LocateGetLocatesResponse, error)
GET/v1/accounts/{account_id}/locates
List locates for the account on one effective date, which defaults to today’s New York calendar date. Filter by comma-separated statuses and instrument ids or symbols.
List Locates
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.Locates.GetLocates(
context.TODO(),
0,
clearstreet.V1LocateGetLocatesParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}
{
"metadata": {
"request_id": "request_id",
"next_page_token": "U3RhaW5sZXNzIHJvY2tz",
"page_number": 1,
"previous_page_token": "U3RhaW5sZXNzIHJvY2tz",
"total_items": 42,
"total_pages": 5
},
"error": {
"code": 400,
"message": "Order quantity must be greater than zero",
"details": [
{
"foo": "bar"
}
]
},
"data": [
{
"account_id": 0,
"client_request_id": "client_request_id",
"effective_date": "2019-12-27",
"instrument_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"locate_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"requested_quantity": 0,
"status": "REQUESTED",
"locate_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"quantity": 0,
"related_order_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"reserved_quantity": 0,
"used_quantity": 0
}
]
}Returns Examples
{
"metadata": {
"request_id": "request_id",
"next_page_token": "U3RhaW5sZXNzIHJvY2tz",
"page_number": 1,
"previous_page_token": "U3RhaW5sZXNzIHJvY2tz",
"total_items": 42,
"total_pages": 5
},
"error": {
"code": 400,
"message": "Order quantity must be greater than zero",
"details": [
{
"foo": "bar"
}
]
},
"data": [
{
"account_id": 0,
"client_request_id": "client_request_id",
"effective_date": "2019-12-27",
"instrument_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"locate_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"requested_quantity": 0,
"status": "REQUESTED",
"locate_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"quantity": 0,
"related_order_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"reserved_quantity": 0,
"used_quantity": 0
}
]
}