0

Using the Magento 2 REST API, I was able to successfully create a new product attribute sending a PUT request to V1/products/attributes/{attribute_code}. In the request, I added a value in the custom_attributes object. However, when I got the attribute I created using a GET request to the same endpoint, I noticed the custom_attributes section was not returned. I can't seem to find any endpoint that will return that data. Could someone point me in the right direction? I'm very new to Magento development. If it helps, here's the JSON I used for the PUT request: { "attribute": { "extension_attributes": { "is_pagebuilder_enabled": true }, "is_wysiwyg_enabled": false, "is_html_allowed_on_front": true, "used_for_sort_by": false, "is_filterable": true, "is_filterable_in_search": true, "is_used_in_grid": false, "is_visible_in_grid": true, "is_filterable_in_grid": false, "position": 0, "apply_to": [], "is_searchable": "0", "is_visible_in_advanced_search": "0", "is_comparable": "1", "is_used_for_promo_rules": "0", "is_visible_on_front": "1", "used_in_product_listing": "1", "is_visible": true, "scope": "store", "frontend_input": "text", "entity_type_id": "4", "is_required": false, "options": [], "is_user_defined": true, "default_frontend_label": "string", "frontend_labels": [ { "store_id": 0, "label": "string" } ], "is_user_defined": true, "default_frontend_label": "testing", "frontend_labels": [], "backend_type": "varchar", "backend_model": "Magento\\Eav\\Model\\Entity\\Attribute\\Backend\\ArrayBackend", "default_value": "", "is_unique": "0", "validation_rules": [], "custom_attributes": [ { "attribute_code": "test-attr", "value": "true" } ] } }

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.