Upcoming change to ProductVariants default parameters

Shopify Staff
Shopify Staff
469 36 92

Hey all,

When creating a new ProductVariant, there are going to be some changes to the defaults when not specified.

  • inventory_quantity now defaults to 0
  • inventory_management now defaults to shopify

The change to inventory_quantity is live, the change to inventory_management will come next week.  Please respond with any comments or questions.

Cheers,

Shopify Apps Team

Developer Experience @ Shopify
0 Likes
Shopify Partner
282 1 26

Awesome, Ryan!

Thanks for this change, it's very valuable for Excelify customers!
Actually, I noticed that this change was already functioning a couple of days ago, or was I mistaken?

Around this topic there is one strangeness however - when setting the inventory quantity (also through levels), if inventory_management is not "shopify", API wouldn't allow to set the quantity. But in reality that quantity might be already set to something.

Some time ago API allowed to set the quantity regardless of what the inventory_management is, but now it can't.

So in Excelify app context - if the user exports all variants with their quantities, they can't just import them back, because in some cases API will tell that you can't set the inventory because you don't have the inventory_management set to "shopify". I am working around that issue but still, you might think about that aspect.

The biggest issues of all is that with new multi-level inventory it got so slow to create Products with Variants. Products which we could create earlier in 0.25 seconds, now take 6 seconds if there are many variants with inventory. No REST API, no GraphQL API can solve this so far - because in either case we need to run as many requests as there are variants. Any improvements in that area would be totally awesome.

Overall - can feel and appreciate improvements happening, thanks for those!

Maris
Excelify.io

Excelify.io | Bulk Import Export Update Migrate | https://excelify.io
0 Likes
Shopify Staff
Shopify Staff
469 36 92

Hi Maris,

The change to the default inventory_quantity is already in yes. The inventory_management will go live next week.

inventory_management can also be set to a fulfillment service, so it's not only able to be set as shopify.

I understand the frustration with with the new product creation, the unfortunate fact is that as the models get more complicated, it will likely slow down.  However we are always working to speed things up on our end.

 

Cheers,

Developer Experience @ Shopify
1 Like
New Member
4 0 0

Ryan -

Currently we create variants that don't have inventory levels (i.e. made on demand goods) with the inventory_management value set to an empty string in order to have them set to "Don't track inventory" - will that still be an option or is that going away? I don't see that called out in the docs as an option either. If it's still going to be an option what should we need to send as the value?

Thanks,
Matt

0 Likes
Shopify Staff
Shopify Staff
469 36 92

Hi Matt,

To maintain that behaviour you should be passing null as the inventory_management to be explicit that you do not want inventory tracked.

 

 

 

Developer Experience @ Shopify
0 Likes
New Member
4 0 0

Ryan -

Good deal - I'll make that adjustment - thanks!

- Matt

0 Likes
Shopify Staff
Shopify Staff
469 36 92

The change to inventory_management will be shipping early this week!

Developer Experience @ Shopify
0 Likes
New Member
8 0 0

Hi, Ryan! I need to update product quantity with API, how can I do it now? with previous request I get 422 error b'{"errors":{"base":["Write requests to inventory_quantity and inventory_quantity_adjustment are no longer supported. Please use the Inventory Levels API."]}}'

0 Likes
Shopify Staff
Shopify Staff
469 36 92

Try this document: https://help.shopify.com/en/api/guides/updating-inventory

Developer Experience @ Shopify
0 Likes
New Member
11 0 0

Is there a way to set the inventory during creation of the product variant rather than having to make subsequent calls to the inventory APIs?  Right now if we're creating a decent number of variants, we now have to double the calls to make them available.  In addition, if we 're-upload' them.. essentially and update, the inventory gets zero'd out and we have to reset them all over again.

 

By the way, we are passing null (or not passing at all) inventory_management and it's still zeroing the inventory levels out and making the item unavailable.

0 Likes