updateInventoryProductsStock
The method allows to update stocks of products (and/or their variants) in BaseLinker catalog. Maximum 1000 products at a time.
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. |
products | array | An array of products, where the key is a product ID and the value is a list of stocks. When determining the variant stock, provide variant ID as a product ID. In the stocks array the key should be the warehouse ID and the value - stock for that warehouse. The format of the warehouse identifier should be as follows: "[type:bl|shop|warehouse]_[id:int]". (e.g. "bl_123"). The list of warehouse identifiers can be retrieved using the getInventoryWarehousesmethod. Stocks cannot be assigned to the warehouses created automatically for purposes of keeping external stocks (shops, wholesalers, etc.). |
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 |
counter | int | Number of updated products. |
warnings | array | Warning list for product updates. The key of each element is the product identifier, the value is the update error message. Only the keys containing an error are returned. |
Sample
Input data:Output data:
A sample request in PHP: