Inventory item does not have inventory tracking enabled

Highlighted
New Member
1 0 2

Is it somehow possible to enable inventory tracking upon creating the products? Instead of checking each product individually after creation?

I get the error: 'Inventory item does not have inventory tracking enabled' when trying to set the inventory level.

Highlighted
Shopify Staff
Shopify Staff
644 78 141

Hey @malthemorsing,

 

When creating a product, you can set the variant.inventory_management property for each variant to correspond to your fulfillment service. If creating products in the admin, the drop-down menu is called Inventory managed by, if you're using the API you can find more information about setting this during variant creation here.

JB | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

Highlighted
Shopify Partner
3 0 4

Even when variant.inventory_management is set correctly it appears that I cannot update Inventory Levels unless the "Track quantity" checkbox has been manually checked via the Admin dash.  Is it possible to enable this 'Track quantity' option via the API?

 

 

Highlighted
Shopify Partner
3 0 4

Solved this by updating the product variant to the following:

'fulfillment_service'  => "manual",
'inventory_management' => "shopify",

I wasn't able to find this documented anywhere.  Hopefully, it helps someone else who needs to set Inventory via the API.

Highlighted
New Member
1 0 0

In my case, I found that "fulfillment_service" was being populated as "manual" by default, and the only property I needed to manually set was "inventory_management".

0 Likes
Highlighted
Shopify Partner
39 1 3

I'm having this same issue as well now. Saving the inventory_management field doesn't return an error and the change does not persist. Using the Python SDK v 7.0.1. 

 

shopify_variant = shopify.Variant.find(23082690379824)
del shopify_variant.attributes['inventory_quantity']
del shopify_variant.attributes['old_inventory_quantity']
shopify_variant.inventory_management = "shippingtree"
shopify_variant.fulfillment_service = "shippingtree"
shopify_variant.save()

shopify_variant = shopify.Variant.find(23082690379824)
print(shopify_variant.inventory_management)

Returns "None" 

 

The variant object looks like:

 

 

{
"admin_graphql_api_id": "gid://shopify/ProductVariant/23082690379824",
"barcode": "",
"compare_at_price": null,
"created_at": "2019-05-02T14:36:39-07:00",
"fulfillment_service": "manual",
"grams": 85,
"id": 23082690379824,
"image_id": null,
"inventory_item_id": 23671069507632,
"inventory_management": null,
"inventory_policy": "deny",
"inventory_quantity": 477,
"old_inventory_quantity": 477,
"option1": "Default Title",
"option2": null,
"option3": null,
"position": 1,
"price": "8.49",
"product_id": 2343423475760,
"requires_shipping": true,
"sku": "",
"taxable": false,
"title": "Default Title",
"updated_at": "2019-05-14T15:54:05-07:00",
"weight": 3.0,
"weight_unit": "oz"
}

 

 

 

0 Likes
Highlighted
New Member
1 0 1

Thanks. it's working 

Highlighted
Tourist
11 0 0

Looks like this is weirder than I would have guessed.   Yes, you can set and read this value.  That is the good news.   The bad news is that you do it through different-named critters.

To set the inventory tracking on (GraphQL), in the product update, set inventoryManagement:SHOPIFY

To read its value, read product.tracksInventory

That might turn the trick for you.  Did for me.  Cheers jb

0 Likes
Highlighted
Tourist
11 0 0

Too late to edit ... a correction:

To set the inventory tracking on (GraphQL), in the product update, on the variant (which may be the default variant) set inventoryManagement:SHOPIFY

To read its value, read product.tracksInventory

0 Likes