Gets inventory variant information based on the specified option choices.
The getInventoryVariants()
function returns a Promise that resolves to the specified inventory variant information.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function getInventoryVariants(
inventoryId: string,
options: GetInventoryVariantsOptions,
): Promise<GetInventoryVariantsResponse>;
Inventory item ID.
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
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.