> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # GetStoreVariant # Package: catalogV1 # Namespace: CatalogReadApi # Method link: https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/get-store-variant.md ## Permission Scopes: Read Products: SCOPE.DC-STORES.READ-PRODUCTS ## Introduction Retrieves a store variant with the provided ID. --- ## REST API ### Schema ``` Method: getStoreVariant Description: Retrieves a store variant with the provided GUID. URL: https://www.wixapis.com/stores-reader/v1/variants/{id} Method: GET # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: id Method parameters: param name: id | type: none | required: true Return type: GetStoreVariantResponse - name: variant | type: StoreVariant | description: The requested store variant. - name: id | type: string | description: Store variant GUID. Comprised of the `productId` and the `variantId`, separated by a hyphen: {productId}.{variantId}. - name: variantId | type: string | description: Variant GUID. - name: productId | type: string | description: Product GUID. - name: variantName | type: string | description: Variant name. - name: productName | type: string | description: Product name. - name: managedVariant | type: boolean | description: Whether the variant is managed or represents a product. - name: sku | type: string | description: Variant SKU (stock keeping unit). - name: stock | type: VariantStock | description: Variant inventory status. - name: trackQuantity | type: boolean | description: Whether inventory is being tracked. - name: quantity | type: integer | description: Quantity currently left in inventory. - name: inStock | type: boolean | description: Whether the product is currently in stock (relevant only when tracking manually). - name: choices | type: object | description: The selected options of this variant. For example, `{"Color": "Blue", "Size": "Large"}`. - name: collectionIds | type: array | description: Collections that include this variant. - name: media | type: PlatformMedia | description: Media items (images, videos) associated with this variant. - ONE-OF: - name: image | type: Image | description: - name: id | type: string | description: WixMedia image GUID. - name: url | type: string | description: Image URL. - name: height | type: integer | description: Original image height. - name: width | type: integer | description: Original image width. - name: altText | type: string | description: Image alt text. - name: filename | type: string | description: Image filename. - name: video | type: VideoV2 | description: - name: id | type: string | description: WixMedia GUID. - name: resolutions | type: array | description: Available resolutions for the video, starting with the optimal resolution. - name: url | type: string | description: Video URL. - name: height | type: integer | description: Video height. - name: width | type: integer | description: Video width. - name: format | type: string | description: Video format for example, mp4, hls. - name: filename | type: string | description: Video filename. - name: preorderInfo | type: PreorderInfo | description: Preorder information. - name: enabled | type: boolean | description: Whether the item is available for preorder. - name: message | type: string | description: A message the buyer will see when the item is out of stock and preorder is enabled. - name: limit | type: integer | description: Number of products that can be preordered after stock reaches zero. ``` ### Examples ### GetStoreVariant ```curl ~~~cURL curl -X GET \ 'https: //www.wixapis.com/stores/v1/variants/0614129c-8777-9f3b-4dfe-b80a54df10d5-00000000-0000-0020-0005-a316f7c67df7' \ -H 'Authorization: ' ~~~ ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.catalogV1.CatalogReadApi.getStoreVariant(_id) Description: Retrieves a store variant with the provided GUID. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: _id Method parameters: param name: _id | type: string | description: Store variant GUID. Comprised of the `productId` and the `variantId`, separated by a hyphen. For example, `{productId}-{variantId}`. | required: true Return type: PROMISE - name: variant | type: StoreVariant | description: The requested store variant. - name: _id | type: string | description: Store variant GUID. Comprised of the `productId` and the `variantId`, separated by a hyphen: {productId}.{variantId}. - name: variantId | type: string | description: Variant GUID. - name: productId | type: string | description: Product GUID. - name: variantName | type: string | description: Variant name. - name: productName | type: string | description: Product name. - name: managedVariant | type: boolean | description: Whether the variant is managed or represents a product. - name: sku | type: string | description: Variant SKU (stock keeping unit). - name: stock | type: VariantStock | description: Variant inventory status. - name: trackQuantity | type: boolean | description: Whether inventory is being tracked. - name: quantity | type: integer | description: Quantity currently left in inventory. - name: inStock | type: boolean | description: Whether the product is currently in stock (relevant only when tracking manually). - name: choices | type: object | description: The selected options of this variant. For example, `{"Color": "Blue", "Size": "Large"}`. - name: collectionIds | type: array | description: Collections that include this variant. - name: media | type: PlatformMedia | description: Media items (images, videos) associated with this variant. - ONE-OF: - name: image | type: string | description: - name: video | type: string | description: - name: preorderInfo | type: PreorderInfo | description: Preorder information. - name: enabled | type: boolean | description: Whether the item is available for preorder. - name: message | type: string | description: A message the buyer will see when the item is out of stock and preorder is enabled. - name: limit | type: integer | description: Number of products that can be preordered after stock reaches zero. ``` ### Examples ### Get store variant by ID ```javascript import { products } from "@wix/stores"; const storeVariantId = "5376f9ec-b92e-efa9-e4a1-f4f480aa0d3a-00000000-0000-0020-0005-ad9cdc10d3b8"; async function getStoreVariant() { const response = await products.getStoreVariant(storeVariantId); } /* Promise resolves to: * { * "_id": "5376f9ec-b92e-efa9-e4a1-f4f480aa0d3a-00000000-0000-0020-0005-ad9cdc10d3b8", * "variantId": "00000000-0000-0020-0005-ad9cdc10d3b8", * "productId": "5376f9ec-b92e-efa9-e4a1-f4f480aa0d3a", * "variantName": "250g | Stovetop", * "productName": "Indonesian Blend", * "managedVariant": true, * "sku": "", * "stock": { * "trackQuantity": false, * "quantity": 0, * "inStock": true * }, * "choices": { * "Weight": "250g", * "Ground for": "Stovetop" * }, * "collectionIds": [ * "32fd0b3a-2d38-2235-7754-78a3f819274a" * ], * "media": { * "items": [] * } * } */ ``` ### getStoreVariant (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { products } from '@wix/stores'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { products }, // Include the auth strategy and host as relevant }); async function getStoreVariant(_id) { const response = await myWixClient.products.getStoreVariant(_id); }; ``` ---