# Attribute Sets

## Filter Attribute Sets

 - [GET /AttributeSets](https://docs.api.saleslayer.com/apis/catalog-v2.0/attribute-sets/filterattributesetsasync.md): Filters the tenant's Attribute Set resources using OData query options ($select, $expand, $filter, $orderby, $skip, $top, $skipToken). Result's paging is done using the default paging size options.
            


  Parameters details
  

  
    
      X-API-KEY
    
    
Custom HTTP request header containing the API key used for authentication.
            
  

    
      Accept-Language
    
    
Standard HTTP request header indicates the natural language and locale that the client prefers.
            
It can take one of the following values:
            
* : All the localized content is available in the result, regardless of the culture . This option is currently disabled.
            
null : The content localized in the default culture is available in the result.
            
culture-code : The content localized in the specified culture is available in the result.
            
 Specifying various culture codes or q-factor weighting are currently disabled.
            
Examples:
 - Expression es returns the content localized in the culture es. 
            
 - Expression en-us returns the content localized in the culture en-us.
            
  

    
      $select
    
    
Expression describing the list of Attribute Set resource properties to be included in the result.
            
The full list of the available Attribute Set resource properties is available in the JSON schema returned by the /AttributeSets/$metadata endpoint.
            
The name of the Attribute Set resource properties (both implicit and custom properties) must be specified.
            
Currently, the API does not support selecting the properties of an embedded resource or the properties of a resource within an embedded collection.
            
The expression follows the format: ATTRIBUTE_SET_PROPERTY1_NAME{, ATTRIBUTE_SET_PROPERTY2_NAME...}.
            
Examples:
 - Expression typ_title includes in the result only the property typ_title of the current resource (Attribute Set).
            
 - Expression typ_stat,typ_title includes in the result only the properties typ_stat and typ_title of the current resource (Attribute Set).
            
  

    
      $expand
    
    
Expression describing the list of collections embedded in the Attribute Set resource (Products) to be included in the result.
            
By default (if no value is supplied to this parameter), the result doesn't include the embedded collections (Products).
            
The expression follows the format: EMBEDDED_COLLECTION_OF_RESOURCE1_NAME{,EMBEDDED_COLLECTION_OF_RESOURCE1_NAME...}.
            
Currently only the embedded collections are supported, not the embedded resources.
            
Examples:
 - Expression Products includes in the result the number elements of the Products resource, embedded in the current resource (Attribute Set).
            
  

    
      $filter
    
    
Expression describing the filters applied to the resources included in the result.
            
By default (if no value is supplied to this parameter), no filters are applied
            
Currently, filtering on the nested resources properties is not supported.
            
The expression follows the ODATA version 4.01 URI conventions (http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html).
            
 The following filter options are currently supported:
            
 - logical operators (eq, ne, gt, lt, ge, le, or, and, in)
            
 - functions: string functions (contains, startswith, endswith)
            
 Currently it supports only the operators and functions applied on the properties of the root resource (Category).
            
 The logical operators/functions are applied over the data types of the corresponding properties in the filter criteria:
            
 - integer : property_of_type_integer lt -100
 - big integer: property_of_type_big_integer gt 10000
 - double: property_of_type_double ge 0.31415926535897931e1
 - decimal: property_of_type_decimal eq 12.34
 - string: property_of_type_string eq 'Hello world!'
 - date: property_of_type_date eq 2023-12-01
 - date time offset: property_of_type_datetimeoffset lt 2012-12-03T07:16:23Z or property_of_type_datetimeoffset lt 2012-12-03T07:16:23+00:00 or property_of_type_datetimeoffset lt 2012-12-03
Further examples:
            
 - contains(property1, 'stringValue1')
 - endswith(property1, 'stringValue1')
 - startswith(property1, 'stringValue1')
 - property1 in (value1, value2)
 - property1 gt integerValue1 and property2 eq 'stringValue1'
 - property1 gt integerValue1 or property2 eq 'stringValue1'
 - (property1 eq 'stringValue1' or property1 eq 'stringValue2') and (contains(property2, 'stringValue3') or startsWith(property3, 'stringValue4') or startsWith(property4, 'stringValue5'))
  

    
      $orderby
    
    
Expression describing the ordering applied to the properties of resources included in the result.
            
By default (if no value is supplied to this parameter), no sorting is applied.
            
Currently, ordering on multiple properties and ordering on embedded resources properties are not supported.
            
The expression follows the format: RESOURCE_PROPERTY_NAME (asc)|desc. 
            
Examples:
 - Expression typ_title orders the result ascendingly on the property typ_title of the current resource (Attribute Set).
            
 - Expression typ_title asc orders the result ascendingly on the property typ_title of the current resource (Attribute Set).
            
 - Expression typ_stat desc orders the result descendingly on the property typ_stat of the current resource (Attribute Set).
            
  

    
      $skip
    
    
Expression setting up result's paging according to the limit and offset paging strategy.
            
Using this paging strategy involves using both $skip and $top parameters.
            
We recommend limit and offset paging strategy for the extraction of data where $orderby clauses needs to be applied to the data to be extracted.
            
limit and offset paging is not as fast as the continuation token paging, but has 2 advantages over the later:
            
 - the possibility of applying sorting on the result;
            
 - a fine control over the data extracted.
            
The expression follows the format: NUMBER_OF_ITEMS_TO_BE_SKIPPED_IN_THE_RESULT. 
            
The page size for the Attribute Set resource is limited by default to 100 items.
            
The paging is performed through resource (Attribute Set), not through the resources in the embedded collections.
            
Examples:
 - Expression 1000 returns the Attribute Set items starting from the 1001st element in the result.
            
  

    
      $skipToken
    
    
Expression setting up the continuation token used in paging the result.
            
The expression follows the format: [CONTINUATION_TOKEN]. 
            
The page size for the Attribute Set resource is limited to 1 item.
            
The paging is performed through resource (Attribute Set), not through the resources in the embedded collections.
            
Examples:
 - Expression 123456789 limits the Attribute Set items to the next default number of items, starting from the continuation token 123456789.
            
  

    
      $top
    
    
Expression setting up the number of items in the result.
            
The expression follows the format: [PAGE_SIZE]. 
            
The page size for the Attribute Set resource is limited to 1 item.
            
The paging is performed through resource (Attribute Set), not through the resources in the embedded collections.
            
Examples:
 - Expression 10 limits the Attribute Set items to the first 10 elements, given the other filter, sorting and paging criteria.
            
  

    See also: A newer version of this endpoint is available at GET /v2/AttributeSets.
            The v2 endpoint returns a structured response (GetAttributeSetsResponse) that includes form layout configuration (ProductLayout, VariantLayout) and is not interchangeable with the OData-style response returned by this endpoint.

## Get Attribute Set

 - [GET /AttributeSets({attributeSetIdentifier})](https://docs.api.saleslayer.com/apis/catalog-v2.0/attribute-sets/searchattributesetasync.md): Returns a single Attribute Set resource by its identifier, using OData query options ($select, $expand) to shape the result.
            


  Parameters details
  

  
    
      X-API-KEY
    
    
Custom HTTP request header containing the API key used for authentication.
            
  

    
      Accept-Language
    
    
Standard HTTP request header indicates the natural language and locale that the client prefers.
            
It can take one of the following values:
            
* : All the localized content is available in the result, regardless of the culture . This option is currently disabled.
            
null : The content localized in the default culture is available in the result.
            
culture-code : The content localized in the specified culture is available in the result.
            
 Specifying various culture codes or q-factor weighting are currently disabled.
            
Examples:
 - Expression es returns the content localized in the culture es. 
            
 - Expression en-us returns the content localized in the culture en-us.
            
  

    
      $select
    
    
Expression describing the list of Attribute Set resource properties to be included in the result.
            
The full list of the available Attribute Set resource properties is available in the JSON schema returned by the /AttributeSets/$metadata endpoint.
            
The name of the Attribute Set resource properties (both implicit and custom properties) must be specified.
            
Currently, the API does not support selecting the properties of an embedded resource or the properties of a resource within an embedded collection.
            
The expression follows the format: ATTRIBUTE_SET_PROPERTY1_NAME{, ATTRIBUTE_SET_PROPERTY2_NAME...}.
            
Examples:
 - Expression typ_title includes in the result only the property typ_title of the current resource (Attribute Set).
            
 - Expression typ_stat,typ_title includes in the result only the properties typ_stat and typ_title of the current resource (Attribute Set).
            
  

    
      $expand
    
    
Expression describing the list of collections embedded in the Attribute Set resource (Products) to be included in the result.
            
By default (if no value is supplied to this parameter), the result doesn't include the embedded collections (Products).
            
The expression follows the format: EMBEDDED_COLLECTION_OF_RESOURCE1_NAME{,EMBEDDED_COLLECTION_OF_RESOURCE1_NAME...}.
            
Currently only the embedded collections are supported, not the embedded resources.
            
Examples:
 - Expression Products includes in the result the number elements of the Products resource, embedded in the current resource (Attribute Set).
            
  

    See also: A newer version of this endpoint is available at GET /v2/AttributeSets({id}).
            The v2 endpoint returns a typed response with form layout details (ProductLayout, VariantLayout) and differs in structure from this endpoint.

## Filter Attribute Set Products

 - [GET /AttributeSets({attributeSetIdentifier})/Products](https://docs.api.saleslayer.com/apis/catalog-v2.0/attribute-sets/filterproductsinattributesetasync.md): Filters and returns a paginated collection of Product resources scoped to the given Attribute Set, using OData query options.
            
## Authentication
            
Requires a valid API key in the X-API-KEY header.
            
## Headers
            
### Accept-Language
            
Indicates the preferred natural language and locale for localized content.
- omitted / null: content in the tenant's default culture.
- culture-code (e.g. en-US, es): content localized in the specified culture.
- * and q-factor weighting are currently not supported.
            
## OData Query Support
            
### $select
            
Comma-separated list of root-resource property names to include in the response.
See /Products/$metadata for the available properties.
Selecting properties of embedded resources is not supported.
            
Example: $select=prod_description,prod_tags
            
### $expand
            
Comma-separated list of embedded collections to include (e.g. Variants).
By default, embedded collections are not included.
Only embedded collections (not embedded resources) are supported.
            
Example: $expand=Variants
            
### $filter
            
OData v4.01 URI conventions. Filtering is restricted to properties of the root resource (Product).
            
Comparison operators: eq, ne, gt, ge, lt, le
            
Logical operators: and, or, not
            
Set operator: in
            
String functions: contains, startswith, endswith
            
Examples:
- $filter=prod_ref eq 'SKU-001'
- $filter=contains(prod_description, 'pro')
- $filter=prod_id gt 100 and contains(prod_description, 'pro')
            
### $orderby
            
Single property, ascending by default. Multi-property ordering and ordering on embedded
properties are not supported.
            
Examples:
- $orderby=prod_description
- $orderby=prod_ref desc
            
### Pagination — $top, $skip, $skipToken
            
- $top — maximum number of items returned.
- $skip — number of items to skip (offset paging).
- $skipToken — continuation-token paging. Recommended when no $orderby is applied
  (faster than offset paging).
            
Paging applies only to the root resource (Product), never to embedded collections.
            
## Response
            
200 OK — CollectionRepresentation with the matching Product resources, pagination
metadata (Count, Skip, Top, HasNext, continuation token) and the cultures echoed
from Accept-Language.
            
## Error Responses
            
- 400 Bad Request — Invalid OData expression or unsupported $orderby/$filter field
  (returns ValidationFailureRepresentation).
- 401 Unauthorized — Missing or invalid API key.
- 404 Not Found — Attribute Set with the given identifier does not exist.
- 500 Internal Server Error — Unexpected technical error.
            
## Example
            
Request:
http
GET /AttributeSets(7)/Products?$filter=contains(prod_description,'pro')&$top=20 HTTP/1.1
X-API-KEY: your-api-key-here
Accept-Language: en-US

            
Response:
http
HTTP/1.1 200 OK
Content-Type: application/json

## Get Attribute Set Metadata

 - [GET /AttributeSets/$metadata](https://docs.api.saleslayer.com/apis/catalog-v2.0/attribute-sets/getattributesetmetadataasync.md): Returns the public metadata of the Attribute Set model as a JSON schema document describing the resources (Product, Variant) associated to the Attribute Set and the relationships between them. Use it to build requests against the various methods of the API.

