> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Use Cases

## Article: Use Cases

## Article Link: https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/use-cases.md

## Article Content:

# Use Cases

In this example we will query a product variant: 
* The product is a `Shirt`.
* The `Shirt` has 2 **options** - `Size` and `Color`.
* The size option has 3 **choices** - `S`/`M`/`L`.
* The color option has 3 **choices** - `Red`/`Green`/`Blue`.
* The product **variant** `S`+`Red` is out of stock.

**Call [Get Product](https://dev.wix.com/docs/rest/business-solutions/stores/catalog/get-product.md) to retrieve product options**

::::tabs
:::REST_TAB
```curl
    curl -X GET \
    'https: //www.wixapis.com/stores/v1/products/91f7ac8b-2baa-289c-aa50-6d64764f35d3' \
    -H 'Authorization: <AUTH>'
   ```
:::
:::SDK_TAB
```js
import { products } from "@wix/stores";

const id = "91f7ac8b-2baa-289c-aa50-6d64764f35d3"

async function getProduct(id) {
  const response = await products.getProduct(id);
}
```
:::
::::

```json
{
  ...
  "productOptions": [
    {
      "optionType": "drop_down",
      "name": "Size",
      "choices": [
        {
          "value": "S",
          "description": "S",
          "inStock": true,
          "visible": true
        },
        {
          "value": "M",
          "description": "M",
          "inStock": true,
          "visible": true
        },
        {
          "value": "L",
          "description": "L",
          "inStock": true,
          "visible": true
        }
      ]
    },
    {
      "optionType": "color",
      "name": "Color",
      "choices": [
        {
          "value": "#FF0000",
          "description": "Red",
          "inStock": true,
          "visible": true
        },
        {
          "value": "#00FF00",
          "description": "Green",
          "inStock": true,
          "visible": true
        },
        {
          "value": "#00000FF",
          "description": "Blue",
          "inStock": true,
          "visible": true
        }
      ]
    }
  ]
}
```

**Call [Get Product Options Availability](https://dev.wix.com/docs/rest/business-solutions/stores/catalog/get-product-options-availability.md) to retrieve the `S` size availability**  

Notice in the response that:
- `Red` is out of stock because `S`+`Red` is out of stock.
- `availableForPurchase` is false because both size and color must be given for this product.

::::tabs
:::REST_TAB
```curl
   curl -X POST \
    'https://www.wixapis.com/stores/v1/products/1044e7e4-37d1-0705-c5b3-623baae212fd/productOptionsAvailability' \
    -d '{
          "options": {
            "size": "S"
          }
        }' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: <AUTH>'
   ```
:::
:::SDK_TAB
```js
import { products } from "@wix/stores";

const id = "1044e7e4-37d1-0705-c5b3-623baae212fd"

const options = {
  size = "S"
}

async function getProductOptionsAvailability(id, options) {
  const response = await products.getProductOptionsAvailability(id, options);
}
```
:::
::::

```json
{
  "productOptions": [
    {
      "optionType": "drop_down",
      "name": "Size",
      "choices": [
        {
          "value": "S",
          "description": "S",
          "inStock": true,
          "visible": true
        },
        {
          "value": "M",
          "description": "M",
          "inStock": true,
          "visible": true
        },
        {
          "value": "L",
          "description": "L",
          "inStock": true,
          "visible": true
        }
      ]
    },
    {
      "optionType": "color",
      "name": "Color",
      "choices": [
        {
          "value": "#FF0000",
          "description": "Red",
          "inStock": false,
          "visible": true
        },
        {
          "value": "#00FF00",
          "description": "Green",
          "inStock": true,
          "visible": true
        },
        {
          "value": "#00000FF",
          "description": "Blue",
          "inStock": true,
          "visible": true
        }
      ]
    }
  ],
  "availableForPurchase": false
}
```

**Call [Get Product Options Availability](https://dev.wix.com/docs/rest/business-solutions/stores/catalog/get-product-options-availability.md) to retrieve the availability of `S`+`Green`**

Notice in the response that:
- We get the selected variant, with proper values for price, weight, SKU and inventory.
- `availableForPurchase` is true.

::::tabs
:::REST_TAB
```curl
   curl -X POST \
    'https://www.wixapis.com/stores/v1/products/1044e7e4-37d1-0705-c5b3-623baae212fd/productOptionsAvailability' \
    -d '{
          "options": {
            "size": "S",
            "color": "Green"
          }
        }' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: <AUTH>'
   ```
:::
:::SDK_TAB
```js
import { products } from "@wix/stores";

const id = "1044e7e4-37d1-0705-c5b3-623baae212fd"

const options = {
    size = "S"
    color = "Green"
}

async function getProductOptionsAvailability(id, options) {
  const response = await products.getProductOptionsAvailability(id, options);
}
```
:::
::::

```json
{
  "selectedVariant": {
    "price": {
      "currency": "USD",
      "price": 81,
      "discountedPrice": 81,
      "formatted": {
        "price": "$81.00",
        "discountedPrice": "$81.00"
      }
    },
    "weight": 0,
    "sku": "364215376135191",
    "inStock": true,
    "visible": true
  },
  "productOptions": [
    {
      "optionType": "drop_down",
      "name": "Size",
      "choices": [
        {
          "value": "S",
          "description": "S",
          "inStock": true,
          "visible": true
        },
        {
          "value": "M",
          "description": "M",
          "inStock": true,
          "visible": true
        },
        {
          "value": "L",
          "description": "L",
          "inStock": true,
          "visible": true
        }
      ]
    },
    {
      "optionType": "color",
      "name": "Color",
      "choices": [
        {
          "value": "#FF0000",
          "description": "Red",
          "inStock": false,
          "visible": true
        },
        {
          "value": "#00FF00",
          "description": "Green",
          "inStock": true,
          "visible": true
        },
        {
          "value": "#00000FF",
          "description": "Blue",
          "inStock": true,
          "visible": true
        }
      ]
    }
  ],
  "availableForPurchase": true
}
```