# Search Store Items

| GET | `/v1/search?type=storeItem` |
| --- | --------------------------- |

Search store items by product name in a specific store.

## Parameters

| ATTRIBUTE    | TYPE    | DESCRIPTION                                                                   |
| ------------ | ------- | ----------------------------------------------------------------------------- |
| retailerId\* | string  | Retailer identifier. (short names can be used)                                |
| q\*          | string  | Product name.                                                                 |
| limit        | integer | This is the maximum number of objects that may be returned. Default value: 16 |
| before       | string  | This is the cursor to return data on a page before it.                        |
| after        | string  | This is the cursor to return data from the next page.                         |

## Response

| ATTRIBUTE | TYPE                       | DESCRIPTION |
| --------- | -------------------------- | ----------- |
| items\*   | array \[CartProductOption] |             |
| paging\*  | Paging                     |             |

## Store Item

| ATTRIBUTE  | TYPE                    | DESCRIPTION                           |
| ---------- | ----------------------- | ------------------------------------- |
| sku\*      | string                  | store item identifier                 |
| name\*     | string                  | store item name                       |
| quantity\* | CartProductQuantity     | quantity of product items             |
| price      | CartItemPrice           | price for the number of products      |
| images\*   | array \[ImageContainer] |                                       |
| url        | string                  | link to the product page in the store |

## Paging

| ATTRIBUTE | TYPE    | DESCRIPTION |
| --------- | ------- | ----------- |
| cursors\* | Cursors |             |

## Cursors

| ATTRIBUTE | TYPE   | DESCRIPTION |
| --------- | ------ | ----------- |
| after     | string |             |
| before    | string |             |

### Sample Request

```bash
curl "https://graph.whisk.com/v1/search?type=storeItem&retailerId=tesco&q=milk" \
    -H "Accept: application/json" \
    -H "Authorization: Token <Access-Token>"
```

### Sample Response

```javascript
{
  "items": [
    {
      "sku": "272103606",
      "name": "Alpro Hazelnut Fresh Milk Alternative Longlife Milk Alternative 1 L",
      "quantity": {
        "count": 1
      },
      "price": {
        "list": 1.8
      },
      "images": [
        {
          "url": "https://img.tesco.com/Groceries/pi/866/5411188110866/IDShot_540x540.jpg"
        }
      ],
      "url": "https://www.tesco.com/groceries/en-GB/products/272103606"
    },
    ...
    {
      "sku": "251500030",
      "name": "Tesco Organic British Whole Milk 2.272L/4 Pints",
      "quantity": {
        "count": 1
      },
      "price": {
        "list": 1.84
      },
      "images": [
        {
          "url": "https://img.tesco.com/Groceries/pi/112/5050179762112/IDShot_540x540.jpg"
        }
      ],
      "url": "https://www.tesco.com/groceries/en-GB/products/251500030"
    }
  ],
  "paging": {
    "cursors": {
      "after": "eyJpZCI6IjI1MTUwMDAzMCIsImluZGV4Ijo5fQ=="
    }
  }
}
```
