Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Module: Product Attributes API

Resource: product_attribute

Method:
  • product_attribute.info (SOAP V1)
  • catalogProductAttributeInfo (SOAP V2)

Allows you to get full information about a required attribute with the list of options.

Arguments:

TypeNameDescription
stringsessionIdSession ID
stringattributeAttribute code or ID

Return:

TypeNameDescription
arrayresultArray of catalogProductAttributeEntity

The catalogProductAttributeEntity content is as follows:

TypeNameDescription
stringattribute_idAttribute ID
stringattribute_codeAttribute code
stringfrontend_inputAttribute type
stringscopeAttribute scope
stringdefault_valueAttribute default value
intis_uniqueDefines whether the attribute is unique
intis_requiredDefines whether the attribute is required
ArrayOfStringapply_toApply to. Empty for “Apply to all” or array of the following possible values: ‘simple’, ‘grouped’, ‘configurable’, ‘virtual’, ‘bundle’, ‘downloadable’, ‘giftcard’
intis_configurableDefines whether the attribute can be used for configurable products
intis_searchableDefines whether the attribute can be used in Quick Search
intis_visible_in_advanced_searchDefines whether the attribute can be used in Advanced Search
intis_comparableDefines whether the attribute can be compared on the frontend
intis_used_for_promo_rulesDefines whether the attribute can be used for promo rules
intis_visible_on_frontDefines whether the attribute is visible on the frontend
intused_in_product_listingDefines whether the attribute can be used in product listing
associativeArrayadditional_fieldsArray of additional fields
arrayoptionsArray of catalogAttributeOptionEntity
arrayfrontend_labelArray of catalogProductAttributeFrontendLabel

The catalogAttributeOptionEntity content is as follows:

TypeNameDescription
stringlabelText label
stringvalueOption ID

The catalogProductAttributeFrontendLabelEntity content is as follows:

TypeNameDescription
stringstore_idStore ID
stringlabelText label

The AdditionaFieldsEntity array of additional fields for the text type is as follows:

TypeNameDescription
stringfrontend_classInput Validation for Store Owner. Possible values: ‘validate-number’ (Decimal Number), ‘validate-digits’ (Integer Number), ‘validate-email’, ‘validate-url’, ‘validate-alpha’ (Letters), ‘validate-alphanum’ (Letters (a-z, A-Z), or Numbers (0-9))
booleanis_html_allowed_on_frontDefines whether the HTML tags are allowed on the frontend
booleanused_for_sort_byDefines whether it is used for sorting in product listing

The AdditionaFieldsEntity array of additional fields for the text area type is as follows:

TypeNameDescription
booleanis_wysiwyg_enabledEnable WYSIWYG flag
booleanis_html_allowed_on_frontDefines whether the HTML tags are allowed on the frontend

The AdditionaFieldsEntity array of additional fields for the date and boolean types is as follows:

TypeNameDescription
booleanused_for_sort_byDefines whether it is used for sorting in product listing

The AdditionaFieldsEntity array of additional fields for the multiselect type is as follows:

TypeNameDescription
booleanis_filterableDefines whether it used in layered navigation
booleanis_filterable_in_searchDefines whether it is used in search results layered navigation
intpositionPosition

The AdditionaFieldsEntity array of additional fields for the select and price types is as follows:

TypeNameDescription
booleanis_filterableDefines whether it used in layered navigation
booleanis_filterable_in_searchDefines whether it is used in search results layered navigation
intpositionPosition
booleanused_for_sort_byDefines whether it is used for sorting in product listing

Faults:

Fault CodeFault Message
101Requested attribute not found.

Examples

Request Example SOAP V1
$client = new SoapClient('http://magentohost/api/soap/?wsdl');

// If somestuff requires API authentication,
// then get a session token
$session = $client->login('apiUser', 'apiKey');

$result = $client->call($session, 'product_attribute.info', '11');
var_dump ($result);

// If you don't need the session anymore
//$client->endSession($session);
Request Example SOAP V2
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); // TODO : change url
$sessionId = $proxy->login('apiUser', 'apiKey'); // TODO : change login and pwd if necessary

$result = $proxy->catalogProductAttributeInfo($sessionId, '11');
var_dump($result);
Response Example SOAP V1
array
  'attribute_id' => string '11' (length=3)
  'attribute_code' => string 'new_special_price' (length=17)
  'frontend_input' => string 'text' (length=4)
  'default_value' => null
  'is_unique' => string '0' (length=1)
  'is_required' => string '0' (length=1)
  'apply_to' =>
    array
      empty
  'is_configurable' => string '0' (length=1)
  'is_searchable' => string '0' (length=1)
  'is_visible_in_advanced_search' => string '0' (length=1)
  'is_comparable' => string '0' (length=1)
  'is_used_for_promo_rules' => string '0' (length=1)
  'is_visible_on_front' => string '0' (length=1)
  'used_in_product_listing' => string '0' (length=1)
  'frontend_label' =>
    array
      0 =>
        array
          'store_id' => int 0
          'label' => string 'special price' (length=13)
      1 =>
        array
          'store_id' => int 2
          'label' => string 'special price' (length=13)
  'scope' => string 'store' (length=5)
  'additional_fields' =>
    array
      'frontend_class' => null
      'is_html_allowed_on_front' => string '1' (length=1)
      'used_for_sort_by' => string '0' (length=1)

Create the Magento file system owner