Search.../
  1. Home
  2. Getting Started
  3. Overview
Generate a test token to explore our APIs

Product Options Availability

Developer Preview

Gets the availability of relevant product variants based on the product ID and selections provided. See Use Cases for an example.

Authorization

This endpoint requires an authorization header - pass the access token from the OAuth installation flow.

Permissions

This endpoint requires the Read Products or the Manage Products permission scope.

POST

https://www.wixapis.com/stores/v1/products/{id}/productOptionsAvailability

Path Params

NAME
TYPE
DESCRIPTION
id
Required

string

Requested product ID.

Body Params

NAME
TYPE
DESCRIPTION
options
Required

object

Set of key-value pairs. Array containing the selected options (e.g, color: Blue, size: Large).

Response Object

NAME
TYPE
DESCRIPTION
selectedVariant

object

Variant information, given that all the choices were provided.

media

object

Information about media items (images, videos, etc.) associated with this choice.

productOptions

Array<object>

Options information (color, size, etc.) for this product, with the inventory and visibility fields updated based on the provided choices.

availableForPurchase

boolean

Whether all the selected choices result in a visible, in-stock variant.

Status/Error Codes

The response will include an HTTP status code.

Was this helpful?

Request

curl

Copy Code
1curl -X POST \
2 'https://www.wixapis.com/stores/v1/products/1044e7e4-37d1-0705-c5b3-623baae212fd/productOptionsAvailability' \
3 --data-binary '{
4 "options": {
5 "Size": "S",
6 "Color": "Green"
7 }
8 }' \
9 -H 'Content-Type: application/json' \
10 -H 'Authorization: <AUTH>'

Response

json

1
2{
3 "productOptions": [ {
4 "optionType": "color",
5 "name": "Color",
6 "choices": [
7 {
8 "value": "#008000",
9 "description": "Green",
10 "inStock": true,
11 "visible": true
12 },
13 {
14 "value": "#800080",
15 "description": "Purple",
16 "inStock": true,
17 "visible": true
18 }
19 ]
20 }],
21 "availableForPurchase": false
22}