Skip to main content

Create update product

Creates new products or updates existing products, based on data structures

Function CreateUpdateProducts(Val ClientID, Val APIKey, Val ProductsArray) Export

ParameterCLI optionTypeDescription
ClientID--clientidStringClient identifier
APIKey--apikeyStringAPI key
ProductsArray--itemsArray Of StringArray 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


Code example
    ClientID = "2128753";
APIKey = "7cc90d26-33e4-499b...";
Image1 = "https://openintegrations.dev/test_data/picture.jpg";
Image2 = "https://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);

// 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);
CLI command example
    
oint ozon CreateUpdateProducts --clientid "2128753" --apikey "7cc90d26-33e4-499b..." --items %items%

Result
{
"result": {
"task_id": 1285530068
}
}