Anchor to inventoryIteminventory
inventoryItem
query
Returns an InventoryItem object by ID.
Anchor to Possible returnsPossible returns
- Anchor to InventoryItemInventory•
Item Represents the goods available to be shipped to a customer. It holds essential information about the goods, including SKU and whether it is tracked. Learn more about the relationships between inventory objects.
Was this section helpful?
- Get details about a specified inventory item
- Get inventory item levels and product/variant information
Examples
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query inventoryItem {
inventoryItem(id: "gid://shopify/InventoryItem/30322695") {
id
tracked
sku
}
}`,
);
const data = await response.json();
query inventoryItem {
inventoryItem(id: "gid://shopify/InventoryItem/30322695") {
id
tracked
sku
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "query inventoryItem { inventoryItem(id: \"gid://shopify/InventoryItem/30322695\") { id tracked sku } }"
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
query inventoryItem {
inventoryItem(id: "gid://shopify/InventoryItem/30322695") {
id
tracked
sku
}
}`,
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: `query inventoryItem {
inventoryItem(id: "gid://shopify/InventoryItem/30322695") {
id
tracked
sku
}
}`,
});
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
query inventoryItem {
inventoryItem(id: "gid://shopify/InventoryItem/30322695") {
id
tracked
sku
}
}
QUERY
response = client.query(query: query)
Response
JSON{
"inventoryItem": {
"id": "gid://shopify/InventoryItem/30322695",
"tracked": true,
"sku": "element-151"
}
}