Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Viewing all articles
Browse latest Browse all 4623

Shopify REST API adjusting InventoryLevel doesn't works

$
0
0

I am building an job that interacts with Shopify API with shopify-api-ruby gem, here the test code:

LOCATION_ID = '61167763535'VARIANT_ID = '41932294357071'variant = ShopifyAPI::Variant.find(id: VARIANT_ID)inventory_item = ShopifyAPI::InventoryItem.find(id: variant.inventory_item_id)inventory_level = ShopifyAPI::InventoryLevel.all(inventory_item_ids: inventory_item.id.to_s, location_ids: '61167763535').firstinventory_level.adjust(inventory_item_id: inventory_item.id, location_id: LOCATION_ID, available_adjustment: 10)

It fetches variant, inventory_item for this variant, and then inventory_level for that variant, and all is going perfect till when I am trying to adjust inventory_level and got an error:

{"errors":"Not Found","error_reference":"If you report this error, please include this id: cdbae146-8541-4b99-ade1-631b793ea6ff-1723807714."}

I can't figure out what I am doing wrong, I trying several a bit another approaches described here - https://shopify.dev/docs/api/admin-rest/2024-04/resources/inventorylevel#post-inventory-levels-adjust, but I got same error. Can anyone tell me what I am doing wrong and how to fix that?


Viewing all articles
Browse latest Browse all 4623

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>