Plentymarkets interface documentation

Stock

Contracts

ItemVariationWarehouseDynamicRepositoryContract

The ItemVariationWarehouseDynamicRepositoryContract 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 findAvgOrderByVariationId($variationId):void
Parameters

Name

Type

Description

$variationId

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($warehouseId, $columns = [], $page = 1, $itemsPerPage = 50):Plenty\Repositories\Models\PaginatedResult
Return type: PaginatedResult

List stock of a warehouse

Parameters

Name

Type

Description

$warehouseId

int

The ID of the warehouse

$columns

array

The properties to be loaded

$page

int

The requested page

$itemsPerPage

int

The number of items per page

public listStock($columns = [], $page = 1, $itemsPerPage = 50):Plenty\Repositories\Models\PaginatedResult
Return type: PaginatedResult

List stock

Parameters

Name

Type

Description

$columns

array

The properties to be loaded

$page

int

The requested page

$itemsPerPage

int

The number of items per page

public listStockByWarehouseType($type, $columns = [], $page = 1, $itemsPerPage = 50):Plenty\Repositories\Models\PaginatedResult
Return type: PaginatedResult

List stock by warehouse type

Parameters

Name

Type

Description

$type

string

The type of the warehouse. Currently only 'sales' is supported.

$columns

array

The properties to be loaded

$page

int

The requested page

$itemsPerPage

int

The number of items per page

public correctStock($warehouseId, $data):void

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

Parameters

Name

Type

Description

$warehouseId

int

The ID of the warehouse.

$data

array

The request data.

public bookIncomingItems($warehouseId, $data):void

Book incoming stock

Parameters

Name

Type

Description

$warehouseId

int

The ID of the warehouse

$data

array

The request data

public bookOutgoingItems($warehouseId, $data):void

Book outgoing stock

Parameters

Name

Type

Description

$warehouseId

int

The ID of the warehouse

$data

array

The request data

public redistributeStock($data):void

Redistribute stock

Parameters

Name

Type

Description

$data

array

The request data

public listStockMovements($warehouseId, $columns = [], $page = 1, $itemsPerPage = 50):Plenty\Repositories\Models\PaginatedResult
Return type: PaginatedResult

List stock movements

Parameters

Name

Type

Description

$warehouseId

int

The ID of the warehouse

$columns

array

The properties to be loaded

$page

int

The requested page

$itemsPerPage

int

The number of items per page

public unpackVariation($warehouseId, $variationStockIntake, $variationStockCorrection):Plenty\Modules\StockManagement\Warehouse\Models\Warehouse
Return type: Warehouse

Unpack variation

Parameters

Name

Type

Description

$warehouseId

int

The ID of the warehouse

$variationStockIntake

array

$variationStockCorrection

array

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($filters = []):void

Sets the filter array.

Parameters

Name

Type

Description

$filters

array

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($warehouseId, $columns = [], $page = 1, $itemsPerPage = 50, $with = []):Plenty\Repositories\Models\PaginatedResult
Return type: PaginatedResult

List stock of all storage locations of a warehouse

Parameters

Name

Type

Description

$warehouseId

int

The ID of the warehouse

$columns

array

The properties to be loaded

$page

int

The requested page

$itemsPerPage

int

The number of items per page

$with

array

The relations to load in the StockStorageLocationInstance, possible is: storageLocation

public listStockStorageLocationsByVariationId($variationId, $columns = [], $page = 1, $itemsPerPage = 50, $with = [], $sortBy = "id", $sortOrder = "asc"):Plenty\Repositories\Models\PaginatedResult
Return type: PaginatedResult

List stock of a variation per storage location

Parameters

Name

Type

Description

$variationId

int

The ID of the variation.

$columns

array

The properties to be loaded

$page

int

The requested page

$itemsPerPage

int

The number of items per page

$with

array

The relations to load in the StockStorageLocationInstance, possible is: storageLocation

$sortBy

string

$sortOrder

string

public listStockStorageLocationsByWarehouseIdPim($warehouseId, $columns = [], $page = 1, $itemsPerPage = 50, $with = []):Plenty\Repositories\Models\PaginatedResult
Return type: PaginatedResult

List stock of all storage locations of a warehouse with pim entry

Parameters

Name

Type

Description

$warehouseId

int

The ID of the warehouse

$columns

array

The properties to be loaded

$page

int

The requested page

$itemsPerPage

int

The number of items per page

$with

array

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($filters = []):void

Sets the filter array.

Parameters

Name

Type

Description

$filters

array

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

ItemVariationWarehouseDynamic

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
Name Type Description

itemId

int

The ID of the item

variationId

int

The ID of the variation

warehouseId

int

The ID of the warehouse

stockPhysical

float

The physical stock

reservedStock

float

The reserved stock

reservedEbay

float

The stock reserved for ebay

reorderDelta

float

The reorder delta

stockNet

float

The net stock

reordered

int

The reordered quantity of a variation

warehousePriority

int

The priority of the warehouse

reservedBundle

float

Reserved bundle

averagePurchasePrice

float

The average purchase price

averageSale

float

The averageSale price

updatedAt

The time the stock was last updated

Methods
public toArray()

Returns this model as an array.

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
Name Type Description

itemId

int

The ID of the item

variationId

int

The ID of the variation

warehouseId

int

The ID of the warehouse

stockPhysical

float

The physical stock

reservedStock

float

The reserved stock

reservedEbay

float

The stock reserved for ebay

reorderDelta

float

The reorder delta

stockNet

float

The net stock

reordered

int

The reordered quantity of a variation

warehousePriority

int

The priority of the warehouse

reservedBundle

float

Reserved bundle

averagePurchasePrice

float

The average purchase price

averageSale

float

The average sale

updatedAt

The time the stock was last updated

Methods
public toArray()

Returns this model as an array.

StockBatchBestBeforeDate

The stock batch best before date model contains all information about the batch and best before date.

Namespace

Plenty\Modules\StockManagement\Stock\Models

Properties
Name Type Description

batch

string

bestBeforeDate

string

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
Name Type Description

itemId

int

The ID of the item

variationId

int

The ID of the variation

storageLocationId

int

The ID of the storage location.

warehouseId

int

The ID of the warehouse that the storage location is in

quantity

float

The quantity stored at the storage location

bestBeforeDate

string

The best before date

batch

string

The batch

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($warehouseId, $with = []):Plenty\Modules\StockManagement\Warehouse\Models\Warehouse
Return type: Warehouse

Get a warehouse

Parameters

Name

Type

Description

$warehouseId

int

The id of the warehouse.

$with

array

The relations to load in the warehouse instance. repairWarehouse is the only relation currently available.

public all($with = [], $columns = []):array

List warehouses

Parameters

Name

Type

Description

$with

array

The relations to load in the warehouse instance. repairWarehouse is the only relation currently available.

$columns

array

The columns to load in the response

public create($data):Plenty\Modules\StockManagement\Warehouse\Models\Warehouse
Return type: Warehouse

Create a warehouse

Parameters

Name

Type

Description

$data

array

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
Name Type Description

id

int

The id of the warehouse

name

string

The name of the warehouse

note

string

A note for this warehouse

typeId

int

The id of the warehouse type. The following types are available: <ul> <li>0 = Sales warehouse</li> <li>1 = Repair warehouse</li> <li>4 = Storage warehouse</li> <li>5 = Transit warehouse</li> <li>6 = Distribution warehouse</li> <li>7 = Other</li> </ul>

allocationReferrerIds

array

Allocation Referrer Ids by automatic warehouse detection

onStockAvailability

int

Displayed availability of a variation if stock is available

outOfStockAvailability

int

Displayed availability of a variation if no stock is available

splitByShippingProfile

bool

Flag that indicates if for this warehouse orders are split by shipping profiles or not. <ul><li>True = Orders are split by shipping profiles</li> <li>False = Orders will not be split by shipping profiles</li></ul>

storageLocationType

string

The storage location type. The following types are available: <ul><li>none</li> <li>small</li><li>medium</li> <li>large</li> <li>europallet</li></ul>

storageLocationZone

int

The zone that the storage location is in

repairWarehouseId

int

The id of the associated repair warehouse

isInventoryModeActive

bool

Flag that indicates if the inventory mode for this warehouse is active or not. <ul><li>True = active</li> <li>False = inactive</li></ul>

logisticsType

string

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: <ul> <li>own</li> <li>amazon</li> <li>dhlFulfillment</li> </ul>

address

Address

The address that the warehouse is located at

repairWarehouse

Warehouse

All information about the repair warehouse if a repair warehouse is linked to the sales warehouse

updatedAt

string

The updated at timestamp of the warehouse

createdAt

string

The created at timestamp of the 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($rackId, $columns = [], $with = []):Plenty\Modules\StockManagement\Warehouse\Management\Models\Rack
Return type: Rack

Find a rack by id.

Parameters

Name

Type

Description

$rackId

int

The id of the rack.

$columns

array

The attributes to be loaded.

$with

array

The relations to be loaded. Possible values are 'warehouse', 'shelves' and 'storageLocations'.

public findRacks($page = 1, $itemsPerPage = 50, $columns = [], $with = []):Plenty\Repositories\Models\PaginatedResult
Return type: PaginatedResult

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

Parameters

Name

Type

Description

$page

int

The requested page.

$itemsPerPage

int

Number of items per page.

$columns

array

The attributes to be loaded.

$with

array

The relations to be loaded. Possible values are 'warehouse', 'shelves' and 'storageLocations'.

public createRack($data, $warehouseId):Plenty\Modules\StockManagement\Warehouse\Management\Models\Rack
Return type: Rack

Create a new rack.

Parameters

Name

Type

Description

$data

array

The data to create a new rack.

$warehouseId

int

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($filters = []):void

Sets the filter array.

Parameters

Name

Type

Description

$filters

array

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($shelfId, $columns = [], $with = []):Plenty\Modules\StockManagement\Warehouse\Management\Models\Shelf
Return type: Shelf

Find a shelf by id.

Parameters

Name

Type

Description

$shelfId

int

The id of the shelf.

$columns

array

The attributes to be loaded.

$with

array

The relations to be loaded. Possible values are 'warehouse', 'rack' and 'storageLocations'.

public findShelves($page = 1, $itemsPerPage = 50, $columns = [], $with = []):Plenty\Repositories\Models\PaginatedResult
Return type: PaginatedResult

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

Parameters

Name

Type

Description

$page

int

The requested page.

$itemsPerPage

int

Number of items per page.

$columns

array

The attributes to be loaded.

$with

array

The relations to be loaded. Possible values are 'warehouse', 'rack' and 'storageLocations'.

public createShelf($data, $warehouseId, $rackId):Plenty\Modules\StockManagement\Warehouse\Management\Models\Shelf
Return type: Shelf

Create a new shelf.

Parameters

Name

Type

Description

$data

array

The data to create a new shelf.

$warehouseId

int

The id of the warehouse the shelf shall belong to.

$rackId

int

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($filters = []):void

Sets the filter array.

Parameters

Name

Type

Description

$filters

array

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($storageLocationId, $columns = [], $with = []):Plenty\Modules\StockManagement\Warehouse\Management\Models\StorageLocation
Return type: StorageLocation

Find a storage location by id.

Parameters

Name

Type

Description

$storageLocationId

int

The id of the storage location.

$columns

array

The attributes to be loaded.

$with

array

The relations to be loaded. Possible values are 'warehouse', 'rack' and 'shelf'.

public findStorageLocations($page = 1, $itemsPerPage = 50, $columns = [], $with = []):Plenty\Repositories\Models\PaginatedResult
Return type: PaginatedResult

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

Parameters

Name

Type

Description

$page

int

The requested page.

$itemsPerPage

int

Number of items per page.

$columns

array

The attributes to be loaded.

$with

array

The relations to be loaded. Possible values are 'warehouse', 'rack' and 'shelf'.

public createStorageLocation($data, $warehouseId, $rackId, $shelfId):Plenty\Modules\StockManagement\Warehouse\Management\Models\StorageLocation
Return type: StorageLocation

Create a new storage location.

Parameters

Name

Type

Description

$data

array

The data to create a new storage location.

$warehouseId

int

The id of the warehouse the storage location shall belong to.

$rackId

int

The id of the rack the storage location shall belong to.

$shelfId

int

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($filters = []):void

Sets the filter array.

Parameters

Name

Type

Description

$filters

array

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
Name Type Description

id

int

The id of the rack.

name

int

The name of the rack.

position

int

The position of the rack.

warehouseId

int

The id of the warehouse the rack belongs to.

zone

int

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
Name Type Description

id

int

The id of the shelf.

rackId

int

The id of the rack the shelf belongs to.

name

string

The name of the shelf.

level

int

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
Name Type Description

id

int

The id of the storage location.

warehouseId

int

The id of the warehouse the storage location belongs to.

rackId

int

The id of the rack the storage location belongs to.

shelfId

int

The id of the shelf the storage location belongs to.

name

string

The name of the storage location.

type

int

The type of the storage location. Valid strings are: 'small', 'medium', 'large', 'europallet'.

position

int

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.