inventory Levelquery
query
2024-10latest
Returns an InventoryLevel object by ID.
Arguments
The ID of the InventoryLevel to return.
Was this section helpful?
InventoryLevel possible returns
The quantities of an inventory item that are related to a specific location. Learn more about the relationships between inventory objects.
Was this section helpful?
Code examples for QUERY: inventoryLevel
Query Reference for QUERY: inventoryLevel
"{\n inventoryLevel(id) {\n # InventoryLevel fields\n }\n}"
Input Reference for QUERY: inventoryLevel
Schema Reference for QUERY: inventoryLevel
Display Examples for QUERY: inventoryLevel
[ { "example": { "type_name": "inventorylevel", "title": "Get the location, inventory item, and quantities for an inventory level", "query_string": "query {\n inventoryLevel(id: \"gid://shopify/InventoryLevel/523463154?inventory_item_id=30322695\") {\n id\n quantities(names: [\"available\", \"incoming\", \"committed\", \"damaged\", \"on_hand\", \"quality_control\", \"reserved\", \"safety_stock\"]) {\n name\n quantity\n }\n item {\n id\n sku\n }\n location {\n id\n name\n }\n }\n}", "query_arguments": { "id": "gid://shopify/InventoryLevel/523463154?inventory_item_id=30322695" }, "response": { "data": { "inventoryLevel": { "id": "gid://shopify/InventoryLevel/523463154?inventory_item_id=30322695", "quantities": [ { "name": "available", "quantity": 2 }, { "name": "incoming", "quantity": 146 }, { "name": "committed", "quantity": 1 }, { "name": "damaged", "quantity": 0 }, { "name": "on_hand", "quantity": 33 }, { "name": "quality_control", "quantity": 0 }, { "name": "reserved", "quantity": 30 }, { "name": "safety_stock", "quantity": 0 } ], "item": { "id": "gid://shopify/InventoryItem/30322695", "sku": "element-151" }, "location": { "id": "gid://shopify/Location/346779380", "name": "Ottawa Store" } } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/inventory/test/unit/graph_api/admin/inventory_level_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { inventoryLevel(id: \\\"gid://shopify/InventoryLevel/523463154?inventory_item_id=30322695\\\") { id quantities(names: [\\\"available\\\", \\\"incoming\\\", \\\"committed\\\", \\\"damaged\\\", \\\"on_hand\\\", \\\"quality_control\\\", \\\"reserved\\\", \\\"safety_stock\\\"]) { name quantity } item { id sku } location { id name } } }\"\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n inventoryLevel(id: \"gid://shopify/InventoryLevel/523463154?inventory_item_id=30322695\") {\n id\n quantities(names: [\"available\", \"incoming\", \"committed\", \"damaged\", \"on_hand\", \"quality_control\", \"reserved\", \"safety_stock\"]) {\n name\n quantity\n }\n item {\n id\n sku\n }\n location {\n id\n name\n }\n }\n }`,\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query {\n inventoryLevel(id: \"gid://shopify/InventoryLevel/523463154?inventory_item_id=30322695\") {\n id\n quantities(names: [\"available\", \"incoming\", \"committed\", \"damaged\", \"on_hand\", \"quality_control\", \"reserved\", \"safety_stock\"]) {\n name\n quantity\n }\n item {\n id\n sku\n }\n location {\n id\n name\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n inventoryLevel(id: \"gid://shopify/InventoryLevel/523463154?inventory_item_id=30322695\") {\n id\n quantities(names: [\"available\", \"incoming\", \"committed\", \"damaged\", \"on_hand\", \"quality_control\", \"reserved\", \"safety_stock\"]) {\n name\n quantity\n }\n item {\n id\n sku\n }\n location {\n id\n name\n }\n }\n }`,\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query {\n inventoryLevel(id: \"gid://shopify/InventoryLevel/523463154?inventory_item_id=30322695\") {\n id\n quantities(names: [\"available\", \"incoming\", \"committed\", \"damaged\", \"on_hand\", \"quality_control\", \"reserved\", \"safety_stock\"]) {\n name\n quantity\n }\n item {\n id\n sku\n }\n location {\n id\n name\n }\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" }, "titleStringKey": "arguments", "inputVariableEntries": [ { "arg": { "name": "id", "description": "The ID of the InventoryLevel to return.", "type": { "kind": "SCALAR", "name": "ID", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "ID!", "isDeprecated": false, "deprecationReason": null }, "key": "id", "argValue": " \"gid://shopify/InventoryLevel/523463154?inventory_item_id=30322695\"", "typeKind": "QUERY" } ] } ]