Skip to main content

Add product property variant

Adds a variant for an existing property

Function AddProductPropertyVariant(Val Value, Val Property, Val Parameters = "") Export

ParameterCLI optionTypeRequiredDescription
Value--valueStringProperty value
Property--propString, NumberProperty ID where the variant is added
Parameters--authStructure Of StringAuthorization JSON or path to .json

Returns: Map Of KeyAndValue - serialized JSON response from VK


1C:Enterprise/OneScript code example
    Parameters = GetVKParameters();

Property = "912";
OptionArray = New Array;
OptionArray.Add("Yellow");
OptionArray.Add("Blue");
OptionArray.Add("Red");

For Each Value In OptionArray Do

Result = OPI_VK.AddProductPropertyVariant(Value, Property, Parameters);

FunctionParameters.Insert(ParameterName, VariantID);
EndDo;
    # JSON data can also be passed as a path to a .json file

oint vk AddProductPropertyVariant \
--value "Red" \
--prop "958" \
--auth "{'access_token':'***','owner_id':'-218861756','app_id':'51694790','group_id':'218861756'}"
Result
{
"response": {
"variant_id": 2563
}
}