Skip to content
Start Trading

Get Locate

client.V1.Locates.GetLocateByID(ctx, id, query) (*V1LocateGetLocateByIDResponse, error)
GET/v1/accounts/{account_id}/locates/{id}

Fetch one locate by id, matched against the locate request id, locate id, and client request id, across all days in force.

ParametersExpand Collapse
id string
query V1LocateGetLocateByIDParams
AccountID param.Field[int64]

Account identifier

formatint64
ReturnsExpand Collapse
type V1LocateGetLocateByIDResponse struct{…}
Data Locate

A locate request joined with the locate granted for it, if any.

AccountID int64

Account the locate is booked to.

formatint64
ClientRequestID string

Caller-assigned id of the locate request.

EffectiveDate Time

New York calendar date the locate is in force for.

formatdate
InstrumentID string

Instrument id.

formatuuid
LocateRequestID string

Engine-assigned locate request id.

formatuuid
RequestedQuantity int64

Number of shares requested.

formatint64

Presented status of the locate.

One of the following:
const LocateStatusRequested LocateStatus = "REQUESTED"
const LocateStatusAccepted LocateStatus = "ACCEPTED"
const LocateStatusRejected LocateStatus = "REJECTED"
const LocateStatusExpired LocateStatus = "EXPIRED"
LocateID stringOptional

Engine-assigned locate id; set once the locate is granted. When a null/undefined value is observed, it indicates it does not apply.

formatuuid
Quantity int64Optional

Number of shares granted; set once the locate is granted. When a null/undefined value is observed, it indicates it does not apply.

formatint64

Client order id the request relates to, if any. When a null/undefined value is observed, it indicates it does not apply.

formatuuid
ReservedQuantity int64Optional

Number of granted shares reserved. When a null/undefined value is observed, it indicates it does not apply.

formatint64
UsedQuantity int64Optional

Number of granted shares already used. When a null/undefined value is observed, it indicates it does not apply.

formatint64

Get Locate

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.GetLocateByID(
    context.TODO(),
    "id",
    clearstreet.V1LocateGetLocateByIDParams{
      AccountID: 0,
    },
  )
  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
  }
}