1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-02-03 13:22:19 +02:00
OpenIntegrations/docs/en/examples/Ozon/CreateUpdateProducts.txt
Vitaly the Alpaca (bot) 94b649b700 Main build (Jenkins)
2024-09-29 12:34:39 +03:00

49 lines
2.5 KiB
Plaintext

ClientID = "2128753";
APIKey = "7cc90d26-33e4-499b...";
Image1 = "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture.jpg";
Image2 = "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/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);
// 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);