getInventoryProductsStock
The method allows you to retrieve stock data of products from BaseLinker catalogs
Input parameters
Output data:
A sample request in PHP:
inventory_id | int | Catalog ID. The list of identifiers can be retrieved using the method getInventories. |
page | int | (optional) Results paging (1000 products per page for BaseLinker warehouse) |
Output data
The method returns the data in JSON format.
status | varchar(30) | SUCCESS - request executed correctly ERROR - an error occurred during an API request. Error details will be described in 2 additional returned fields: error_message and error_code |
products | array | A list containing product stocks, where the key is the product ID and the value is an array containing the fields listed below. |
| - product_id | int | ID of the product. |
| - stock | array | A list where the key is the warehouse ID and the value is a stock for this warehouse. Warehouse ID should have the following format: "[type:bl|shop|warehouse]_[id:int]" (e.g. "bl_123"). The list of warehouse IDs can be retrieved with getInventoryWarehouses method. |
| - reservations | array | Only returned for inventories that have reservations enabled. A list where the key is the warehouse ID and the value is a reserved stock for this warehouse. Warehouse ID should have the following format: "[type:bl|shop|warehouse]_[id:int]" (e.g. "bl_123"). The list of warehouse IDs can be retrieved with getInventoryWarehouses method. |
| - variants | array | A list containing variants stocks, where the key is the variant ID. The value is a list where a key is a warehouse ID and value is a stock in this warehouse. |
Sample
Input data:Output data:
A sample request in PHP: