Hi folks,
In my case, I want to update variant’s inventory but I only have its SKU.
Is there a way to query variant knowing only its SKU?
It seems querying variants is only possible by knowing its inventoryId
.
So the only solution I see is to
- query all products with their variants
- manually find the products with specific variant’s sku
- get its inventoryId & variantId
- Update inventory
Hello Michal,
I’ve got kind of the same issue. The inventory API is quite new and I believe they (Wix Store team) haven’t figure out everything.
The suggestion I got was to build a variantID - SKU collection so you can look up for variant id more easily
Now regarding your solution how are going to find the product that contains the variant SKU? Nor SKU nor variant are available in the Store/Product collection?
Another solution might be to use https://www.wix.com/corvid/reference/wix-stores-backend.html#updateInventoryVariantFieldsByExternalId
and set the external id to the product SKU
Or you can hack the custom field to hold a list of SKU for a product
Would that work?