Upcoming change to ProductVariants default parameters

Shopify Staff
Shopify Staff
469 36 92

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

Developer Experience @ Shopify
0 Likes
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.

0 Likes
Shopify Staff
Shopify Staff
469 36 92

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

Developer Experience @ Shopify
0 Likes
New Member
11 0 0

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

0 Likes
Shopify Staff
Shopify Staff
469 36 92

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

Cheers.

Developer Experience @ Shopify
0 Likes
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.

0 Likes
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.

 

 

 

0 Likes
Shopify Staff
Shopify Staff
469 36 92

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.

Developer Experience @ Shopify
0 Likes
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.  

0 Likes
Shopify Staff
Shopify Staff
469 36 92

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

Developer Experience @ Shopify
1 Like