Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
GraphQL Admin API
query

Returns anInventoryLevelobject by ID.

ID!
required

The ID of theInventoryLevel to return.


Was this section helpful?

InventoryLevel

The quantities of an inventory item at a specific location. Each inventory level connects oneInventoryItem to oneLocation, tracking multiple quantity states like available, on-hand, incoming, and committed.

Thequantities field provides access to different inventory states. Learnmore about inventory states and relationships.

Boolean!
non-null

Whether the inventory items associated with the inventory level can be deactivated.

DateTime!
non-null

The date and time when the inventory level was created.

String

Describes either the impact of deactivating the inventory level, or why the inventory level can't be deactivated.

ID!
non-null

A globally-unique ID.

InventoryItem!
non-null

Inventory item associated with the inventory level.

Location!
non-null

The location associated with the inventory level.

[InventoryQuantity!]!
non-null

The quantity of an inventory item at a specific location, for a quantityname.

Arguments

[String!]!
required

Thenamesof the requested inventory quantities.


InventoryScheduledChangeConnection!
non-null

Scheduled changes for the requested quantity names.

Arguments

Int

The firstn elements from thepaginated list.

String

The elements that come after the specifiedcursor.

Int

The lastn elements from thepaginated list.

String

The elements that come before the specifiedcursor.

Boolean
Default:false

Reverse the order of the underlying list.

ScheduledChangeSortKeys
Default:ID

Sort the underlying list using a key. If your query is slow or returns an error, thentry specifying a sort key that matches the field used in the search.

String

A filter made up of terms, connectives, modifiers, and comparators.You can apply one or more filters to a query. Learn more aboutShopify API search syntax.

Anchor toexpected_at
time
id

Filter byid range.

Example:

  • id:1234
  • id:>=1234
  • id:<=1234
Anchor toquantity_names
string

DateTime!
non-null

The date and time when the inventory level was updated.


Was this section helpful?

Examples

  • Get the location, inventory item, and quantities for an inventory level

    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    }  }}

    cURL

    curl -X POST \https://your-development-store.myshopify.com/admin/api/2026-01/graphql.json \-H 'Content-Type: application/json' \-H 'X-Shopify-Access-Token: {access_token}' \-d '{"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 } } }"}'

    React Router

    import { authenticate } from "../shopify.server";export const loader = async ({request}) => {  const { admin } = await authenticate.admin(request);  const response = await admin.graphql(    `#graphql  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      }    }  }`,  );  const json = await response.json();  return json.data;}

    Ruby

    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 {    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      }    }  }QUERYresponse = client.query(query: query)

    Node.js

    const client = new shopify.clients.Graphql({session});const data = await client.query({  data: `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      }    }  }`,});

    Shopify CLI

    shopify app execute \--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    }  }}'

    Response

    {  "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"    }  }}

Get the location, inventory item, and quantities for an inventory level


[8]ページ先頭

©2009-2026 Movatter.jp