Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

tracksinventory in grapgql

tracksinventory in grapgql

xapogo
Tourist
9 2 3

Good morning.

I'm creating products with graphql but a need to make true tracksinventory.

with productcreate, i try to insert tracksinventory but it's no possible so i try with productupdate: InputObject 'ProductInput' doesn't accept argument 'tracksinventory'"

So, any one could tell me how i can activate this field please?

 

Thks

Reply 1 (1)

awwdam
Shopify Staff
249 42 38

Hey @xapogo

If you are looking for 'inventory' fields mentioned, these can be found on the InventoryItem object:
InventoryItem.tracked(GraphQL), InventoryItem.trackedEditable (GraphQL)

There is a short introduction to this object in the REST docs that explains a bit more about how InventoryItem works: 

"There is a 1:1 relationship between a product variant and an inventory item. Each product variant includes the ID of its related inventory item."

To utilize these APIs you will also need to update an application's access scopes to include: read_inventorywrite_inventoryClick here for the GraphQL documentation that provides a more detailed overview of all objects, queries, and mutations related to the functionality mentioned in your post.

Hope that offer a good starting point - Best!


awwdam | API Support @ 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 Shopify.dev or the Shopify Web Design and Development Blog