1

I need to get the attribute code by attribute id with rest api. This is needed for configurable product. I get the configurable product data:

  "extension_attributes": {
        "website_ids": [
            1
        ],
        "configurable_product_options": [
            {
                "id": 2568,
                "attribute_id": "253",
                "label": "Size",
                "position": 0,
                "values": [
                    {
                        "value_index": 1847
                    },
                    {
                        "value_index": 1844
                    },
                    {
                        "value_index": 1845
                    }
                ],
                "product_id": 25539
            }
        ],
        "configurable_product_links": [
            25540,
            25541,
            25542
        ]
    },

The 'configurable_product_options' has no attribute_code, I need it to find the value of the value_index which is the option id. How to get the attribute_code?

0

Magento 2 Provide the rest API to get the product attributes value and its option

you can try this API catalogProductAttributeRepositoryV1 and you can pass the attribute_id instead of the attribute_code.

enter image description here

I hope this is helpful to you!!

| improve this answer | |

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.