# Warehouses

`GET /inventory/warehouses`

Group: Inventory › Warehouses · Operation ID: `warehouses`

Returns a list of warehouses. To filter by name, city, country or region, use POST inventory/warehouses/search.

This collection returns the same fields as GET inventory/warehouses/:id and POST inventory/warehouses/search. The site name and the address fields are returned but cannot be filtered or ordered here. Filter name, city, countryCode and region through POST inventory/warehouses/search instead. locationCode, entityId, warehouseTypeId, inventoryLocationType, isActive, isPrimaryReceiving, id and lastModifiedDate can be filtered here.

[Open in the interactive reference](https://docs.api.lensing.ai/?op=warehouses)

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Api-Version` | header | `"v1"` | yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version `v1`. |

## Query surface

- `id` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `locationCode` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `inventoryLocationType` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `isActive` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `isPrimaryReceiving` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `entityId` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `warehouseTypeId` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `lastModifiedDate` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- Orderable: id, locationCode, entityId, warehouseTypeId, inventoryLocationType, isActive, isPrimaryReceiving, lastModifiedDate
- Selectable: id, locationCode, name, inventoryLocationType, isActive, isPrimaryReceiving, addressLine1, addressLine2, city, stateProvince, postalCode, countryCode, region, entityId, entityName, warehouseTypeId, warehouseTypeName, lastModifiedDate

## Response

`200` Success

Under `data`, an array of warehousesRow:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | no | The unique identifier for the warehouse. |
| `locationCode` | string | no | The location code of the warehouse, for example 'WH-01'. It is unique within the tenant. |
| `name` | string | no | The site name of the warehouse, for example 'Rotterdam Distribution Center'. |
| `inventoryLocationType` | string | no | The kind of location. |
| `isActive` | boolean | no | Whether the warehouse can be selected on new inventory documents. When false, existing stock and history keep pointing at it and new documents cannot select it. |
| `isPrimaryReceiving` | boolean or null | no | Whether this is the entity's primary receiving warehouse. Open purchase-order on-order quantity for the entity is attributed here for replenishment. At most one warehouse per entity is the primary receiving warehouse. |
| `addressLine1` | string or null | no | The first address line: street number and name, or PO box. Absent when unset. |
| `addressLine2` | string or null | no | The second address line: apartment, suite, unit, building or floor. Absent when unset. |
| `city` | string or null | no | The city or locality. Absent when unset. |
| `stateProvince` | string or null | no | The state, province or region. Absent when unset. |
| `postalCode` | string or null | no | The postal or ZIP code. Absent when unset. |
| `countryCode` | string or null | no | The country of the address. Format ISO 3166-1 alpha-2, for example 'NL'. Absent when unset. |
| `region` | string or null | no | A free-text business region grouping, independent of country and state. Absent when unset. |
| `entityId` | string or null | no | The unique identifier for the legal entity that owns this warehouse. See id on GET base/entities. |
| `entityName` | string or null | no | The name of the legal entity that owns this warehouse. |
| `warehouseTypeId` | string or null | no | The unique identifier for the warehouse type, which limits the document types the warehouse allows. Absent when the warehouse allows every type. There is no endpoint for it. |
| `warehouseTypeName` | string or null | no | The name of the warehouse type. Absent when the warehouse allows every document type. |
| `lastModifiedDate` | string (date-time) or null | no | The date and time the warehouse record last changed, in UTC. Format YYYY-MM-DDTHH:mm:ss.sssZ. |

## Statuses

- `400` — Invalid request or business failure
- `401` — Missing or invalid access token
- `403` — Not authorized
- `404` — Not found
- `429` — Too many requests
- `500` — Internal server error
