[英]Shopify API How to update Inventory Level via the Shopify API Gem
任何人都知道如何通過 Shopify API Gem 更新變體庫存水平?
我已經嘗試了所有我能想到的方法,包括查看寶石規格,但沒有運氣。
我有正確的location_id
以及inventory_item_id
和read_inventory, write_inventory
范圍。 以及有效的session
我試過以下沒有運氣
payload = {"location_id":xxxxxx, "inventory_item_id":xxxxxx, "available":144}
然后:
level = ShopifyAPI::InventoryLevel.find(:all, params: payload)
level.set
level.connect
level.adjust
level.save
ShopifyAPI::InventoryLevel.set(payload)
ShopifyAPI::InventoryLevel.new(payload)
ShopifyAPI::InventoryLevel.create(payload)
ShopifyAPI::InventoryLevel.adjust(payload)
ShopifyAPI::InventoryLevel.update(payload)
我在哪里 go 錯了?
咳咳,我想通了。 如果它被記錄在某個地方會很好..一個男孩可以做夢
但是你首先必須像這樣創建一個InventoryLevel
的實例:
payload = {"location_id":xxx, "inventory_item_id":xxx}
level = ShopifyAPI::InventoryLevel.new(payload)
然后像這樣在該實例上設置庫存:
level.set(69)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.