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

Query Variants

Retrieves product variants, based on either choices (option-choice key-value pairs) or variant IDs.
See Stores Pagination for more information.

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}/variants/query

Path Params

NAME
TYPE
DESCRIPTION
id
Required

string

Requested product ID.

Body Params

NAME
TYPE
DESCRIPTION
choices

object

Set of key-value pairs. The specific choices available or chosen from within a selection (e.g., choosing the red Selection triggers the red Choice). You may specify all the relevant choices for a specific variant, or only some of the options, which will return all corresponding variants (not relevant when passing variant IDs).

variantIds

Array<string>

List of variant IDs (not relevant when passing choices).

paging

object

Response Object

NAME
TYPE
DESCRIPTION
variants

Array<object>

List of variants based on the specified filters and sorting.

metadata

object

totalResults

integer

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/variants/query' \
3 --data-binary '{}' \
4 -H 'Content-Type: application/json' \
5 -H 'Authorization: <AUTH>'

Response

json

1
2{
3 "variants": [ {
4 "id": "00000000-0000-0001-0005-7c2f8071346c",
5 "choices": {"Color": "Green"},
6 "variant": {
7 "priceData": {
8 "currency": "ILS",
9 "price": 35.95,
10 "discountedPrice": 35.95,
11 "formatted": {
12 "price": "35.95 ₪",
13 "discountedPrice": "35.95 ₪"
14 }
15 },
16 "weight": 0,
17 "sku": "K301",
18 "visible": true
19 }
20 }],
21 "metadata": {
22 "items": 1,
23 "offset": 0
24 },
25 "totalResults": 1
26}