Upcoming change to ProductVariants default parameters

Ryan
Shopify Staff
Shopify Staff
499 42 120

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

Ryan | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Replies 23 (23)
Maris
Shopify Partner
313 5 71

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

Matrixify (Excelify) | Bulk Import Export Update Migrate | https://matrixify.app
Ryan
Shopify Staff
Shopify Staff
499 42 120

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,

Ryan | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Matt_Burton
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

Ryan
Shopify Staff
Shopify Staff
499 42 120

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.

 

 

 

Ryan | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

Matt_Burton
New Member
4 0 0

Ryan -

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

- Matt

Ryan
Shopify Staff
Shopify Staff
499 42 120

The change to inventory_management will be shipping early this week!

Ryan | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

nata502ly
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."]}}'

Ryan
Shopify Staff
Shopify Staff
499 42 120

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

Ryan | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

George33
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.

Ryan
Shopify Staff
Shopify Staff
499 42 120

You can set inventory upon product creation only by using the GraphQL Admin API.  You cannot do this in REST any more unfortunately.

Ryan | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

George33
New Member
11 0 0

Well.. fiddle.  I'd love to understand how to basically make our items not-inventoried.. my only solve right now is to set the inventory to a rather gigantic number.  

 

I've tried when creating the variant to set inventory_policy = "continue", but that doesn't seem to work either.. once inventory is zero, product is unavailable.

Ryan
Shopify Staff
Shopify Staff
499 42 120

Hey George,

It should simply be "inventory_management": null to not track inventory on product create.

 

{
  "product": {
    "title": "Test product no inventory",
    "inventory_management": null
  }
}

The above works for me testing in Postman

Ryan | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

George33
New Member
11 0 0

Documentation doesn't specify inventory_management as part of product creation.  I'll give it a whirl!

Ryan
Shopify Staff
Shopify Staff
499 42 120

It's not required, but you can specify such as above.

Cheers.

Ryan | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

George33
New Member
11 0 0

Well, unfortunately, that didn't work.. here's snippet of the PUT that we're sending to 

"/admin/products/" + shopifyProductId + ".json"

ShopifyProduct(id=1491154665551, title=New Product, handle=New Product, vendor=GearLaunch, fulfillment_service=GearLaunch, body_html=null, product_type=Apparel, inventory_management=null, variants=...

It resets the inventory levels to 0 and .. tadah, angry customers.  Sigh.

George33
New Member
11 0 0

I just tried a new product.. setting it from the start.  Creating a new product works fine (always has actually). However as soon as we 'update' the product (resync with the PUT), even though inventory_management is still null, we get a 0 inventory and the item is out of stock.

 

 

 

Ryan
Shopify Staff
Shopify Staff
499 42 120

If you provide a request-ID I can look into it.  I do see products on that shop with inventory_management: null and no quantity created successfully.

Ryan | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

George33
New Member
11 0 0

Yep.. again, creating them works fine.  Updating (the PUT call to "/admin/products/" + shopifyProductId + ".json") is what seems to shoot us in the head.  

Ryan
Shopify Staff
Shopify Staff
499 42 120

you probably are trying to update the product instead of the product variant to "inventory_management": null

Ryan | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

George33
New Member
11 0 0

Sorry, I thought that's what you were telling me to do.  I'll try the product variant instead.

George33
New Member
11 0 0

holy cow that worked.. THANKS!!!!

nata502ly
New Member
8 0 0

 Ryan, please help with request to update product quantity, can't find it on documentation.

Before changes I have used request:

payload = {
                    "variant": {
                    "id":''' + str(promotion_inventory_id) + ''',
                    "inventory_policy":'''+'"'+inventory_policy+'"'+''', 
                    "inventory_management": "shopify",
                    "inventory_quantity":'''+ str(n) + '''
                          }
              }
        response = request.put(
            'https://' + shopify_store + '.myshopify.com/admin/variants/' + str(promotion_inventory_id) + ".json", json=payload)

 

 

 

 

Steve54
Shopify Partner
7 0 1

HI Ryan,

We have a fulfillment app that was working fine until the past few days, however now it won't return fulfillment tracking numbers and PDF labels to our app in Shopify stores.  I'm not sure if this has anything to do with the inventory_management change defaulting to 'shopify' now?  I think previously we had it as 'Manual'.  Would this matter and should we change it to shopify to have fulfillment data get returned correctly to the app and shopify stores?

Thank you.

Steve