getInventoryVariants( )


Gets inventory variant information based on the specified option choices.

The getInventoryVariants() function returns a Promise that resolves to the specified inventory variant information.

Authentication

This function requires elevated permissions and runs only on the backend and on dashboard pages.

Permissions
Manage Stores - all permissions
Manage Products
Read Stores - all read permissions
Read Products
Learn more about app permissions.
Method Declaration
Copy
function getInventoryVariants(
  inventoryId: string,
  options: GetInventoryVariantsOptions,
): Promise<GetInventoryVariantsResponse>;
Method Parameters
inventoryIdstringRequired

Inventory item ID.


optionsGetInventoryVariantsOptions
Returns
Return Type:Promise<GetInventoryVariantsResponse>
JavaScript
import { inventory } from "wix-stores.v2"; async function getInventoryVariants(inventoryId, options) { try { const result = await inventory.getInventoryVariants(inventoryId, options); 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?