# Select Response Properties

Property selectors allow you to set which properties are returned in API responses. You can use them to remove unneeded properties from large responses, reducing their size.

To use property selectors include the `select` parameter in a request. For example, to select only the `name` property of [getProduct](/commerce-api/references/shopper-products?meta=getProduct), use the selector `select=(name)`:

```json
GET /product/shopper-products/v1/organizations/f_ecom_zzte_053/products/25604524M?siteId=RefArch&select=(name)

{
  "name": "Black Single Pleat Athletic Fit Wool Suit",
}
```

Selector values must be enclosed in parentheses. The following selectors are supported:

| Capability                                                      | Value of select parameter                         |
| --------------------------------------------------------------- | ------------------------------------------------- |
| Include a single property.                                      | `(property)`                                      |
| Exclude a single property.                                      | `(-property)`                                     |
| Include properties of all levels, including complex properties. | `(**)`                                            |
| Include properties of top level, except complex properties.     | `(*)`                                             |
| Include the child document properties.                          | `(property.(**))`                                 |
| Return the first document. Index starts with 0.                 | `(property[0].(**))`                              |
| Return the first 5 documents.                                   | `(property[0:4].(**))`                            |
| Return the second, fourth, and sixth documents.                 | `(property[1,3,5].(**))`                          |
| Return matching documents matching a condition.                 | `(property[?(@.key==val)])`                       |
| Return matching documents matching multiple conditions.         | `(property[?(@.key1==val1) \|\| ?(@.key2=val2)])` |

Use a comma-separated value to select multiple properties. For example, to select `name` and `recommendations` including its children, use the selector `select=(name,recommendations.(**)`:

```json
GET /product/shopper-products/v1/organizations/f_ecom_zzte_053/products/25604524M?siteId=RefArch&select=(name,recommendations.(**))

{
  "name": "Black Single Pleat Athletic Fit Wool Suit",
  "recommendations": [
    {
      "recommendationType": {
        "displayValue": "Product Detail Page - Cross Sell",
        "value": 1
      },
      "recommendedItemId": "25686544M"
    }
  ]
}
```

To select child properties, include all result levels. For example, to select the `productId` of `variants`, use the selector `select=(variants.(productId))`:

```json
GET /product/shopper-products/v1/organizations/f_ecom_zzrf_016/products/25604524M?siteId=RefArch&select=(variants.(productId))

{
  "variants": [
    {
      "productId": "750518699660M"
    }
  ]
}
```

Selectors can also be used to exclude properties. To exclude a property, first include a property. For example, to exclude `backorderable` from `inventory` use `select=(inventory.(*,-backorderable))`:

```json
GET /product/shopper-products/v1/organizations/f_ecom_zzrf_016/products/25604524M?siteId=RefArch&select=(inventory.(*,-backorderable))

{
  "inventory": {
    "ats": 1800,
    "id": "inventory_m",
    "orderable": true,
    "preorderable": false,
    "stockLevel": 1800
  }
}
```

Selectors can be used to filter documents based on one or more conditions. For example, to filter for `small` and `large` images use `select=(imageGroups[?(@.viewType==small || @.viewType==large)])`:

```json
GET /product/shopper-products/v1/organizations/f_ecom_zzrf_016/products/25604524M?siteId=RefArch&select=(imageGroups[?(@.viewType==small || @.viewType==large)])

{
  "imageGroups": [
    {
      "images": [],
      "viewType": "large"
    },
    {
      "images": [],
      "viewType": "small"
    }
  ]
}
```

:::note
Property selectors are only supported for a subset of Shopper endpoints. You can check endpoint whether an endpoint supports `select` by reviewing its query parameters in the [API Reference](https://developer.salesforce.com/docs/commerce/commerce-api/references).
:::
