A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
I would like to change inventory quantity of products, but I don't even know how to do that.
Here is a part of example to list a product I try to do.
product = shopify.Product()
product.title = "example"
product.save()
Solved! Go to the solution
This is an accepted solution.
The SDK should be similar to Shopify Admin API, so check the API docs on inventory handling:
https://shopify.dev/api/admin/rest/reference/inventory
https://shopify.dev/api/examples/product-inventory
Inventory is now tracked against InventoryItem and InventoryLevel in connection to a Location on each product variant.
I'm not familiar with the Python SDK, not sure if InventoryItem will be auto-populated on the Variant object, but I'm guessing after saving the product, you can do something like:
inv = shopify.InventoryLevel()
inv.set(inventory_item_id=variant.inventory_item_id, location_id=<location id>, available=<quantity>)
Should return a collection, then call set() method to set the inventory for a location.
This is an accepted solution.
The SDK should be similar to Shopify Admin API, so check the API docs on inventory handling:
https://shopify.dev/api/admin/rest/reference/inventory
https://shopify.dev/api/examples/product-inventory
Inventory is now tracked against InventoryItem and InventoryLevel in connection to a Location on each product variant.
I'm not familiar with the Python SDK, not sure if InventoryItem will be auto-populated on the Variant object, but I'm guessing after saving the product, you can do something like:
inv = shopify.InventoryLevel()
inv.set(inventory_item_id=variant.inventory_item_id, location_id=<location id>, available=<quantity>)
Should return a collection, then call set() method to set the inventory for a location.
Thank you for your help
I didn't even understand what location was.
I could manage inventory.
I appreciate it again!
Hi, can you please tell me how did you acheive this via api?
hi, should i install any libraries for acheiving that and also can you please tell me where should i write this code