Manage property values for a product, which is a part of a product line – Create, Get, Update
Property values entered on the parent level will be returned for all products and product lines,
which belong to that parent product line. The ParentID parameter in the response will be filled in with the parent product line’s Cobuilder ID, in case the property value is inherited.
Here's an example:
The product line “Semi-glossed Cobuilder Paint” (Cobuilder ID: 111111) has the characteristic “finish”, which is common for all products of that group. The Get property values endpoint will return the following:
[
{
"propertyGuid": "ExampleString",
"unitGuid": "ExampleString",
"propertyTitle": "finish",
"propertyDefaultTitle": "finish",
"unitTitle": "unitless",
"unitDefaultTitle": "unitless",
"parentId": 0,
"values": [
{
"value": "semi-gloss",
"dataType": "string"
}
]
}
]
The regular product “Semi-glossed Cobuilder Paint 1L” is a part of the “Semi-glossed Cobuilder Paint” product line. When the product was attached, it automatically got the property values, entered on the higher hierarchic level. The response you will get for it will be the following:
[
{
"propertyGuid": "ExampleString",
"unitGuid": "ExampleString",
"propertyTitle": "finish",
"propertyDefaultTitle": "finish",
"unitTitle": "unitless",
"unitDefaultTitle": "unitless",
"parentId": "111111",
"values": [
{
"value": "semi-gloss",
"dataType": "string"
}
]
}
]
To add a new property value to the child product, you follow the same flow as with any other product. Send a request through the Create property values endpoint to create a new value.
Here’s the GET response after we have added a property value for “color” only on the child product:
[
{
"propertyGuid": "ExampleString",
"unitGuid": "ExampleString",
"propertyTitle": "finish",
"propertyDefaultTitle": "finish",
"unitTitle": "unitless",
"unitDefaultTitle": "unitless",
"parentId": "111111",
"values": [
{
"value": "semi-gloss",
"dataType": "string"
}
]
}
{
"propertyGuid": "ExampleString",
"unitGuid": "ExampleString",
"propertyTitle": "color",
"propertyDefaultTitle": "color",
"unitTitle": "unitless",
"unitDefaultTitle": "unitless",
"parentId": 0,
"values": [
{
"value": "Blue",
"dataType": "string"
}
]
}
]
When there is a value filled in on the parent level and you want to change it on a particular child product, you can follow the same flow as with any other product – use the Update property values endpoint to change that value.
Important to note: Changing the property value on the child product level,
will NOT change the value entered on the parent level. The property value will be
overwritten only for the particular product with was updated and the parent value
will no longer be visible for that product. If you want to change a value for the
whole product line, you should update the product where it was originally entered
– the parent product line.
Here’s an example for a property value that has been updated on the child level:
Get Property Values response for the product line “Semi-glossed Cobuilder Paint”:
[
{
"propertyGuid": "ExampleString",
"unitGuid": "ExampleString",
"propertyTitle": "packaging size",
"propertyDefaultTitle": "packaging size",
"unitTitle": "litre",
"unitDefaultTitle": "litre",
"parentId": 0,
"values": [
{
"value": "1",
"operator": "gt"
"dataType": "float"
}
{
"value": "10",
"operator": "lt"
"dataType": "float"
}
]
}
]
Get Property Values response for the child product “Semi-glossed Cobuilder Paint 1L”:
[
{
"propertyGuid": "ExampleString",
"unitGuid": "ExampleString",
"propertyTitle": "packaging size",
"propertyDefaultTitle": "packaging size",
"unitTitle": "litre",
"unitDefaultTitle": "litre",
"parentId": 0,
"values": [
{
"value": "1",
"operator": "eq"
"dataType": "float"
}
]
}
]