Create update product
Creates new products or updates existing products, based on data structures
Function CreateUpdateProducts(Val ClientID, Val APIKey, Val ProductsArray) Export
Parameter | CLI option | Type | Required | Description |
---|---|---|---|---|
ClientID | --clientid | String | ✔ | Client identifier |
APIKey | --apikey | String | ✔ | API key |
ProductsArray | --items | Array Of String | ✔ | Array or one structure of product description fields |
Returns: Map Of KeyAndValue - serialized JSON response from Ozon Seller API
tip
Methods of product structure formation: GetProductStructure(), AddProductVideo(), AddProductVideoCover()
Uploading status check - GetProductCreationStatus()
Method at API documentation: post /v3/product/import
1C:Enterprise/OneScript code example
ClientID = "2479669";
APIKey = "09f65e9f-262d-4aca...";
Image1 = "https://hut.openintegrations.dev/test_data/picture.jpg";
Image2 = "https://hut.openintegrations.dev/test_data/picture2.jpg";
Video = "https://rutube.ru/video/c6cc4d620b1d4338901770a44b3e82f4/";
ImageArray = New Array;
ImageArray.Add(Image1);
ImageArray.Add(Image2);
// Common fields
ItemStructure = New Structure;
ItemStructure.Insert("description_category_id", 17028922);
ItemStructure.Insert("name" , "Protective film set for X3 NFC. Dark cotton");
ItemStructure.Insert("offer_id" , "143210609");
ItemStructure.Insert("barcode" , "112772873170");
ItemStructure.Insert("price" , "1300");
ItemStructure.Insert("old_price" , "1300");
ItemStructure.Insert("vat" , "0.1");
ItemStructure.Insert("height" , 250);
ItemStructure.Insert("width" , 150);
ItemStructure.Insert("depth" , 10);
ItemStructure.Insert("dimension_unit" , "mm");
ItemStructure.Insert("weight" , 100);
ItemStructure.Insert("weight_unit" , "g");
ItemStructure.Insert("images" , ImageArray);
ItemStructure.Insert("type_id" , 91565);
// Video
OPI_Ozon.AddProductVideo(ItemStructure, Video, "viedo1");
// Attributes individualized for different categories
CategoryAttribute1 = New Structure("dictionary_value_id,value", 971082156, "Speaker stand");
CategoryAttribute2 = New Structure("dictionary_value_id,value", 5060050, "Samsung");
CategoryAttribute3 = New Structure("dictionary_value_id,value", 61576, "gray");
CategoryAttribute4 = New Structure("dictionary_value_id,value", 95911,
"Protective film set for X3 NFC. Dark cotton");
CategoryAttribute5 = New Structure("value", "Protective film set for X3 NFC. Dark cotton");
OPI_Ozon.CompleteComplexAttribute(ItemStructure, 5076 , 0, CategoryAttribute1);
OPI_Ozon.CompleteComplexAttribute(ItemStructure, 85 , 0, CategoryAttribute2);
OPI_Ozon.CompleteComplexAttribute(ItemStructure, 10096, 0, CategoryAttribute3);
OPI_Ozon.CompleteComplexAttribute(ItemStructure, 8229 , 0, CategoryAttribute4);
OPI_Ozon.CompleteComplexAttribute(ItemStructure, 9048 , 0, CategoryAttribute5);
Result = OPI_Ozon.CreateUpdateProducts(ClientID, APIKey, ItemStructure);
- Bash
- CMD/Bat
oint ozon CreateUpdateProducts \
--clientid "***" \
--apikey "***" \
--items "{'description_category_id':'17028922','name':'Protective film set for X3 NFC. Dark cotton','offer_id':'143210609','barcode':'112772873170','price':'1300','old_price':'1300','vat':'0.1','height':'250','width':'150','depth':'10','dimension_unit':'mm','weight':'100','weight_unit':'g','images':['https://hut.openintegrations.dev/test_data/picture.jpg','https://hut.openintegrations.dev/test_data/picture2.jpg'],'type_id':'91565','complex_attributes':[{'attributes':[{'id':'21841','complex_id':'100001','values':[{'value':'https://rutube.ru/video/c6cc4d620b1d4338901770a44b3e82f4/'}]},{'id':'21837','complex_id':'100001','values':[{'value':'viedo1'}]}]}],'attributes':[{'id':'5076','complex_id':'0','values':[{'dictionary_value_id':'971082156','value':'Speaker stand'}]},{'id':'85','complex_id':'0','values':[{'dictionary_value_id':'5060050','value':'Samsung'}]},{'id':'10096','complex_id':'0','values':[{'dictionary_value_id':'61576','value':'gray'}]},{'id':'8229','complex_id':'0','values':[{'dictionary_value_id':'95911','value':'Protective film set for X3 NFC. Dark cotton'}]},{'id':'9048','complex_id':'0','values':[{'value':'Protective film set for X3 NFC. Dark cotton'}]}]}"
oint ozon CreateUpdateProducts ^
--clientid "***" ^
--apikey "***" ^
--items "{'description_category_id':'17028922','name':'Protective film set for X3 NFC. Dark cotton','offer_id':'143210609','barcode':'112772873170','price':'1300','old_price':'1300','vat':'0.1','height':'250','width':'150','depth':'10','dimension_unit':'mm','weight':'100','weight_unit':'g','images':['https://hut.openintegrations.dev/test_data/picture.jpg','https://hut.openintegrations.dev/test_data/picture2.jpg'],'type_id':'91565','complex_attributes':[{'attributes':[{'id':'21841','complex_id':'100001','values':[{'value':'https://rutube.ru/video/c6cc4d620b1d4338901770a44b3e82f4/'}]},{'id':'21837','complex_id':'100001','values':[{'value':'viedo1'}]}]}],'attributes':[{'id':'5076','complex_id':'0','values':[{'dictionary_value_id':'971082156','value':'Speaker stand'}]},{'id':'85','complex_id':'0','values':[{'dictionary_value_id':'5060050','value':'Samsung'}]},{'id':'10096','complex_id':'0','values':[{'dictionary_value_id':'61576','value':'gray'}]},{'id':'8229','complex_id':'0','values':[{'dictionary_value_id':'95911','value':'Protective film set for X3 NFC. Dark cotton'}]},{'id':'9048','complex_id':'0','values':[{'value':'Protective film set for X3 NFC. Dark cotton'}]}]}"
Result
{
"result": {
"task_id": 2921235747
}
}