3

I'm trying to update a product with the catalogProductRepositoryV1. I want to change a custom select attribute for the given product. When sending the following request:

{
  "product": {
        "custom_attributes": [
            {
                "attribute_code": "color_armrest",
                "value": "Akoya"
            }
        ]
    }
}

I get the following error:

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

I understand I'm supposed to insert the attributes option_id here and not the label, but how do I get it? Do I really need to use the catalogProductAttributeOptionManagementV1 to fetch all attribute options and filter the id and then pass it to the product put request?

Regards

| improve this question | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.