ShopifAPI从库存\项目\ id获取产品变体

jecbmhm3  于 2021-09-29  发布在  Java
关注(0)|答案(0)|浏览(148)

我在使用shopifyapi从库存商品id获取变体时遇到问题。下面是来自 ShopifyAPI::Variant.find(:all) :

{"id"=>40232259485873, "title"=>"red", "price"=>"10.00", "sku"=>"1", "position"=>1, "inventory_policy"=>"deny", "compare_at_price"=>nil, "fulfillment_service"=>"manual", "inventory_management"=>"shopify", "option1"=>"red", "option2"=>nil, "option3"=>nil, "created_at"=>"2021-06-26T15:22:08-04:00", "updated_at"=>"2021-07-14T22:49:15-04:00", "taxable"=>true, "barcode"=>"", "grams"=>0, "image_id"=>nil, "weight"=>0.0, "weight_unit"=>"kg", "inventory_item_id"=>42322551111851, "inventory_quantity"=>8, "requires_shipping"=>true, "admin_graphql_api_id"=>"gid://shopify/ProductVariant/41111111111111"}

正如你所看到的 inventory_item_id42322551111851 . 但当我这么做的时候: product_variant = ShopifyAPI::Variant.find(:all, :params=> {:inventory_item_id => 42322551111851).first ,我得到的变体与 inventory_item_id 是我指定的。我使用的是api版本2021-04。任何帮助都会很好!

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题