# Locates

## List Locate Rates

`LocateGetLocateRatesResponse v1().locates().getLocateRates(LocateGetLocateRatesParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

**get** `/v1/locates/rates`

Fetch the cached locate borrow rates for up to 1,000 instruments. The
response returns one row per requested instrument, in request order. Each
row carries either the `rate` or an `error` — a `404` when the instrument
is unknown or has no cached rate. The status is `207` when any row has an
error, `200` when every instrument resolved to a rate.

### Parameters

- `LocateGetLocateRatesParams params`

  - `List<String> instrumentIds`

    Comma-separated instrument IDs (UUID) or symbols; at least one, at most 1,000.

### Returns

- `class LocateGetLocateRatesResponse:`

  - `List<LocateRateResult> data`

    - `String instrument`

      The instrument id (UUID) or symbol, echoed exactly as requested, so each
      result maps back to its request.

    - `Optional<ApiError> error`

      Why no rate is present — a `404` when the instrument is unknown or has
      no cached rate. Omitted when `rate` is present.

      - `long code`

        The error code is used to identify the nature of the error. It corresponds
        to an HTTP status code.

      - `String message`

        A human-readable message providing more details about the error.

      - `Optional<List<Detail>> details`

        Additional error details, if any. This can include structured information
        such as field violations or error metadata.

    - `Optional<LocateRate> rate`

      The cached borrow rate. Present when a rate was found; omitted when
      `error` is present.

      - `String instrumentId`

        Instrument id the rate applies to.

      - `String rate`

        Borrow rate, expressed as a decimal (e.g. 0.037012 for 3.7012%).

      - `Optional<LocalDateTime> asOf`

        When the rate was requested from the locates venue.

### Example

```java
package com.clearstreet.api.example;

import com.clearstreet.api.client.ClearStreetClient;
import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient;
import com.clearstreet.api.models.v1.locates.LocateGetLocateRatesParams;
import com.clearstreet.api.models.v1.locates.LocateGetLocateRatesResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        ClearStreetClient client = ClearStreetOkHttpClient.builder()
            .fromEnv()
            .apiKey("My API Key")
            .build();

        LocateGetLocateRatesParams params = LocateGetLocateRatesParams.builder()
            .addInstrumentId("x")
            .build();
        LocateGetLocateRatesResponse response = client.v1().locates().getLocateRates(params);
    }
}
```

#### Response

```json
{
  "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": [
    {
      "instrument": "AAPL",
      "error": {
        "code": 400,
        "message": "Order quantity must be greater than zero",
        "details": [
          {
            "foo": "bar"
          }
        ]
      },
      "rate": {
        "instrument_id": "528ec5c3-cdbf-447c-b995-ec6c83cfbc02",
        "rate": "0.037012",
        "as_of": "2026-09-10T14:33:07.107683Z"
      }
    }
  ]
}
```

## Get Locate Rate

`LocateGetLocateRateByIdResponse v1().locates().getLocateRateById(LocateGetLocateRateByIdParamsparams = LocateGetLocateRateByIdParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

**get** `/v1/locates/rates/{instrument_id}`

Fetch the cached locate borrow rate for one instrument. Rates refresh
periodically; `404` means no rate is currently cached for the instrument.

### Parameters

- `LocateGetLocateRateByIdParams params`

  - `Optional<String> instrumentId`

    Instrument identifier: either an instrument UUID or a symbol (symbol for equities, OSI for options). Non-UUID inputs are resolved server-side.

### Returns

- `class LocateGetLocateRateByIdResponse:`

  - `LocateRate data`

    A locate borrow rate for an instrument.

    - `String instrumentId`

      Instrument id the rate applies to.

    - `String rate`

      Borrow rate, expressed as a decimal (e.g. 0.037012 for 3.7012%).

    - `Optional<LocalDateTime> asOf`

      When the rate was requested from the locates venue.

### Example

```java
package com.clearstreet.api.example;

import com.clearstreet.api.client.ClearStreetClient;
import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient;
import com.clearstreet.api.models.v1.locates.LocateGetLocateRateByIdParams;
import com.clearstreet.api.models.v1.locates.LocateGetLocateRateByIdResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        ClearStreetClient client = ClearStreetOkHttpClient.builder()
            .fromEnv()
            .apiKey("My API Key")
            .build();

        LocateGetLocateRateByIdResponse response = client.v1().locates().getLocateRateById("x");
    }
}
```

#### Response

```json
{
  "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": {
    "instrument_id": "528ec5c3-cdbf-447c-b995-ec6c83cfbc02",
    "rate": "0.037012",
    "as_of": "2026-09-10T14:33:07.107683Z"
  }
}
```

## List Locates

`LocateGetLocatesResponse v1().locates().getLocates(LocateGetLocatesParamsparams = LocateGetLocatesParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

**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.

### Parameters

- `LocateGetLocatesParams params`

  - `Optional<Long> accountId`

  - `Optional<LocalDate> effectiveDate`

    Effective date to list; defaults to today's New York calendar date. Explicit dates are used unchanged, including weekends and holidays.

  - `Optional<List<String>> instrumentIds`

    Comma-separated instrument IDs (UUID) or symbols.

  - `Optional<List<Status>> status`

    Comma-separated locate statuses to filter by

    - `REQUESTED("REQUESTED")`

    - `ACCEPTED("ACCEPTED")`

    - `REJECTED("REJECTED")`

    - `EXPIRED("EXPIRED")`

### Returns

- `class LocateGetLocatesResponse:`

  - `List<Locate> data`

    - `long accountId`

      Account the locate is booked to.

    - `String clientRequestId`

      Caller-assigned id of the locate request.

    - `LocalDate effectiveDate`

      New York calendar date the locate is in force for.

    - `String instrumentId`

      Instrument id.

    - `String locateRequestId`

      Engine-assigned locate request id.

    - `long requestedQuantity`

      Number of shares requested.

    - `LocateStatus status`

      Presented status of the locate.

      - `REQUESTED("REQUESTED")`

      - `ACCEPTED("ACCEPTED")`

      - `REJECTED("REJECTED")`

      - `EXPIRED("EXPIRED")`

    - `Optional<String> locateId`

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

    - `Optional<Long> quantity`

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

    - `Optional<String> relatedOrderId`

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

    - `Optional<Long> reservedQuantity`

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

    - `Optional<Long> usedQuantity`

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

### Example

```java
package com.clearstreet.api.example;

import com.clearstreet.api.client.ClearStreetClient;
import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient;
import com.clearstreet.api.models.v1.locates.LocateGetLocatesParams;
import com.clearstreet.api.models.v1.locates.LocateGetLocatesResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        ClearStreetClient client = ClearStreetOkHttpClient.builder()
            .fromEnv()
            .apiKey("My API Key")
            .build();

        LocateGetLocatesResponse response = client.v1().locates().getLocates(0L);
    }
}
```

#### Response

```json
{
  "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
    }
  ]
}
```

## Get Locate

`LocateGetLocateByIdResponse v1().locates().getLocateById(LocateGetLocateByIdParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

**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.

### Parameters

- `LocateGetLocateByIdParams params`

  - `long accountId`

  - `Optional<String> id`

### Returns

- `class LocateGetLocateByIdResponse:`

  - `Locate data`

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

    - `long accountId`

      Account the locate is booked to.

    - `String clientRequestId`

      Caller-assigned id of the locate request.

    - `LocalDate effectiveDate`

      New York calendar date the locate is in force for.

    - `String instrumentId`

      Instrument id.

    - `String locateRequestId`

      Engine-assigned locate request id.

    - `long requestedQuantity`

      Number of shares requested.

    - `LocateStatus status`

      Presented status of the locate.

      - `REQUESTED("REQUESTED")`

      - `ACCEPTED("ACCEPTED")`

      - `REJECTED("REJECTED")`

      - `EXPIRED("EXPIRED")`

    - `Optional<String> locateId`

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

    - `Optional<Long> quantity`

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

    - `Optional<String> relatedOrderId`

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

    - `Optional<Long> reservedQuantity`

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

    - `Optional<Long> usedQuantity`

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

### Example

```java
package com.clearstreet.api.example;

import com.clearstreet.api.client.ClearStreetClient;
import com.clearstreet.api.client.okhttp.ClearStreetOkHttpClient;
import com.clearstreet.api.models.v1.locates.LocateGetLocateByIdParams;
import com.clearstreet.api.models.v1.locates.LocateGetLocateByIdResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        ClearStreetClient client = ClearStreetOkHttpClient.builder()
            .fromEnv()
            .apiKey("My API Key")
            .build();

        LocateGetLocateByIdParams params = LocateGetLocateByIdParams.builder()
            .accountId(0L)
            .id("id")
            .build();
        LocateGetLocateByIdResponse response = client.v1().locates().getLocateById(params);
    }
}
```

#### Response

```json
{
  "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
  }
}
```

## Domain Types

### Locate

- `class Locate:`

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

  - `long accountId`

    Account the locate is booked to.

  - `String clientRequestId`

    Caller-assigned id of the locate request.

  - `LocalDate effectiveDate`

    New York calendar date the locate is in force for.

  - `String instrumentId`

    Instrument id.

  - `String locateRequestId`

    Engine-assigned locate request id.

  - `long requestedQuantity`

    Number of shares requested.

  - `LocateStatus status`

    Presented status of the locate.

    - `REQUESTED("REQUESTED")`

    - `ACCEPTED("ACCEPTED")`

    - `REJECTED("REJECTED")`

    - `EXPIRED("EXPIRED")`

  - `Optional<String> locateId`

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

  - `Optional<Long> quantity`

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

  - `Optional<String> relatedOrderId`

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

  - `Optional<Long> reservedQuantity`

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

  - `Optional<Long> usedQuantity`

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

### Locate Rate

- `class LocateRate:`

  A locate borrow rate for an instrument.

  - `String instrumentId`

    Instrument id the rate applies to.

  - `String rate`

    Borrow rate, expressed as a decimal (e.g. 0.037012 for 3.7012%).

  - `Optional<LocalDateTime> asOf`

    When the rate was requested from the locates venue.

### Locate Rate Result

- `class LocateRateResult:`

  A requested instrument with either its cached borrow rate or an error.

  - `String instrument`

    The instrument id (UUID) or symbol, echoed exactly as requested, so each
    result maps back to its request.

  - `Optional<ApiError> error`

    Why no rate is present — a `404` when the instrument is unknown or has
    no cached rate. Omitted when `rate` is present.

    - `long code`

      The error code is used to identify the nature of the error. It corresponds
      to an HTTP status code.

    - `String message`

      A human-readable message providing more details about the error.

    - `Optional<List<Detail>> details`

      Additional error details, if any. This can include structured information
      such as field violations or error metadata.

  - `Optional<LocateRate> rate`

    The cached borrow rate. Present when a rate was found; omitted when
    `error` is present.

    - `String instrumentId`

      Instrument id the rate applies to.

    - `String rate`

      Borrow rate, expressed as a decimal (e.g. 0.037012 for 3.7012%).

    - `Optional<LocalDateTime> asOf`

      When the rate was requested from the locates venue.

### Locate Status

- `enum LocateStatus:`

  The presented status of a locate: the locate-request lifecycle plus
  `EXPIRED` for accepted locates whose effective date has passed.

  - `REQUESTED("REQUESTED")`

  - `ACCEPTED("ACCEPTED")`

  - `REJECTED("REJECTED")`

  - `EXPIRED("EXPIRED")`
