I'm having trouble using ShopifyAPI to get a variant from an inventory_item_id. Here's a sample response from 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"}
As you can see, the inventory_item_id is 42322551111851. But when I do this: product_variant = ShopifyAPI::Variant.find(:all, :params=> {:inventory_item_id => 42322551111851).first, I get the wrong variant which doesn't match with the inventory_item_id that I specified. If I remove :all I get the error message:
ActiveResource::BadRequest: Failed. Response code = 400. Response message = Bad Request (id; expected String to be a id).
I'm using API version 2021-04. Any help would be great!