Stock

Contracts

StockRepositoryContract

The StockRepositoryContract is the interface for the stock repository. This interface allows you to find, create and update stock. Stock is assigned to one variation and is stored in warehouses.

Namespace

Plenty\Modules\StockManagement\Stock\Contracts

Methods

public listStockByWarehouseId(int $warehouseId, array $columns = [], int $page = 1, int $itemsPerPage = 50):PaginatedResult

List stock of a warehouse

Parameters
int $warehouseId The ID of the warehouse
array $columns The properties to be loaded
int $page The requested page
int $itemsPerPage The number of items per page
public listStock(array $columns = [], int $page = 1, int $itemsPerPage = 50):PaginatedResult

List stock

Parameters
array $columns The properties to be loaded
int $page The requested page
int $itemsPerPage The number of items per page
public listStockByWarehouseType(string $type, array $columns = [], int $page = 1, int $itemsPerPage = 50):PaginatedResult

List stock by warehouse type

Parameters
string $type The type of the warehouse. Currently only 'sales' is supported.
array $columns The properties to be loaded
int $page The requested page
int $itemsPerPage The number of items per page
public correctStock(int $warehouseId, array $data):void

Corrects stock. The ID of the warehouse has to be provided.

Parameters
int $warehouseId The ID of the warehouse.
array $data The request data.
public bookIncomingItems(int $warehouseId, array $data):void

Book incoming stock

Parameters
int $warehouseId The ID of the warehouse
array $data The request date
public redistributeStock(array $data):void

Redistribute stock

Parameters
array $data The request data
public listStockMovements(int $warehouseId, array $columns = [], int $page = 1, int $itemsPerPage = 50):PaginatedResult

List stock movements

Parameters
int $warehouseId The ID of the warehouse
array $columns The properties to be loaded
int $page The requested page
int $itemsPerPage The number of items per page
public clearCriteria():void

Resets all Criteria filters by creating a new instance of the builder object.

public applyCriteriaFromFilters():void

Applies criteria classes to the current repository.

public setFilters(array $filters = []):void

Sets the filter array.

Parameters
array $filters
public getFilters():void

Returns the filter array.

public getConditions():void

Returns a collection of parsed filters as Condition object

public clearFilters():void

Clears the filter array.

StockStorageLocationRepositoryContract

The StockStorageLocationRepositoryContract is the interface for the stock storage location repository. This interface allows you to list the stock of all storage locations of a warehouse or to list all storage locations of a variation and the stock stored at these locations.

Namespace

Plenty\Modules\StockManagement\Stock\Contracts

Methods

public listStockStorageLocationsByWarehouseId(int $warehouseId, array $columns = [], int $page = 1, int $itemsPerPage = 50, array $with = []):PaginatedResult

List stock of all storage locations of a warehouse

Parameters
int $warehouseId The ID of the warehouse
array $columns The properties to be loaded
int $page The requested page
int $itemsPerPage The number of items per page
array $with The relations to load in the StockStorageLocationInstance, possible is: storageLocation
public listStockStorageLocationsByVariationId(int $variationId, array $columns = [], int $page = 1, int $itemsPerPage = 50, array $with = []):PaginatedResult

List stock of a variation per storage location

Parameters
int $variationId The ID of the variation.
array $columns The properties to be loaded
int $page The requested page
int $itemsPerPage The number of items per page
array $with The relations to load in the StockStorageLocationInstance, possible is: storageLocation
public clearCriteria():void

Resets all Criteria filters by creating a new instance of the builder object.

public applyCriteriaFromFilters():void

Applies criteria classes to the current repository.

public setFilters(array $filters = []):void

Sets the filter array.

Parameters
array $filters
public getFilters():void

Returns the filter array.

public getConditions():void

Returns a collection of parsed filters as Condition object

public clearFilters():void

Clears the filter array.

Models

Stock

The stock model. There are 4 different stock terms used in plentymarkets. The physical stock, the net stock, the reserved stock and the stock reserved for listings.

Namespace

Plenty\Modules\StockManagement\Stock\Models

Properties

Type Name Description
int itemId The ID of the item
int variationId The ID of the variation
int warehouseId The ID of the warehouse
float stockPhysical The physical stock
float reservedStock The reserved stock
float reservedEbay The stock reserved for ebay
float reorderDelta The reorder delta
float stockNet The net stock
int reordered The reordered quantity of a variation
float reservedBundle Reserved bundle
float averagePurchasePrice The average purchase price
updatedAt The time the stock was last updated

Methods

public toArray()

Returns this model as an array.

StockStorageLocation

The stock storage location model contains all information about the stock that is stored at one storage location.

Namespace

Plenty\Modules\StockManagement\Stock\Models

Properties

Type Name Description
int itemId The ID of the item
int variationId The ID of the variation
int storageLocationId The ID of the storage location.
int warehouseId The ID of the warehouse that the storage location is in
float quantity The quantity stored at the storage location
updatedAt The day and time the stock was last updated
StorageLocation storageLocation Deprecated! Use warehouseLocation instead
WarehouseLocation warehouseLocation The warehouse location of the item
Variation variation The variation of the item

Methods

public toArray()

Returns this model as an array.

Warehouse

Contracts

WarehouseRepositoryContract

The WarehouseRepositoryContract is the interface for the warehouse repository. This interface allows you to either get one warehouse by specifying the id or to list all warehouses.

Namespace

Plenty\Modules\StockManagement\Warehouse\Contracts

Methods

public findById(int $warehouseId, array $with = []):Warehouse

Get a warehouse

Parameters
int $warehouseId The id of the warehouse.
array $with The relations to load in the warehouse instance. repairWarehouse is the only relation currently available.
public all(array $with = [], array $columns = []):array

List warehouses

Parameters
array $with The relations to load in the warehouse instance. repairWarehouse is the only relation currently available.
array $columns The columns to load in the response
public create(array $data):Warehouse

Create a warehouse

Parameters
array $data The request data.

Models

Warehouse

The warehouse model in plentymarkets represents actual warehouses. Every warehouse is identified by an Id. Furthermore a warehouse is described by a name and is always associated with an address. This address may not only contain a physical address information like a street, a house number, a postal code and a town, but also an email address, a telephone number or a fax number.

Namespace

Plenty\Modules\StockManagement\Warehouse\Models

Properties

Type Name Description
int id The id of the warehouse
string name The name of the warehouse
string note A note for this warehouse
int typeId The id of the warehouse type. The following types are available:
  • 0 = Sales warehouse
  • 1 = Repair warehouse
  • 4 = Storage warehouse
  • 5 = Transit warehouse
  • 6 = Distribution warehouse
  • 7 = Other
int onStockAvailability Displayed availability of a variation if stock is available
int outOfStockAvailability Displayed availability of a variation if no stock is available
bool splitByShippingProfile Flag that indicates if for this warehouse orders are split by shipping profiles or not.
  • True = Orders are split by shipping profiles
  • False = Orders will not be split by shipping profiles
string storageLocationType The storage location type. The following types are available:
  • none
  • small
  • medium
  • large
  • europallet
int storageLocationZone The zone that the storage location is in
int repairWarehouseId The id of the associated repair warehouse
bool isInventoryModeActive Flag that indicates if the inventory mode for this warehouse is active or not.
  • True = active
  • False = inactive
string logisticsType The id of the logistics type of the warehouse. The logistics type states which service provider fulfills the storage and shipping. The following logistics types are available:
  • own
  • amazon
  • dhlFulfillment
Address address The address that the warehouse is located at
Warehouse repairWarehouse All information about the repair warehouse if a repair warehouse is linked to the sales warehouse

Methods

public toArray()

Returns this model as an array.

Management

Contracts

RackManagementRepositoryContract

The RackManagementRepositoryContract is the interface for the rack management repository. This interface provides the functionality to manage the warehouse configuration for racks. Racks can be retrieved, created or updated here.

Deprecated! (since 2018-03)

Please use Plenty\Modules\Warehouse\Contracts\WarehouseLocationDimensionRepositoryContract instead

Namespace

Plenty\Modules\StockManagement\Warehouse\Management\Contracts

Methods

public getRackById(int $rackId, array $columns = [], array $with = []):Rack

Find a rack by id.

Parameters
int $rackId The id of the rack.
array $columns The attributes to be loaded.
array $with The relations to be loaded. Possible values are 'warehouse', 'shelves' and 'storageLocations'.
public findRacks(int $page = 1, int $itemsPerPage = 50, array $columns = [], array $with = []):PaginatedResult

Find racks. The results can be filtered by warehouse id.

Parameters
int $page The requested page.
int $itemsPerPage Number of items per page.
array $columns The attributes to be loaded.
array $with The relations to be loaded. Possible values are 'warehouse', 'shelves' and 'storageLocations'.
public createRack(array $data, int $warehouseId):Rack

Create a new rack.

Parameters
array $data The data to create a new rack.
int $warehouseId The id of the warehouse the rack shall belong to.
public clearCriteria():void

Resets all Criteria filters by creating a new instance of the builder object.

public applyCriteriaFromFilters():void

Applies criteria classes to the current repository.

public setFilters(array $filters = []):void

Sets the filter array.

Parameters
array $filters
public getFilters():void

Returns the filter array.

public getConditions():void

Returns a collection of parsed filters as Condition object

public clearFilters():void

Clears the filter array.

ShelfManagementRepositoryContract

The ShelfManagementRepositoryContract is the interface for the shelf management repository. This interface provides the functionality to manage the warehouse configuration for shelves. Shelves can be retrieved, created or updated here.

Deprecated! (since 2018-03)

Please use Plenty\Modules\Warehouse\Contracts\WarehouseLocationDimensionRepositoryContract instead

Namespace

Plenty\Modules\StockManagement\Warehouse\Management\Contracts

Methods

public getShelfById(int $shelfId, array $columns = [], array $with = []):Shelf

Find a shelf by id.

Parameters
int $shelfId The id of the shelf.
array $columns The attributes to be loaded.
array $with The relations to be loaded. Possible values are 'warehouse', 'rack' and 'storageLocations'.
public findShelves(int $page = 1, int $itemsPerPage = 50, array $columns = [], array $with = []):PaginatedResult

Find shelves. The results can be filtered by warehouse id and rack id.

Parameters
int $page The requested page.
int $itemsPerPage Number of items per page.
array $columns The attributes to be loaded.
array $with The relations to be loaded. Possible values are 'warehouse', 'rack' and 'storageLocations'.
public createShelf(array $data, int $warehouseId, int $rackId):Shelf

Create a new shelf.

Parameters
array $data The data to create a new shelf.
int $warehouseId The id of the warehouse the shelf shall belong to.
int $rackId The id of the rack the shelf shall belong to.
public clearCriteria():void

Resets all Criteria filters by creating a new instance of the builder object.

public applyCriteriaFromFilters():void

Applies criteria classes to the current repository.

public setFilters(array $filters = []):void

Sets the filter array.

Parameters
array $filters
public getFilters():void

Returns the filter array.

public getConditions():void

Returns a collection of parsed filters as Condition object

public clearFilters():void

Clears the filter array.

StorageLocationManagementRepositoryContract

The StorageLocationManagementRepositoryContract is the interface for the storage location management repository. This interface provides the functionality to manage the warehouse configuration for storage locations. Storage locations can be retrieved, created or updated here.

Deprecated! (since 2018-03)

Please use Plenty\Modules\Warehouse\Contracts\WarehouseLocationRepositoryContract instead

Namespace

Plenty\Modules\StockManagement\Warehouse\Management\Contracts

Methods

public getStorageLocationById(int $storageLocationId, array $columns = [], array $with = []):StorageLocation

Find a storage location by id.

Parameters
int $storageLocationId The id of the storage location.
array $columns The attributes to be loaded.
array $with The relations to be loaded. Possible values are 'warehouse', 'rack' and 'shelf'.
public findStorageLocations(int $page = 1, int $itemsPerPage = 50, array $columns = [], array $with = []):PaginatedResult

Find storage locations. The results can be filtered by warehouse id, rack id and shelf id.

Parameters
int $page The requested page.
int $itemsPerPage Number of items per page.
array $columns The attributes to be loaded.
array $with The relations to be loaded. Possible values are 'warehouse', 'rack' and 'shelf'.
public createStorageLocation(array $data, int $warehouseId, int $rackId, int $shelfId):StorageLocation

Create a new storage location.

Parameters
array $data The data to create a new storage location.
int $warehouseId The id of the warehouse the storage location shall belong to.
int $rackId The id of the rack the storage location shall belong to.
int $shelfId The id of the shelf the storage location shall belong to.
public clearCriteria():void

Resets all Criteria filters by creating a new instance of the builder object.

public applyCriteriaFromFilters():void

Applies criteria classes to the current repository.

public setFilters(array $filters = []):void

Sets the filter array.

Parameters
array $filters
public getFilters():void

Returns the filter array.

public getConditions():void

Returns a collection of parsed filters as Condition object

public clearFilters():void

Clears the filter array.

Models

Rack

The storage rack model

Namespace

Plenty\Modules\StockManagement\Warehouse\Management\Models

Properties

Type Name Description
int id The id of the rack.
int name The name of the rack.
int position The position of the rack.
int warehouseId The id of the warehouse the rack belongs to.
int zone The zone of the rack. Numbers between 1 and 20 are valid.
Warehouse warehouse The warehouse this rack belongs to.
shelves The shelves that belong to this rack.
storageLocations The storage locations that belong to this rack.

Methods

public toArray()

Returns this model as an array.

Shelf

The storage shelf model

Namespace

Plenty\Modules\StockManagement\Warehouse\Management\Models

Properties

Type Name Description
int id The id of the shelf.
int rackId The id of the rack the shelf belongs to.
string name The name of the shelf.
int level The level of the shelf. Numbers between 1 and 25 are valid.
Rack rack The rack this shelf belongs to.
storageLocations The storage locations of this shelf.

Methods

public toArray()

Returns this model as an array.

StorageLocation

The storage location model

Namespace

Plenty\Modules\StockManagement\Warehouse\Management\Models

Properties

Type Name Description
int id The id of the storage location.
int warehouseId The id of the warehouse the storage location belongs to.
int rackId The id of the rack the storage location belongs to.
int shelfId The id of the shelf the storage location belongs to.
string name The name of the storage location.
int type The type of the storage location. Valid strings are: 'small', 'medium', 'large', 'europallet'.
int position The position of the storage location.
Warehouse warehouse The warehouse this storage location belongs to.
Rack rack The rack this storage location belongs to.
Shelf shelf The shelf this storage location belongs to.

Methods

public toArray()

Returns this model as an array.