4

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

0
0

Your request value for your color_armrest has to be in integer. Every option in the storefront should have an integer internally corresponding to it. This is not shown on the frontend but you can look it up by using GET request.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.