Solved

TracksInventory field in GraphQL vs RestAPI

samwise
Shopify Partner
31 0 6

Hi folks,  I am curious if tracksInventory in GraphQL is carrying the same meaning as inventory_management in RestAPI.

 

 tracksInventory.png

Accepted Solution (1)

hassain
Shopify Staff (Retired)
624 104 187

This is an accepted solution.

Hi @samwise ,

 

These two fields are very similar but are not exactly the same.

 

For the "inventory_management" field for Product Variants in the REST API, it is used to report the fulfillment service that is tracking the inventory of this product variant. So this field will return "Shopify" if inventory is managed by Shopify, the handle of the fulfillment service if the product variant is being handled by a third party fulfillment service, or "null" if the inventory is not being tracked at all

 

For the "trackInventory" field for the Product in the GraphQL API, it is a boolean that returns true if the inventory tracking has been enabled for this product and false if the inventory tracking has not being enabled

 

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

Replies 4 (4)

hassain
Shopify Staff (Retired)
624 104 187

This is an accepted solution.

Hi @samwise ,

 

These two fields are very similar but are not exactly the same.

 

For the "inventory_management" field for Product Variants in the REST API, it is used to report the fulfillment service that is tracking the inventory of this product variant. So this field will return "Shopify" if inventory is managed by Shopify, the handle of the fulfillment service if the product variant is being handled by a third party fulfillment service, or "null" if the inventory is not being tracked at all

 

For the "trackInventory" field for the Product in the GraphQL API, it is a boolean that returns true if the inventory tracking has been enabled for this product and false if the inventory tracking has not being enabled

 

To learn more visit the Shopify Help Center or the Community Blog.

samwise
Shopify Partner
31 0 6

@hassain thanks so much! Is there a plan to have a similar "trackInventory" in RestAPI?  

hassain
Shopify Staff (Retired)
624 104 187

Hi @samwise ,

 

As far as I am aware there are no plans to add this field to the REST Admin API, but you can always keep an eye out on our API Changelog to see if this or another similar feature get added in: https://developers.shopify.com/changelog

 

To learn more visit the Shopify Help Center or the Community Blog.

btrain-004
Shopify Partner
12 0 3

Looks like things changed again. `trackInventory` is no longer part of the the ProductVariant. 

 

However, I believe you can use `inventoryItem` instead

 

inventoryItem {
   inventoryHistoryUrl
}

Screenshot 2023-04-19 at 6.13.02 AM.png