Search product attributes
Filter product attributes by multiple criteria
Filter structure and format is described under Resources section in this guide.
Restrictions
-
Search requests
- Search filters MUST include all necessary columns. If an attribute is not explicitly requested it won’t be returned by the API. Available attributes can be found later in this section. Requesting non-existing attributes will return a 422 error code. You are allowed to sort by columns not included in “attributes” field, however this attribute won’t be returned
Response Format
Endpoint successful responses are wrapped in { data: [ ...] } object as in any other search endpoint. You can read more about response format in Resources section in this guide.
All attributes share a set of common fields while some attributes also have some custom attributes, current version supports the following attributes*.
- Please ** DO NOT ** rely in any other attribute returned by endpoints as they can dissapear in future releases of the API
| Field | Description | Attribute type |
|---|---|---|
| id | Attribute unique identifier | ALL |
| name | Attribute name, usually contains some human friendly name | ALL |
| label | Attribute unique label, generated by PIM and used in searches, etc. | ALL |
| type_class | Attribute class identifier, you can check available values in Product Attributes main section in this guide | ALL |
| groups | Array of group identifiers where this attribute belongs to | ALL |
| options | Array of available values for attribute | MultiSelectAttribute, DropdownAttribute |
| attributes | Array of objects of the form {'id': ..., 'label': ...} | CompletenessAttribute |
Basic Example
Complex examples can be found in code examples
1.- Search for all product attributes and all fields (a.k.a no-filters) 100 items max.
{ "filters":[], "attributes":[ "name", "label", "attributes", "groups", "type_class", "options" ], "pagination":{ "page_size":100, "page":1, "order":"" }}Response
{ "data":[ { "id": "5d00ae1aebd6f0000170c3d5", "label": "in_stock", "name": "In Stock", "type_class": "BooleanAttribute", "groups": [ "5d00d00fc3ddd200018d92f4" ] }, { "id": "5d0384c339d49f0001391965", "name": "color", "label": "color", "groups": [], "options": [ "blue", "black", "green", "red" ], "type_class": "MultiSelectAttribute" } ], "pagination":{ "count": 2, "order": "", "page": 1, "page_size": 100, "total_count": 2 }}2.- Search for "Rich info complete" completeness attribute. This completeness attribute is formed by System attributes: 'sku' and 'label' and product attribute 'Additional Image Gallery'
{ "filters":[[{"field":"name","operator":"like","value":"RiCh InFo"}]], "attributes":[ "name", "label", "attributes", "type_class" ], "pagination":{ "page_size":25, "page":1, "order":"" }}Response
{ "data": [ { "attributes": [ { "id": null, "label": "sku" }, { "id": null, "label": "label" }, { "id": "5c582c9c9e877f04666c64ac", "label": "additional_image_gallery" } ], "id": "5c766b364931b805abd334a0", "label": "rich_info_complete", "name": "Rich Info Complete ", "type_class": "CompletenessAttribute" } ], "pagination": { "count": 1, "order": null, "page": 1, "page_size": 25, "total_count": 82 }}Authorization
bearerAuth Obtain a token via POST /auth/api/get-token (15 minute lifetime), then send it as Authorization: Bearer <token>.
In: header
Response Body
application/json
curl -X POST 'https://example.com/api/v1/attributes/product/search'{ "data": [ { "attributes": [ { "id": "5c582c419e877f04666c64a4", "label": "gtin" }, { "id": "5c582c269e877f04666c64a1", "label": "brand" }, { "id": "5c582c6e9e877f04666c64a6", "label": "title" } ], "filter_type": "DecimalAttribute", "groups": [ "5c582a769e877f0467b57ab5" ], "id": "5c59b93e9e877f04666c67a3", "label": "basic_info_complete", "name": "Basic Info Complete ", "type_class": "CompletenessAttribute" }, { "attributes": [ { "id": "5c582c9c9e877f04666c64ac", "label": "additional_image_galery" }, { "id": "5c19ffd30b64d40460c50d1c", "label": "color" }, { "id": "5c19ffda0b64d40460c50d1e", "label": "description" }, { "id": "5c582c819e877f04666c64a8", "label": "feature_description" }, { "id": "5c582c8f9e877f04666c64aa", "label": "hero_image" }, { "id": "5c19fff45e9b0f045e7d2f2d", "label": "product_type" }, { "id": "5c582cc79e877f0465578e81", "label": "suggested_retail_price" }, { "id": "5c19ffeb0b64d404624d3bcc", "label": "type" }, { "id": "5c582cb89e877f0465578e7e", "label": "video_url" }, { "id": "5c6165c2e4db4e0461c9bfba", "label": "bathroom_picture" }, { "id": "5c617428e4db4e0461c9bffd", "label": "collection" } ], "filter_type": "DecimalAttribute", "groups": [ "5c582a979e877f04666c649c" ], "id": "5c766b364931b805abd334a0", "label": "rich_info_complete", "name": "Rich Info Complete", "type_class": "CompletenessAttribute" } ], "pagination": { "count": 2, "order": "", "page": 1, "page_size": 25, "total_count": 82 }}