> ## Documentation Index
> Fetch the complete documentation index at: https://developers.redo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# warehouseLayoutUpdate

> Replace a warehouse's whole layout, as saving in the warehouse builder does. Redo names each rack's bins with the store's bin naming setting and places them at the rack, then in the background creates the bins the layout adds, retires the ones it drops, and recomputes pick distances and zones. A station that keeps its name keeps its settings, and a zone that keeps its id keeps its color. Run it with `dryRun` first to see the bins it would add and remove. Removing a bin that still holds stock is refused unless `clearRemovedBinInventory` is true. Returns null when the location isn't one of your locations. Errors: BAD_USER_INPUT for a layout that breaks a rule in the field descriptions, such as a rack off the grid, two racks or stations on one cell, a rack pickers can't reach, two racks naming the same bin, a bad bin pattern, or fewer than two racks; WAREHOUSE_LAYOUT_BIN_NAME_RESERVED (400) when a bin or station would take the name of one of the warehouse's system locations; WAREHOUSE_LAYOUT_STALE (409) when the layout was saved after `expectedUpdatedAt`; WAREHOUSE_LAYOUT_BINS_HAVE_INVENTORY (409) when bins it removes hold stock.

**Required scopes:** [`locations_write`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-locations_write)

**Store must have one of:** `WMS`

## Arguments

**clearRemovedBinInventory** `Boolean`

True moves the stock in bins the layout removes to the warehouse's Lost bin first, as the warehouse builder's clear and save does, writing each move to the inventory ledger and pushing the new availability to the store. Needs inventory\_write. Ignored on a dry run.

**Requires:** [`inventory_write`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-inventory_write)

**input** `[WarehouseLayoutUpdateInput!](/docs/api-reference/v3/reference/inventory/warehouse-layout-update-input)` *required*

The warehouse and its new layout.

**fields**

**dryRun** `Boolean`

True checks the layout and returns the bins it would add and remove, saving nothing.

**expectedUpdatedAt** `[DateTime](/docs/api-reference/v3/reference/common/date-time)`

The `updatedAt` of the layout you read. When the layout has been saved since, the update fails with WAREHOUSE\_LAYOUT\_STALE instead of overwriting that change. Omit only to replace whatever is there.

**layout** `[WarehouseLayoutInput!](/docs/api-reference/v3/reference/inventory/warehouse-layout-input)` *required*

The whole new layout. Anything left out is removed.

**fields**

**height** `Int`

The grid's height in cells, at most 500, and width x height at most 250000. Omit for one walkway row past the lowest one.

**pickEnd** `[WarehouseLayoutPointInput](/docs/api-reference/v3/reference/inventory/warehouse-layout-point-input)`

Where pick routes end, such as packing. A route finishes at the rack nearest this cell.

**pickStart** `[WarehouseLayoutPointInput](/docs/api-reference/v3/reference/inventory/warehouse-layout-point-input)`

Where pick routes start, such as the cart pickup. A route begins at the rack nearest this cell.

**racks** `[\[WarehouseLayoutRackInput!\]!](/docs/api-reference/v3/reference/inventory/warehouse-layout-rack-input)` *required*

The racks, at least 2 and at most 20000, each on its own cell.

**stations** `[\[WarehouseLayoutStationInput!\]](/docs/api-reference/v3/reference/inventory/warehouse-layout-station-input)`

The stations. A station missing from the list is removed.

**walls** `[\[WarehouseLayoutWallInput!\]](/docs/api-reference/v3/reference/inventory/warehouse-layout-wall-input)`

Walls pickers can't walk through.

**width** `Int`

The grid's width in cells, at most 500. Omit for one walkway column past the furthest rack, station or start or end point.

**zones** `[\[WarehouseLayoutZoneInput!\]](/docs/api-reference/v3/reference/inventory/warehouse-layout-zone-input)`

Pick zones in the order a tote visits them, at most 9. Give none to pick without zones.

**locationId** `ID!` *required*

The warehouse location. Find one with `locations`.

## Returns

**warehouseLayoutUpdate** `[WarehouseLayoutUpdateResult](/docs/api-reference/v3/reference/inventory/warehouse-layout-update-result)`

The outcome of `warehouseLayoutUpdate`: the layout, and how its bins change.

**fields**

**applied** `Boolean!` *required*

Whether the layout was saved. False for a dry run.

**binsAdded** `[String!]!` *required*

Bins and stations the layout names that the warehouse doesn't have yet. Saving creates them.

**binsRemoved** `[String!]!` *required*

Bins and stations from the map that the layout no longer names. Saving removes them.

**layout** `[WarehouseLayout!](/docs/api-reference/v3/reference/inventory/warehouse-layout)` *required*

The layout as saved, or for a dry run as it would be saved, with its grid size worked out.

**fields**

**height** `Int!` *required*

The grid's height in cells.

**location** `[Location!](/docs/api-reference/v3/reference/inventory/location)` *required*

The warehouse location the layout maps.

**fields**

**city** `String`

The city of the location's address.

**company** `String`

The company name associated with the location.

**countryCode** `String`

The country code, e.g. "US".

**createdAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the record was created.

**id** `ID!` *required*

The id of this location.

**inventoryItems** `[InventoryItemConnection!](/docs/api-reference/v3/pagination)` *required*

Traceable inventory units at this warehouse.

**Requires:** [`inventory_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-inventory_read)

**fields**

**Arguments**

**after** `String`

Forward pagination cursor — returns items after it. Pass an `edges[].cursor` or `pageInfo.endCursor` from a previous page.

**before** `String`

Backward pagination cursor — returns items before it. Pass an `edges[].cursor` or `pageInfo.startCursor` from a previous page.

**first** `Int`

Forward pagination: returns the first N items (max 100, default 25). Use with `after`; mutually exclusive with `last`/`before`.

**last** `Int`

Backward pagination: returns the last N items (max 100, default 25). Use with `before`; mutually exclusive with `first`/`after`.

**inventoryLevels** `[LocationInventoryLevelConnection!](/docs/api-reference/v3/pagination)` *required*

Per-product inventory levels held at this location.

**Requires:** [`inventory_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-inventory_read)

**fields**

**Arguments**

**after** `String`

Forward pagination cursor — returns items after it. Pass an `edges[].cursor` or `pageInfo.endCursor` from a previous page.

**before** `String`

Backward pagination cursor — returns items before it. Pass an `edges[].cursor` or `pageInfo.startCursor` from a previous page.

**first** `Int`

Forward pagination: returns the first N items (max 100, default 25). Use with `after`; mutually exclusive with `last`/`before`.

**last** `Int`

Backward pagination: returns the last N items (max 100, default 25). Use with `before`; mutually exclusive with `first`/`after`.

**name** `String!` *required*

The location's display name.

**phone** `String`

The contact phone number for the location.

**postalCode** `String`

The postal or ZIP code, e.g. "84101".

**stateCode** `String`

The state or province code, e.g. "UT".

**storageLocations** `[StorageLocationConnection!](/docs/api-reference/v3/pagination)` *required*

Bins and other storage locations within this warehouse.

**Requires:** [`locations_read`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-locations_read)

**fields**

**Arguments**

**after** `String`

Forward pagination cursor — returns items after it. Pass an `edges[].cursor` or `pageInfo.endCursor` from a previous page.

**before** `String`

Backward pagination cursor — returns items before it. Pass an `edges[].cursor` or `pageInfo.startCursor` from a previous page.

**first** `Int`

Forward pagination: returns the first N items (max 100, default 25). Use with `after`; mutually exclusive with `last`/`before`.

**last** `Int`

Backward pagination: returns the last N items (max 100, default 25). Use with `before`; mutually exclusive with `first`/`after`.

**street1** `String`

The first line of the street address.

**street2** `String`

The second line of the street address.

**updatedAt** `[DateTime!](/docs/api-reference/v3/reference/common/date-time)` *required*

When the record was last updated.

**pickEnd** `[WarehouseLayoutPoint](/docs/api-reference/v3/reference/inventory/warehouse-layout-point)`

Where pick routes end, usually by packing; a route finishes at the rack nearest this cell. Null finishes at the last bin picked.

**fields**

**x** `Int!` *required*

The column, from 0 at the left.

**y** `Int!` *required*

The row, from 0 at the top.

**pickStart** `[WarehouseLayoutPoint](/docs/api-reference/v3/reference/inventory/warehouse-layout-point)`

Where pick routes start, usually by the cart or tote pickup; a route begins at the rack nearest this cell. Null begins at the first rack in the layout.

**fields**

**x** `Int!` *required*

The column, from 0 at the left.

**y** `Int!` *required*

The row, from 0 at the top.

**racks** `[\[WarehouseLayoutRack!\]!](/docs/api-reference/v3/reference/inventory/warehouse-layout-rack)` *required*

The racks, each on its own cell.

**fields**

**accessibleSides** `[\[WarehouseLayoutSide!\]!](/docs/api-reference/v3/reference/inventory/warehouse-layout-side)` *required*

The sides a picker stands on to reach the rack. Each must face a walkway cell.

**binTemplates** `[\[WarehouseLayoutBinTemplate!\]!](/docs/api-reference/v3/reference/inventory/warehouse-layout-bin-template)` *required*

Patterns that name the rack's bins in place of `levels` and `positions`. Empty uses `levels` and `positions`.

**customBins** `[\[WarehouseLayoutCustomBin!\]!](/docs/api-reference/v3/reference/inventory/warehouse-layout-custom-bin)` *required*

Bins with names of their own, added to the others.

**levelStorageTypes** `[\[WarehouseLayoutLevelStorageType!\]!](/docs/api-reference/v3/reference/inventory/warehouse-layout-level-storage-type)` *required*

Storage types by level, for bins named from `levels` and `positions` or a single untyped template.

**levels** `Int!` *required*

The number of shelves or levels, counted from 1 at the bottom.

**name** `String`

The RACK part of its bin names, often its number within the row. Null names it `R<x>-<y>`.

**naming** `[WarehouseLayoutRackNaming](/docs/api-reference/v3/reference/inventory/warehouse-layout-rack-naming)`

How this rack builds bin names instead of the store's setting. Null uses the store's setting.

**overhead** `Boolean!` *required*

Whether the rack is overhead storage that pickers can walk underneath, so its cell stays walkable.

**positions** `[String!]!` *required*

The position labels on a level, left to right, such as 1, 2, 3 or A, B. Each level repeats them unless `naming.positionMode` spreads them.

**priority** `[StorageLocationPriority!](/docs/api-reference/v3/reference/inventory/storage-location-priority)` *required*

SECONDARY makes every bin in the rack a secondary pick location, picked after primary bins.

**row** `String`

The ROW part of its bin names, usually the aisle or row letter. Racks with the same row are picked as one run when the store routes pickers row by row.

**sellable** `Boolean!` *required*

Whether stock in the rack's bins can be sold and picked for orders.

**storageType** `[StorageLocationType](/docs/api-reference/v3/reference/inventory/storage-location-type)`

Makes every bin in the rack this type. Null types them by level, template or custom bin, BIN by default.

**x** `Int!` *required*

The rack's column.

**y** `Int!` *required*

The rack's row on the grid.

**stations** `[\[WarehouseLayoutStation!\]!](/docs/api-reference/v3/reference/inventory/warehouse-layout-station)` *required*

The stations, each on its own cell.

**fields**

**name** `String!` *required*

The station's name, unique in the warehouse.

**x** `Int!` *required*

The station's column.

**y** `Int!` *required*

The station's row.

**updatedAt** `[DateTime](/docs/api-reference/v3/reference/common/date-time)`

When the layout was last saved. Pass it as `expectedUpdatedAt` to `warehouseLayoutUpdate`. Null in a dry run's preview, which isn't saved.

**walls** `[\[WarehouseLayoutWall!\]!](/docs/api-reference/v3/reference/inventory/warehouse-layout-wall)` *required*

The walls.

**fields**

**from** `[WarehouseLayoutPoint!](/docs/api-reference/v3/reference/inventory/warehouse-layout-point)` *required*

One end of the wall, a grid line crossing.

**to** `[WarehouseLayoutPoint!](/docs/api-reference/v3/reference/inventory/warehouse-layout-point)` *required*

The other end, in the same row or column as `from`.

**width** `Int!` *required*

The grid's width in cells.

**zones** `[\[WarehouseLayoutZone!\]!](/docs/api-reference/v3/reference/inventory/warehouse-layout-zone)` *required*

The pick zones in the order a tote visits them. Empty when the warehouse doesn't pick by zone.

**fields**

**binPatterns** `[\[WarehouseLayoutZoneBinPattern!\]!](/docs/api-reference/v3/reference/inventory/warehouse-layout-zone-bin-pattern)` *required*

Bin name patterns that also put bins in the zone.

**default** `Boolean!` *required*

Whether this is the default zone, which holds every bin no other zone claims.

**id** `String!` *required*

The zone's id, unique in the layout. Keep it when you change the zone.

**name** `String!` *required*

The zone's name.

**rectangles** `[\[WarehouseLayoutZoneRectangle!\]!](/docs/api-reference/v3/reference/inventory/warehouse-layout-zone-rectangle)` *required*

The cells the zone covers. Zones don't overlap. Empty for the default zone.

**removedBinsWithInventory** `[\[WarehouseLayoutRemovedBin!\]!](/docs/api-reference/v3/reference/inventory/warehouse-layout-removed-bin)` *required*

The removed bins that still hold stock. The update is refused while there are any, unless `clearRemovedBinInventory` is true.

**fields**

**name** `String!` *required*

The bin's name.

**quantity** `Int!` *required*

The units in the bin.

**reservedQuantity** `Int!` *required*

The units open picks have reserved from the bin.

## Example

```graphql theme={null}
mutation {
  warehouseLayoutUpdate(clearRemovedBinInventory: true, input: { ... }) {
    applied
    binsAdded
    binsRemoved
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.