How To Safely and Efficiently Sync Products and Inventory Using ProductSet Mutation?

As already mentioned across several topics, the ProductSet mutation does not provide measurement (inventoryItem) information, which leads to the frustrating situation of piecing many things together (…).

Now, what is the best approach to handle this?

  1. First, we create (or update!) a Product using ProductSet. We add everything we know about variants in the ProductSet.

How do we update the inventory item?

  • Using the InventoryItem mutation requires tracking all IDs of all variants. How is this even feasible? This task requires far too many query calls.
  • Using productVariantsBulkCreate requires deleting all variants first, meaning we’d need to query them all beforehand. That’s too many calls.
  • Using productVariantsBulkUpdate faces the same issue.

Shopify, please provide a clear and straightforward guide on how to achieve this. The perfectly functional REST API is being deprecated, yet the suggested migration path using ProductSet is not viable.

We are syncing thousands of products, each with many variations. How should we handle this? What are the suggested steps? The guide should not contain the process of creating, also updating must be supported.

2 Likes

Dude, as mentioned on the other thread. People are asking how to do this via an API call. You’re providing a solution from a store owners POV and not for apps that want to do it.

Also sensing a bit of AI here :thinking:

Struggling with same problems. We should be able to update all necessary information at one request. Waiting for Shopify official guidance according to these issues.

It seems there will be a solution available soon: Unable to control inventory tracking using productSet mutation - #17 by Asaf_Gitai

2 Likes

Amazing, thanks for the update!