cancel
Showing results for 
Search instead for 
Did you mean: 

API Rest: Update Product custom_attributes / multiselect - string expected?? Magento 2.4.2

API Rest: Update Product custom_attributes / multiselect - string expected?? Magento 2.4.2

Hi, in Magento ver. 2.2.8 I could just submit the product custom_attributes (multiselect) by array.

E.g..

 

    [11] => Array
        (
            [attribute_code] => target_group
            [value] => Array
                (
                    [0] => 165
                    [1] => 162
                )

        )

 

But now I get as response in Magento ver. 2.4.2 :

{"message":"Error occurred during \"custom_attributes\" processing. Attribute \"target_group\" has invalid value. The \"array\" value's type is invalid. The \"string\" type was expected. Verify and try again.","trace":null}

 

Is this a bug? Or must I set the values now in other way? In the doc it says string, but it doesn't work for multi values?!

 

Thanks

Maik

1 REPLY 1

Re: API Rest: Update Product custom_attributes / multiselect - string expected?? Magento 2.4.2

Hi,

for multiselect the values must now separated by commas, not as array.

e.g.

    [11] => Array
        (
            [attribute_code] => target_group
            [value] => 165, 162
        )

Maik