Last updated: Oct 24 2016

Area: Episerver Commerce Applies to versions: 10 and higher
Other versions:

Warehouses and inventories examples

This topic provides examples of how to use the Episerver Commerce Framework API to work with warehouses and inventory features. The following examples show how to get, save, and delete warehouses and inventories.

Listing warehouses

Use IWarehouseRepository.List() to list information for all warehouses.

Getting a warehouse

Use IWarehouseRepository.Get() to get a single warehouse. You can get a warehouse by Id or by Code.

Saving a warehouse

Use IWarehouseRepository.Save(IWarehouse) to add/edit and save a warehouse.

Note: The IWarehouse object returned from Get and List methods above IWarehouseRepository is read-only. So, to edit it, you must make a writable clone object then update it, as s.

Deleting a warehouse

Use IWarehouseRepository.Delete(int) to delete a warehouse.

Working with inventory records

Note: The InventoryRecord object returned from List, Get and Query methods of InventoryService is read-only. So, to edit it, you have to make a writable clone object then update on it.

inventoryRecord = inventoryRecord.CreateWritableClone();


It would be nice to mention that updating the item requires a writable clone like in other models, this wasn't obvious for inventory

Hi Scott,

Thanks for bring it up, yes, the Warehouse/Inventory object returned by List/Get methods is read-only, the documentation has been updated.