POST

Query Product Variants


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

Permissions
Manage Stores - all permissions
Read Stores - all read permissions
Manage Orders
Manage Products
Read Products
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/stores-reader/v1/products/{id}/variants/query

Path Params
idstringRequired

Requested product ID.

Body Params
choicesMap <string, string>format map

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).


variantIdsArray <string>

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


pagingPaging

includeMerchantSpecificDataboolean

Whether merchant specific data should be included in the response. Requires permissions to manage products.

Response Object
variantsArray <Variant>

List of variants based on the specified filters and sorting.


metadataMetadata

totalResultsinteger
Query Product Variants Example 1
Request
cURL
curl -X POST \ 'https://www.wixapis.com/stores/v1/products/0614129c-8777-9f3b-4dfe-b80a54df10d5/variants/query' \ --data-binary '{ "choices": { "Weight": "250g" }, "includeMerchantSpecificData": true }' \ -H 'Content-Type: application/json' \ -H 'Authorization: <AUTH>'
Response
JSON
{ "variants": [ { "id": "00000000-0000-0020-0005-a316e6ba5b37", "choices": { "Weight": "250g", "Ground for": "Stovetop" }, "variant": { "priceData": { "currency": "USD", "price": 35, "discountedPrice": 30, "formatted": { "price": "$35.00", "discountedPrice": "$30.00", "pricePerUnit": "$0.12" }, "pricePerUnit": 0.12 }, "convertedPriceData": { "currency": "USD", "price": 35, "discountedPrice": 30, "formatted": { "price": "$35.00", "discountedPrice": "$30.00", "pricePerUnit": "$0.12" }, "pricePerUnit": 0.12 }, "costAndProfitData": { "itemCost": 20, "formattedItemCost": "$20.00", "profit": 10, "formattedProfit": "$10.00", "profitMargin": 0.3333 }, "weight": 0.25, "sku": "10001", "visible": true } }, { "id": "00000000-0000-0021-0005-a316e6ba5b37", "choices": { "Weight": "250g", "Ground for": "Filter" }, "variant": { "priceData": { "currency": "USD", "price": 35, "discountedPrice": 30, "formatted": { "price": "$35.00", "discountedPrice": "$30.00", "pricePerUnit": "$0.12" }, "pricePerUnit": 0.12 }, "convertedPriceData": { "currency": "USD", "price": 35, "discountedPrice": 30, "formatted": { "price": "$35.00", "discountedPrice": "$30.00", "pricePerUnit": "$0.12" }, "pricePerUnit": 0.12 }, "costAndProfitData": { "itemCost": 20, "formattedItemCost": "$20.00", "profit": 10, "formattedProfit": "$10.00", "profitMargin": 0.3333 }, "weight": 0.25, "sku": "10003", "visible": true } } ], "metadata": { "items": 2, "offset": 0 }, "totalResults": 2 }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?