Edit in GitHubLog an issue

Inventory Management API reference

Inventory Management provides new modules, interfaces, and classes to manage inventory quantities, sources, stocks, etc. This reference details deprecated modules and new services available for managing inventory for single and multi source merchants.

Deprecated modules

Inventory Management deprecates ScalableInventory and CatalogInventory modules.

The ScalableInventory module is part of Adobe Commerce. Its original purpose was to perform inventory processing asynchronously, moving the computation of quantities to a worker that processed the calculations later. This functionality was limited in that the asynchronous processing could be performed on backordered products only.

Inventory Management creates reservations for all orders, not just those on backorder. All quantities are calculated asynchronously.

The CatalogInventory module is part of Magento Open Source. Its original purpose was to retrieve and update stock attributes, including status, quantity, and backorders. Inventory Management architecture replaces and expands these capabilities to support multiple stocks and sources, salable quantities, stock quantities, etc.

The following interfaces and classes have been deprecated. They cannot be mapped to new interfaces. The Inventory Management architecture eliminates the need for this functionality.

ScalableInventory interfaces:

  • ItemInterface
  • ItemsInterface

CatalogInventory interfaces:

  • QueryProcessorInterface
  • RegisterProductSaleInterface
  • RevertProductSaleInterface
  • StockCollectionInterface
  • StockConfigurationInterface
  • StockCriteriaInterface
  • StockIndexInterface
  • StockInterface (indexer)
  • StockInterface
  • StockItemCollectionInterface
  • StockItemCriteriaInterface
  • StockItemInterface
  • StockItemRepositoryInterface
  • StockManagementInterface
  • StockRegistryInterface
  • StockRepositoryInterface
  • StockStateInterface
  • StockStatusCollectionInterface
  • StockStatusCriteriaInterface
  • StockStatusInterface
  • StockStatusRepositoryInterface

CatalogInventory classes:

  • Backorders
  • DefaultStock
  • DefaultStockqty
  • Item
  • Minsaleqty
  • Qtyincrements
  • QuantityValidator
  • Status
  • Stock (Helper)
  • Stock (model/source)
  • Stock
  • StockFactory

Inventory Management API

The following services reside under the Magento/InventoryApi/Api namespace, replacing deprecated services and APIs.

ServiceDescriptionDeprecated API
Retrieves, saves or finds (getList method) Source entities
-
Retrieves, saves, finds (getList method) or deletes Stock entities)
-
Saves sources to stocks assignments
-
Removes sources to stocks assignments
-
Retrieves source to stock links according to provided SearchCriteria
-
Retrieves sources assigned to provided stock sorted by priority
-
Finds SourceItems (products assigned to sources with Quantity per Source) by provided SearchCriteria
Saves SourceItems (quantites and stock statuses of products on sources)
Deletes SourceItems (quantites and stock statuses of products on sources)

Inventory Catalog API

The following services reside under the Magento/InventoryCatalogApi/Api namespace.

ServiceDescription
Retrieves Default Source code
Retrieves Default Stock id
Bulk transfers the whole quantity of products from origin to destination source
Runs bulk partial inventory transfer for specified items

Inventory Sales API

The following services reside under the Magento/InventorySalesApi/Api namespace, replacing deprecated services and APIs.

ServiceDescriptionDeprecated API
Resolves linked Stock by provided sales channel type and code
Resolves linked stock to provided sales channel object
Checks whether product salable
Checks whether products in the list are salable
Checks if the product is salable for the requested quantity (used for shopping cart and checkout)
Gets product salable quantity (aggregated stock quantity including reservations)
StockStateInterface::getStockQty or just retrieve Qty from StockStatus entity
Places reservation in the scope some sales event (such as order placement, shipment creation, credit memo creation, order cancelation, etc)

Inventory Configuration API

The following services reside under the Magento/InventoryConfigurationApi/Api namespace, replacing deprecated services and APIs.

ServiceDescriptionDeprecated API
Retrieves stock item configuration by SKU and stock id
Catalog inventory configuration stored in StockItem entity
Saves stock item configuration
Stock configuration saved using StockItemRepositoryInterface::save

Inventory Source Selection Algorithm (SSA) API

The following services reside under the Magento/InventorySourceSelectionApi/Api namespace.

ServiceDescription
Gets the default Source Selection Algorithm (SSA) code
Gets the entire Source Selection Algorithm (SSA) list
Runs a specified Source Selection Algorithm (SSA) based on provided Inventory Request object

Inventory Export Aggregated Stock Data API

The following services reside under the Magento/InventoryExportStockApi/Api namespace.

ServiceDescription
Returns salable quantities for a provided sales channel not including placed reservations for completed orders. The quantity amount is less precise and runs with high performance and speed.
Returns salable quantities for a provided sales channel including placed reservations (for completed orders). The quantity amount is precise and runs with reduced performance and slower speed.
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.