Updating default variant via api to circumvent ecom bug
Due to a bug in ecom some products occasionally fail to update the default variant to the next in stock product. Causing some in stock product to appear as out of stock.
While we wait for this bug to be resolved, I've written a script to address the issue.
-It searches through all variants
-identifies any variant where the default product is out of stock and stock is present elsewhere in the matrix.
So far so good all of this works.
-The idea is then to update the affected product's default to an in stock variant.
Using the php client as documented on the api page:
"isDefault" => true,
Unfortunately I get the following error:
"The server understood the request, but is refusing to fulfill it: No "update" permission to "products" using this key"
Please advise, this bug is a major problem for us. If this is not something that can be run with our api key can someone in support put my script on a daily cron job or something?