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 to retrieve product options

Copy
Copy

Call Get Product Options Availability 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.
Copy
Copy

Call Get Product Options Availability 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.
Copy
Copy
Did this help?