Attribute Options By Code API

Get all options of an attribute by passing its attribute code.

Last updated

On this page

Overview

Use the Attribute Options By Code API to get all attribute options for the attribute code you pass.

Endpoint

MethodPath
POST/api/v1/search/attributeOptionsByAttributeCode
POST/api/v2/search/attributeOptionsByAttributeCode

Request body

JSON
{
   "token": "{{ token }}", //required
   "attribute_code": "color" //required
}

Successful response

JSON
{
    "data": {
        "id": 38518077,
        "attribute_id": 93,
        "attribute_code": "color",
        "default_attribute_code": "color",
        "options": [
            {
                "id": 38518078,
                "option_id": "49",
                "option_label": "Black",
                "option_value": "black"
            },
            {
                "id": 38518079,
                "option_id": "50",
                "option_label": "Blue",
                "option_value": "blue"
            }
        ]
    }
}