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

The product's options field

Copy
Copy

**Now let's query the availability of S **
Notice in the response that:

  1. Red is out of stock, because S+Red is out of stock
  2. availableForPurchase is false, because both size and color must be given for this product
Copy
Copy

**Now let's query the availability of S+Green **
Notice in the response that:

  1. We get the selected variant, with proper values for price, weight, SKU and inventory
  2. availableForPurchase is true
Copy
Copy
Was this helpful?
Yes
No