A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
1) Where and how i can get Inventory item id without calling any other api?
2) is it fixed for a product variant?
Solved! Go to the solution
This is an accepted solution.
Inventory item is a combination of a variant and a location.
If you want to find quicky an inventory_item_id without using API, you can check that url (variant edit url + .json)
/admin/products/[ID_PRODUCT]/variants/[ID_VARIANT].json
the result can be:
{
variant: {
id: XXXX,
product_id: XXXX,
title: "Small",
price: "50.00",
sku: "",
position: 1,
inventory_policy: "deny",
compare_at_price: null,
fulfillment_service: "manual",
inventory_management: "shopify",
option1: "Small",
option2: null,
option3: null,
created_at: "2022-01-21T15:24:08+01:00",
updated_at: "2022-03-08T16:02:11+01:00",
taxable: true,
barcode: "",
grams: 0,
image_id: null,
weight: 0,
weight_unit: "lb",
inventory_item_id: XXXX,
inventory_quantity: 6,
old_inventory_quantity: 6,
tax_code: "",
requires_shipping: true,
admin_graphql_api_id: "gid://shopify/ProductVariant/XXXX"
}
}
This is an accepted solution.
Inventory item is a combination of a variant and a location.
If you want to find quicky an inventory_item_id without using API, you can check that url (variant edit url + .json)
/admin/products/[ID_PRODUCT]/variants/[ID_VARIANT].json
the result can be:
{
variant: {
id: XXXX,
product_id: XXXX,
title: "Small",
price: "50.00",
sku: "",
position: 1,
inventory_policy: "deny",
compare_at_price: null,
fulfillment_service: "manual",
inventory_management: "shopify",
option1: "Small",
option2: null,
option3: null,
created_at: "2022-01-21T15:24:08+01:00",
updated_at: "2022-03-08T16:02:11+01:00",
taxable: true,
barcode: "",
grams: 0,
image_id: null,
weight: 0,
weight_unit: "lb",
inventory_item_id: XXXX,
inventory_quantity: 6,
old_inventory_quantity: 6,
tax_code: "",
requires_shipping: true,
admin_graphql_api_id: "gid://shopify/ProductVariant/XXXX"
}
}