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.

Shopify API error Not Found /adjust.json Python

Solved

Shopify API error Not Found /adjust.json Python

daniel991
Visitor
2 1 0

Hi,

 

I have the next problem, I try to adjust inventory item but i got error 

 

 

 

 

pyactiveresource.connection.ResourceNotFound: Not Found: https://my-shop-name.shopify.com/admin/inventory_levels/adjust.json

 

 

 

 

Here is my code:

 

 

 

 

shop_url = "https://%s:%s@my-shop-test.myshopify.com/admin/" % ('apiuser', 'apipass')
shopify.ShopifyResource.set_site(shop_url)
shop = shopify.Shop.current
inv = shopify.InventoryLevel()
shopify.InventoryLevel.adjust(location_id = locationid, inventory_item_id=iventoryid, available_adjustment=6)

 

 

 

 

Why I got this error?

 

Thanks

Accepted Solution (1)
daniel991
Visitor
2 1 0

This is an accepted solution.

EDIT SOLUTION:

I got wrong location id and item_inventory_id

If others want to help you need to get location id from 

for location in shopify.Location.find():
    print(location.id)

and product inventory_item_id for every variant

for product in shopify.Product.find():
    print(product.variants[0].inventory_item_id)

 

I try and now i got this error 

 

pyactiveresource.connection.ResourceNotFound: Not Found: https://site.myshopify.com/admin/api/2022-04/inventory_levels/adjust.json

 

View solution in original post

Replies 2 (2)

toobiza
Shopify Partner
35 5 7

In the url, you need to specify the api version, for instance 2022-04. Check example here.

daniel991
Visitor
2 1 0

This is an accepted solution.

EDIT SOLUTION:

I got wrong location id and item_inventory_id

If others want to help you need to get location id from 

for location in shopify.Location.find():
    print(location.id)

and product inventory_item_id for every variant

for product in shopify.Product.find():
    print(product.variants[0].inventory_item_id)

 

I try and now i got this error 

 

pyactiveresource.connection.ResourceNotFound: Not Found: https://site.myshopify.com/admin/api/2022-04/inventory_levels/adjust.json