Skip to main content

Update products stocks

Changes the information about the stock amount of a product

Function UpdateProductsStocks(Val ClientID, Val APIKey, Val Stocks) Export

ParameterCLI optionTypeRequiredDescription
ClientID--clientidStringClient identifier
APIKey--apikeyStringAPI key
Stocks--stocksArray of StructureArray of stocks data. See GetProductStocksStructure

Returns: Map Of KeyAndValue - serialized JSON response from Ozon Seller API


tip

You can change availability for 100 products per request. You can send up to 80 requests per minute from one merchant account.

You can only update the stock of an item in one warehouse once every 2 minutes. You can set the availability of a product only after its status changes to price_sent

Stocks of bulky goods can only be renewed in the warehouses designated for them

Method at API documentation: post /v2/products/stocks


1C:Enterprise/OneScript code example
    ClientID  = "2128753";
APIKey = "7cc90d26-33e4-499b...";
ProductID = "1235184552";

Stocks = New Structure;
Stocks.Insert("offer_id" , "143210610");
Stocks.Insert("product_id" , ProductID);
Stocks.Insert("stock" , 20);
Stocks.Insert("warehouse_id", 1);

Result = OPI_Ozon.UpdateProductsStocks(ClientID, APIKey, Stocks);
    # JSON data can also be passed as a path to a .json file

oint ozon UpdateProductsStocks \
--clientid "***" \
--apikey "***" \
--stocks "{'offer_id':'143210610','product_id':1237069598,'stock':20,'warehouse_id':1}"
Result
{
"result": [
{
"warehouse_id": 1,
"product_id": 0,
"offer_id": "143210610",
"updated": false,
"errors": [
{
"code": "WAREHOUSE_NOT_FOUND",
"message": "warehouse has wrong id: 1"
}
]
}
]
}