API documentation
Method list
Test your request
Changelog


updateInventoryProductsStock
The method allows to update stocks of products (and/or their variants) in BaseLinker catalog. Maximum 1000 products at a time.


Input parameters
inventory_idintCatalog ID. The list of identifiers can be retrieved using the method getInventories.
productsarrayAn 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.
statusvarchar(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
counterintNumber of updated products.
warningsarrayWarning 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: