Upcoming change to ProductVariants default parameters

Ryan
Shopify Staff
492 42 113

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)
Ryan
Shopify Staff
492 42 113

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
492 42 113

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
492 42 113

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
492 42 113

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
492 42 113

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