getStoreVariant( )


Retrieves a store variant with the provided ID.

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.
Method Declaration
Copy
function getStoreVariant(_id: string): Promise<GetStoreVariantResponse>;
Method Parameters
_idstringRequired

Store variant ID. Comprised of the productId and the variantId, separated by a hyphen. For example, {productId}-{variantId}.

Returns
Return Type:Promise<GetStoreVariantResponse>
JavaScript
import { products } from "wix-stores.v2"; async function getStoreVariant(id) { try { const result = await products.getStoreVariant(id); return result; } catch (error) { console.error(error); // Handle the error } }
Errors

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

Did this help?