locations

Fetch locations matching the supplied arguments.

Arguments

ArgumentTypeRequiredDefaultDescription
ids[String]No

List of ids of locations to include in the query.

warehouse_idStringNo

Filter by public API warehouse ID. Use this ID field when selecting a warehouse; warehouse fields are display values or nested objects.

skuStringNo

Filter by SKU. SKU matching is case-insensitive and ignores surrounding whitespace.

nameStringNo

Filter by location name. Matching is case-insensitive. Unlike the singular location query, this query applies no zone or warehouse scoping.

pickableBooleanNo

When true, filters results where pickable applies; when false, filters where it does not.

sellableBooleanNo

When true, filters results where sellable applies; when false, filters where it does not.

location_type_idStringNo

Filter by location type ID; pass the public API ID unless the field name says legacy ID.

analyzeBooleanNo

If true, the query will only be analyzed (cost estimated) without executing it.

Return Type

LocationsQueryResult

Query

query locations(
  $ids: [String],
  $warehouse_id: String,
  $sku: String,
  $name: String,
  $pickable: Boolean,
  $sellable: Boolean,
  $location_type_id: String,
  $analyze: Boolean
) {
  locations(
    ids: $ids,
    warehouse_id: $warehouse_id,
    sku: $sku,
    name: $name,
    pickable: $pickable,
    sellable: $sellable,
    location_type_id: $location_type_id,
    analyze: $analyze
  ) {
    request_id
    complexity
    data {
      ...LocationConnectionFragment
    }
  }
}

Variables

{
  "ids": ["TG9jYXRpb246MTIzNA==", "TG9jYXRpb246NTY3OA=="],
  "warehouse_id": "V2FyZWhvdXNlOjEyMzQ=",
  "sku": "BLUE-TEE-M",
  "name": "A01-01-01",
  "pickable": true,
  "sellable": true,
  "location_type_id": "TG9jYXRpb25UeXBlOjEyMzQ=",
  "analyze": true
}

Response

{
  "data": {
    "locations": {
      "request_id": "UmVjb3JkOjEyMzQ=",
      "complexity": 100,
      "data": [{id: "TG9jYXRpb246MTIzNA==", name: "A01-01-01"}]
    }
  }
}