Transmitting characteristic values
In all scenarios, be guided by the data from the response of the method of obtaining characteristics. POST v2/category/{categoryId}/parameters:
values[].id— ids to send tovalueId;multivalue— is it possible to pass multiple values;allowCustomValues— is it possible to pass custom values (valuewithoutvalueId);unit.defaultUnitId,unit.units[]— units of measurement and their identifiers (unitId);constraints— restrictions on values (number limits, maximum text length).
The values are passed in the parameter parameterValues in two methods (the rules are the same):
- POST v2/businesses/{businessId}/offer-mappings/update
- POST v2/businesses/{businessId}/offer-cards/update
A characteristic with a list of acceptable values (type ENUM), you need to specify one value
- When to apply: type characteristics
ENUM, in the response of the characteristics method, the fieldmultivalue = false. - What to transmit: one object with
parameterIdandvalueId(take the ID fromvalues[].id). Fieldvalueyou don't have to specify it. - Restriction: if
allowCustomValues = false, transfer onlyvaluewithoutvalueIdwill result in a validation error.
Example — one value from the list
{
"parameterValues": [
{ "parameterId": 111111, "valueId": 999999, "value": "10" }
]
}
The characteristic allows for eigenvalues, you need to specify one eigenvalue.
- When to apply: type characteristics
ENUM, in the response of the characteristics method, the fieldallowCustomValues = true,multivalue = false. - What to transmit: one object with
parameterIdand a line invalue. FieldvalueIddon't specify it.
Example — one proper value
{
"parameterValues": [
{ "parameterId": 111111, "value": "Собственное значение" }
]
}
The characteristic allows for several values
- When to apply: in the response of the characteristics method, the field
multivalue = true. - What to transmit: multiple objects with the same name
parameterId— one for each value.- If the value is from the Market list — specify
valueId. - If eigenvalues are allowed (
allowCustomValues = true) — specifyvaluewithoutvalueId.
- If the value is from the Market list — specify
Example — multiple eigenvalues
{
"parameterValues": [
{ "parameterId": 111111, "value": "Собственное значение 1" },
{ "parameterId": 111111, "value": "Собственное значение 2" }
]
}
Characteristics with units of measurement
- When to apply: units are indicated in the response for the characteristic (
unit.defaultUnitId,unit.units[]). - What to send: specify if necessary
unitIdin each object, the values are; ifunitIdomitted, the default unit is used.
Example — value with a unit of measurement
{
"parameterValues": [
{ "parameterId": 111111, "value": "10", "unitId": 3 }
]
}
Deleting a previously passed value
- What to send: an object with the same name
parameterIdand emptyvalue(""). This will delete the characteristic value.
Example — deleting a feature value
{
"parameterValues": [
{ "parameterId": 111111, "value": "" }
]
}