# Warehouse type


A warehouse. Requires the `warehouse.read` permission.

## Fields

### id

[`UUID!`](/chameleoon-max/type/uuid)

The warehouse's MAX id.

### code

`String!`

The warehouse's code in MAX.

### name

`String!`

The warehouse's name.

### street

`String`

The street and number. Null when not given.

### city

`String`

The city. Null when not given.

### postalCode

`String`

The postal code. Null when not given.

### countryCode

`String`

The country, as an ISO 3166-1 alpha-2 code. Null when not given.

### isDefault

`Boolean!`

Whether this is the organisation's default warehouse, where a document that names none goes.

### usesLocations

`Boolean!`

Whether stock here is kept by bin (location).

- When `true`, every stock write names a bin. [`syncStockLevels`](/chameleoon-max/mutation/sync-stock-levels) refuses an item
  without a `locationCode` here with `LOCATION_REQUIRED`.
- When `false`, every entry lands on the warehouse's default bin.

### stockMasterSource

[`ExternalSource`](/chameleoon-max/type/external-source)

The external system that manages this warehouse's stock. Null while MAX manages it.

- A user sets it on the warehouse in MAX. [`syncStockLevels`](/chameleoon-max/mutation/sync-stock-levels) writes the stock.
- [`syncStockLevels`](/chameleoon-max/mutation/sync-stock-levels) from any other external source is refused
  (`STOCK_NOT_MASTERED`).
- Requires the `integration.read` permission besides `warehouse.read`. Without it, the field is
  null with a `FORBIDDEN_ROLE` error at its path, and the rest of the warehouse is returned.

### archivedAt

[`Time`](/chameleoon-max/type/time)

When the warehouse was archived. Null while it is in use.

## Used by

- [`Fulfilment`](/chameleoon-max/type/fulfilment)
- [`Issue`](/chameleoon-max/type/issue)
- [`Receipt`](/chameleoon-max/type/receipt)
- [`ReceiptAdvice`](/chameleoon-max/type/receipt-advice)
- [`SalesOrder`](/chameleoon-max/type/sales-order)
- [`StockCard`](/chameleoon-max/type/stock-card)
- [`StockCardChange`](/chameleoon-max/type/stock-card-change)
- [`Transfer`](/chameleoon-max/type/transfer)
- [`WarehouseConnection`](/chameleoon-max/type/warehouse-connection)
- [`WarehouseEdge`](/chameleoon-max/type/warehouse-edge)
