[英]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.