--- title: InventoryLevel description: Get or update the inventory level of an inventory item at a location. Each inventory level is associated to a single inventory item and location. api_version: 2025-10 api_name: admin-rest api_type: rest source_url: html: https://shopify.dev/docs/api/admin-rest/latest/resources/inventorylevel md: https://shopify.dev/docs/api/admin-rest/latest/resources/inventorylevel.md --- ![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg) The REST Admin API is a legacy API as of October 1, 2024. Starting April 1, 2025, all new public apps must be built exclusively with the [GraphQL Admin API](https://shopify.dev/docs/api/admin-graphql). For details and migration steps, visit our [migration guide](https://shopify.dev/docs/apps/build/graphql/migrate). # Inventory​Level Requires `inventory` access scope. An inventory level represents the quantities of an inventory item for a location. Each inventory level belongs to one inventory item and has one location. For every location where an inventory item can be stocked, there's an inventory level that represents the inventory item's quantities relating to that location. ![](https://shopify.dev/assets/api/reference/inventory.png) Before you begin updating inventory, it's helpful to understand the relationships between the inventory resources: * **[Product Variant](https://shopify.dev/api/admin-rest/latest/resources/product-variant)**: Contains merchandising information, such as price, description, and images. Think of this as the product information that you might want a customer to see. All product variants have a 1:1 relationship with their associated inventory item. Each product variant has one inventory item, and that inventory item belongs only to that product variant. * **[InventoryItem](https://shopify.dev/api/admin-rest/latest/resources/inventoryitem)**: Contains information about the physical product, such as its SKU. Think of this as the back-end information used for managing inventory, shipping, and fulfillments. Inventory items are associated with one or many inventory levels. An inventory item will have an inventory level for each location where the item is stocked. * **[InventoryLevel](https://shopify.dev/api/admin-rest/latest/resources/inventorylevel)**: Represents the actual quantity of an item that is available. Inventory levels connect one inventory item to one location. Each inventory level holds the available quantity for its inventory item at the associated location. * **[Location](https://shopify.dev/api/admin-rest/latest/resources/location)**: Represents a geographical location where a merchant does business, such as a retail store or warehouse. Locations can have many inventory levels. Each location has one inventory level for each inventory item that the location stocks. ## How an order affects inventory When a product variant that Shopify tracks is included in an order, Shopify decrements the inventory for that variant. Shopify doesn't know which location the item will be fulfilled from, so Shopify decrements the inventory level at the location that has the lowest ID. Note Orders placed through Shopify POS are associated with the location where the sale was made. For those orders, inventory is decremented at that location. When an order is fulfilled, the fulfillment includes the ID of the location where the fulfillment is taking place. Shopify checks whether the fulfillment location matches the original location where stock was decremented, and then adjusts the inventory if necessary: * If the fulfillment location matches the original location, then no action is needed. * If the fulfillment location doesn't match the original location, then Shopify decrements the inventory level at the fulfillment location and increments the inventory level at the original location. ### Example: Inventory adjustments for a simple order An online store uses two warehouses to stock product inventory: one in Los Angeles (ID: `6884556842`), and one in New York (ID: `13968834616`). One of the store's products is a hat that's stocked at both locations with the following inventory levels: * Los Angeles: 8 * New York: 6 A customer places an order for a hat. The Los Angeles location has the lowest ID, so Shopify decrements the item's inventory level at that location: * Los Angeles: 7 * New York: 6 The order is actually fulfilled from the New York location. When the fulfillment is created, it includes the ID for the New York location. Shopify compares the fulfillment location ID to the original location and finds that they're different. Shopify then increments the inventory level at the Los Angeles location, and decrements the inventory level at the New York location: * Los Angeles: 8 * New York: 5 ## Inventory levels and fulfillment service locations A fulfillment service [location](https://shopify.dev/api/admin-rest/latest/resources/location) has a 1:1 relationship with a third-party fulfillment service. When an app [creates a new fulfillment service](https://shopify.dev/api/admin-rest/latest/resources/fulfillmentservice) on a store, Shopify automatically creates a location that's associated with that fulfillment service. The FulfillmentService resource has a `location_id` property, which identifies the associated location. An inventory item connected to a fulfillment service location can't be connected to any other locations at the same time: ![](https://shopify.dev/assets/api/reference/location-types.png) ### Connecting an inventory item to a fulfillment service location When you work with items that have been or will be connected a fulfillment location, you should include `"relocate_if_necessary": true` in the body of the request. There are two situations where you might do this: * connecting an inventory item to a fulfillment service location and disconnecting it from all standard locations * connecting an inventory item to one or more standard locations and disconnecting it from a fulfillment service location If `relocate_if_necessary` is `true`, then all inventory for the item is relocated to the new location and disconnected from any other locations. If a fulfillment service location is involved but `relocate_if_necessary` is `false`, then the connection will fail. If no fulfillment service is involved, then the property is ignored and no inventory is relocated. ### Setting the inventory level at a fulfillment service location When you set inventory for a location, the inventory item is connected to the location if they are not already connected. If the item has been or will be connected to a fulfillment service location, then you should include `"disconnect_if_necessary": true` in the body of the request. There are two situations where you might do this: * setting inventory for an inventory item at a fulfillment service location when the item is already connected to one or more standard locations * setting inventory for an inventory item at a standard location when the item is already connected to a fulfillment service location The inventory at the new location is set to the value of the `available` property. The inventory for other locations is set to 0 and the locations are disconnected from the inventory item. If `disconnect_if_necessary` is set to `false` when you set inventory at a location and a fulfillment service location is involved, then the action will fail. If no fulfillment service location is involved, then this property is ignored. \# ## Endpoints * [post](https://shopify.dev/docs/api/admin-rest/latest/resources/inventorylevel#post-inventory-levels-adjust) [/admin/api/latest/inventory\_​levels/adjust.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/inventorylevel#post-inventory-levels-adjust) Adjusts the inventory level of an inventory item at a location [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/inventoryAdjustQuantities?example=adjusts-the-inventory-level-of-an-inventory-item-at-a-location) [inventoryAdjustQuantities](https://shopify.dev/docs/api/admin-graphql/latest/mutations/inventoryAdjustQuantities?example=adjusts-the-inventory-level-of-an-inventory-item-at-a-location) * [post](https://shopify.dev/docs/api/admin-rest/latest/resources/inventorylevel#post-inventory-levels-connect) [/admin/api/latest/inventory\_​levels/connect.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/inventorylevel#post-inventory-levels-connect) Connects an inventory item to a location [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/inventoryActivate?example=connects-an-inventory-item-to-a-location) [inventoryActivate](https://shopify.dev/docs/api/admin-graphql/latest/mutations/inventoryActivate?example=connects-an-inventory-item-to-a-location) * [post](https://shopify.dev/docs/api/admin-rest/latest/resources/inventorylevel#post-inventory-levels-set) [/admin/api/latest/inventory\_​levels/set.​json](https://shopify.dev/docs/api/admin-rest/latest/resources/inventorylevel#post-inventory-levels-set) Sets the inventory level for an inventory item at a location [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/inventorySetQuantities?example=sets-the-inventory-level-for-an-inventory-item-at-a-location) [inventorySetQuantities](https://shopify.dev/docs/api/admin-graphql/latest/mutations/inventorySetQuantities?example=sets-the-inventory-level-for-an-inventory-item-at-a-location) * [get](https://shopify.dev/docs/api/admin-rest/latest/resources/inventorylevel#get-inventory-levels?location-ids=655441491) [/admin/api/latest/inventory\_​levels.​json?location\_​ids=655441491](https://shopify.dev/docs/api/admin-rest/latest/resources/inventorylevel#get-inventory-levels?location-ids=655441491) Retrieves a list of inventory levels [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/inventoryItems) [inventoryItems](https://shopify.dev/docs/api/admin-graphql/latest/queries/inventoryItems) * [del](https://shopify.dev/docs/api/admin-rest/latest/resources/inventorylevel#delete-inventory-levels?inventory-item-id=808950810\&location-id=655441491) [/admin/api/latest/inventory\_​levels.​json?inventory\_​item\_​id=808950810\&location\_​id=655441491](https://shopify.dev/docs/api/admin-rest/latest/resources/inventorylevel#delete-inventory-levels?inventory-item-id=808950810\&location-id=655441491) Deletes an inventory level from a location [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/inventoryDeactivate?example=deletes-an-inventory-level-from-a-location) [inventoryDeactivate](https://shopify.dev/docs/api/admin-graphql/latest/mutations/inventoryDeactivate?example=deletes-an-inventory-level-from-a-location) *** ## The InventoryLevel resource ### Properties *** available -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/objects/InventoryQuantity#field-InventoryQuantity.fields.quantity) [quantity](https://shopify.dev/docs/api/admin-graphql/latest/objects/InventoryQuantity#field-InventoryQuantity.fields.quantity) The available quantity of an inventory item at the inventory level's associated location. Returns `null` if the inventory item is not tracked. *** inventory\_item\_id read-only -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/objects/InventoryItem#field-InventoryItem.fields.id) [id](https://shopify.dev/docs/api/admin-graphql/latest/objects/InventoryItem#field-InventoryItem.fields.id) The ID of the inventory item associated with the inventory level. To find the ID of an inventory item, use the [Inventory Item resource](https://shopify.dev/api/admin-rest/latest/resources/inventoryitem) *** location\_id -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/objects/Location#field-Location.fields.id) [id](https://shopify.dev/docs/api/admin-graphql/latest/objects/Location#field-Location.fields.id) The ID of the location that the inventory level belongs to. To find the ID of the location, use the [Location resource](https://shopify.dev/api/admin-rest/latest/resources/location) *** updated\_at read-only -> [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/objects/InventoryLevel#field-InventoryLevel.fields.updatedAt) [updatedAt](https://shopify.dev/docs/api/admin-graphql/latest/objects/InventoryLevel#field-InventoryLevel.fields.updatedAt) The date and time ([ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601)) when the inventory level was last modified. *** {} ## The InventoryLevel resource ```json { "available": 6, "inventory_item_id": 450789469, "location_id": 40642626, "updated_at": "2012-08-24T14:01:47-04:00" } ``` *** ## postAdjusts the inventory level of an inventory item at a location [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/inventoryAdjustQuantities?example=adjusts-the-inventory-level-of-an-inventory-item-at-a-location) [inventoryAdjustQuantities](https://shopify.dev/docs/api/admin-graphql/latest/mutations/inventoryAdjustQuantities?example=adjusts-the-inventory-level-of-an-inventory-item-at-a-location) Adjusts the inventory level of an inventory item at a single location ### Parameters *** api\_version string required *** available\_adjustment required The amount to adjust the available inventory quantity. Send negative values to subtract from the current available quantity. For example, `"available_adjustment": 2` increases the current available quantity by 2, and `"available_adjustment": -3`decreases the current available quantity by 3. *** inventory\_item\_id required The ID of the inventory item. *** location\_id required The ID of the location that the inventory level belongs to. To find the ID of the location, use the [Location resource](https://shopify.dev/api/admin-rest/latest/resources/location) *** ### Examples Adjust the available quantity of an inventory item by 5 at a single location Request body location\_​id​ Location\_id resource Show location\_id properties location\_​id:​655441491 required The ID of the location that the inventory level belongs to. To find the ID of the location, use the [Location resource](https://shopify.dev/api/admin-rest/latest/resources/location) inventory\_​item\_​id:​808950810 required The ID of the inventory item. available\_​adjustment:​5 required The amount to adjust the available inventory quantity. Send negative values to subtract from the current available quantity. For example, `"available_adjustment": 2` increases the current available quantity by 2, and `"available_adjustment": -3`decreases the current available quantity by 3. Adjusting inventory levels at a non-existent location fails and returns an error Request body location\_​id​ Location\_id resource Show location\_id properties location\_​id:​655441491 required The ID of the location that the inventory level belongs to. To find the ID of the location, use the [Location resource](https://shopify.dev/api/admin-rest/latest/resources/location) inventory\_​item\_​id:​808950810 required The ID of the inventory item. available\_​adjustment:​5 required The amount to adjust the available inventory quantity. Send negative values to subtract from the current available quantity. For example, `"available_adjustment": 2` increases the current available quantity by 2, and `"available_adjustment": -3`decreases the current available quantity by 3. Adjusting inventory levels for an inventory item that is untracked fails and returns an error Request body location\_​id​ Location\_id resource Show location\_id properties location\_​id:​655441491 required The ID of the location that the inventory level belongs to. To find the ID of the location, use the [Location resource](https://shopify.dev/api/admin-rest/latest/resources/location) inventory\_​item\_​id:​808950810 required The ID of the inventory item. available\_​adjustment:​5 required The amount to adjust the available inventory quantity. Send negative values to subtract from the current available quantity. For example, `"available_adjustment": 2` increases the current available quantity by 2, and `"available_adjustment": -3`decreases the current available quantity by 3. post ## /admin/api/2025-10/inventory\_​levels/adjust.​json ```bash curl -d '{"location_id":655441491,"inventory_item_id":808950810,"available_adjustment":5}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/inventory_levels/adjust.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "inventory_level": { "inventory_item_id": 808950810, "location_id": 655441491, "available": 6, "updated_at": "2025-10-01T14:53:34-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810" } } ``` ### examples * #### Adjust the available quantity of an inventory item by 5 at a single location ##### ```curl curl -d '{"location_id":655441491,"inventory_item_id":808950810,"available_adjustment":5}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/inventory_levels/adjust.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const inventory_level = new admin.rest.resources.InventoryLevel({session: session}); await inventory_level.adjust({ body: {"location_id": 655441491, "inventory_item_id": 808950810, "available_adjustment": 5}, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session inventory_level = ShopifyAPI::InventoryLevel.new(session: test_session) inventory_level.adjust( session: test_session, body: {"location_id" => 655441491, "inventory_item_id" => 808950810, "available_adjustment" => 5}, ) ``` ##### ```node // Session is built by the OAuth process const inventory_level = new shopify.rest.InventoryLevel({session: session}); await inventory_level.adjust({ body: {"location_id": 655441491, "inventory_item_id": 808950810, "available_adjustment": 5}, }); ``` #### response ```json HTTP/1.1 200 OK{"inventory_level":{"inventory_item_id":808950810,"location_id":655441491,"available":6,"updated_at":"2025-10-01T14:53:34-04:00","admin_graphql_api_id":"gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}} ``` * #### Adjusting inventory levels at a non-existent location fails and returns an error ##### ```curl curl -d '{"location_id":655441491,"inventory_item_id":808950810,"available_adjustment":5}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/inventory_levels/adjust.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const inventory_level = new admin.rest.resources.InventoryLevel({session: session}); await inventory_level.adjust({ body: {"location_id": 655441491, "inventory_item_id": 808950810, "available_adjustment": 5}, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session inventory_level = ShopifyAPI::InventoryLevel.new(session: test_session) inventory_level.adjust( session: test_session, body: {"location_id" => 655441491, "inventory_item_id" => 808950810, "available_adjustment" => 5}, ) ``` ##### ```node // Session is built by the OAuth process const inventory_level = new shopify.rest.InventoryLevel({session: session}); await inventory_level.adjust({ body: {"location_id": 655441491, "inventory_item_id": 808950810, "available_adjustment": 5}, }); ``` #### response ```json HTTP/1.1 404 Not Found{"errors":"Not Found"} ``` * #### Adjusting inventory levels for an inventory item that is untracked fails and returns an error ##### ```curl curl -d '{"location_id":655441491,"inventory_item_id":808950810,"available_adjustment":5}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/inventory_levels/adjust.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const inventory_level = new admin.rest.resources.InventoryLevel({session: session}); await inventory_level.adjust({ body: {"location_id": 655441491, "inventory_item_id": 808950810, "available_adjustment": 5}, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session inventory_level = ShopifyAPI::InventoryLevel.new(session: test_session) inventory_level.adjust( session: test_session, body: {"location_id" => 655441491, "inventory_item_id" => 808950810, "available_adjustment" => 5}, ) ``` ##### ```node // Session is built by the OAuth process const inventory_level = new shopify.rest.InventoryLevel({session: session}); await inventory_level.adjust({ body: {"location_id": 655441491, "inventory_item_id": 808950810, "available_adjustment": 5}, }); ``` #### response ```json HTTP/1.1 422 Unprocessable Entity ``` *** ## postConnects an inventory item to a location [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/inventoryActivate?example=connects-an-inventory-item-to-a-location) [inventoryActivate](https://shopify.dev/docs/api/admin-graphql/latest/mutations/inventoryActivate?example=connects-an-inventory-item-to-a-location) Connects an inventory item to a location by creating an inventory level at that location. When connecting inventory items to locations, it's important to understand the rules around [fulfillment service locations](#inventory-levels-and-fulfillment-service-locations). ### Parameters *** api\_version string required *** inventory\_item\_id required The ID of the inventory item. *** location\_id required The ID of the location that the inventory level belongs to. To find the ID of the location, use the [Location resource](https://shopify.dev/api/admin-rest/latest/resources/location) *** relocate\_if\_necessary default false Whether inventory for any previously connected locations will be relocated. This property is ignored when no fulfillment service location is involved. For more information, refer to [*Inventory levels and fulfillment service locations*](#inventory-levels-and-fulfillment-service-locations). *** ### Examples Connect an inventory item to a location Request body location\_​id​ Location\_id resource Show location\_id properties location\_​id:​844681632 required The ID of the location that the inventory level belongs to. To find the ID of the location, use the [Location resource](https://shopify.dev/api/admin-rest/latest/resources/location) inventory\_​item\_​id:​457924702 required The ID of the inventory item. Connecting an inventory item to a fulfillment service location without `"relocate_if_necessary": true` fails with a 422 error when permits\_sku\_sharing is false Request body location\_​id​ Location\_id resource Show location\_id properties location\_​id:​611870435 required The ID of the location that the inventory level belongs to. To find the ID of the location, use the [Location resource](https://shopify.dev/api/admin-rest/latest/resources/location) inventory\_​item\_​id:​808950810 required The ID of the inventory item. Connecting an inventory item to a non-existent location fails and returns an error Request body location\_​id​ Location\_id resource Show location\_id properties location\_​id:​123 required The ID of the location that the inventory level belongs to. To find the ID of the location, use the [Location resource](https://shopify.dev/api/admin-rest/latest/resources/location) inventory\_​item\_​id:​457924702 required The ID of the inventory item. post ## /admin/api/2025-10/inventory\_​levels/connect.​json ```bash curl -d '{"location_id":844681632,"inventory_item_id":457924702}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/inventory_levels/connect.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` {} ## Response JSON ```json HTTP/1.1 201 Created { "inventory_level": { "inventory_item_id": 457924702, "location_id": 844681632, "available": 0, "updated_at": "2025-10-01T14:53:40-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/844681632?inventory_item_id=457924702" } } ``` ### examples * #### Connect an inventory item to a location ##### ```curl curl -d '{"location_id":844681632,"inventory_item_id":457924702}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/inventory_levels/connect.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const inventory_level = new admin.rest.resources.InventoryLevel({session: session}); await inventory_level.connect({ body: {"location_id": 844681632, "inventory_item_id": 457924702}, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session inventory_level = ShopifyAPI::InventoryLevel.new(session: test_session) inventory_level.connect( session: test_session, body: {"location_id" => 844681632, "inventory_item_id" => 457924702}, ) ``` ##### ```node // Session is built by the OAuth process const inventory_level = new shopify.rest.InventoryLevel({session: session}); await inventory_level.connect({ body: {"location_id": 844681632, "inventory_item_id": 457924702}, }); ``` #### response ```json HTTP/1.1 201 Created{"inventory_level":{"inventory_item_id":457924702,"location_id":844681632,"available":0,"updated_at":"2025-10-01T14:53:40-04:00","admin_graphql_api_id":"gid://shopify/InventoryLevel/844681632?inventory_item_id=457924702"}} ``` * #### Connecting an inventory item to a fulfillment service location without \"relocate\_if\_necessary": true\ fails with a 422 error when permits\_sku\_sharing is false ##### ```curl curl -d '{"location_id":611870435,"inventory_item_id":808950810}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/inventory_levels/connect.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const inventory_level = new admin.rest.resources.InventoryLevel({session: session}); await inventory_level.connect({ body: {"location_id": 611870435, "inventory_item_id": 808950810}, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session inventory_level = ShopifyAPI::InventoryLevel.new(session: test_session) inventory_level.connect( session: test_session, body: {"location_id" => 611870435, "inventory_item_id" => 808950810}, ) ``` ##### ```node // Session is built by the OAuth process const inventory_level = new shopify.rest.InventoryLevel({session: session}); await inventory_level.connect({ body: {"location_id": 611870435, "inventory_item_id": 808950810}, }); ``` #### response ```json HTTP/1.1 422 Unprocessable Entity{"errors":["An item cannot be active at more than one location if one of them is a fulfillment service location."]} ``` * #### Connecting an inventory item to a non-existent location fails and returns an error ##### ```curl curl -d '{"location_id":123,"inventory_item_id":457924702}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/inventory_levels/connect.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const inventory_level = new admin.rest.resources.InventoryLevel({session: session}); await inventory_level.connect({ body: {"location_id": 123, "inventory_item_id": 457924702}, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session inventory_level = ShopifyAPI::InventoryLevel.new(session: test_session) inventory_level.connect( session: test_session, body: {"location_id" => 123, "inventory_item_id" => 457924702}, ) ``` ##### ```node // Session is built by the OAuth process const inventory_level = new shopify.rest.InventoryLevel({session: session}); await inventory_level.connect({ body: {"location_id": 123, "inventory_item_id": 457924702}, }); ``` #### response ```json HTTP/1.1 404 Not Found{"errors":"Not Found"} ``` *** ## postSets the inventory level for an inventory item at a location [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/inventorySetQuantities?example=sets-the-inventory-level-for-an-inventory-item-at-a-location) [inventorySetQuantities](https://shopify.dev/docs/api/admin-graphql/latest/mutations/inventorySetQuantities?example=sets-the-inventory-level-for-an-inventory-item-at-a-location) Sets the inventory level for an inventory item at a location. If the specified location is not connected, it will be automatically connected first. When connecting inventory items to locations, it's important to understand the rules around [fulfillment service locations](#inventory-levels-and-fulfillment-service-locations). ### Parameters *** api\_version string required *** available required Sets the available inventory quantity. *** inventory\_item\_id required The ID of the inventory item associated with the inventory level. To find the ID of the inventory item, use the [Inventory Item resource](https://shopify.dev/api/admin-rest/latest/resources/inventoryitem) *** location\_id required The ID of the location that the inventory level belongs to. To find the ID of the location, use the [Location resource](https://shopify.dev/api/admin-rest/latest/resources/location) *** disconnect\_if\_necessary default false Whether inventory for any previously connected locations will be set to 0 and the locations disconnected. This property is ignored when no fulfillment service is involved. For more information, refer to [*Inventory levels and fulfillment service locations*](#inventory-levels-and-fulfillment-service-locations). *** ### Examples Set the available inventory at a location Request body location\_​id​ Location\_id resource Show location\_id properties location\_​id:​655441491 required The ID of the location that the inventory level belongs to. To find the ID of the location, use the [Location resource](https://shopify.dev/api/admin-rest/latest/resources/location) inventory\_​item\_​id:​808950810 required The ID of the inventory item associated with the inventory level. To find the ID of the inventory item, use the [Inventory Item resource](https://shopify.dev/api/admin-rest/latest/resources/inventoryitem) available:​42 required Sets the available inventory quantity. Setting an inventory item to a fulfillment service without `"disconnect_if_necessary": true` fails with a 422 error Request body location\_​id​ Location\_id resource Show location\_id properties location\_​id:​611870435 required The ID of the location that the inventory level belongs to. To find the ID of the location, use the [Location resource](https://shopify.dev/api/admin-rest/latest/resources/location) inventory\_​item\_​id:​808950810 required The ID of the inventory item associated with the inventory level. To find the ID of the inventory item, use the [Inventory Item resource](https://shopify.dev/api/admin-rest/latest/resources/inventoryitem) available:​42 required Sets the available inventory quantity. post ## /admin/api/2025-10/inventory\_​levels/set.​json ```bash curl -d '{"location_id":655441491,"inventory_item_id":808950810,"available":42}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/inventory_levels/set.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "inventory_level": { "inventory_item_id": 808950810, "location_id": 655441491, "available": 42, "updated_at": "2025-10-01T14:53:39-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810" } } ``` ### examples * #### Set the available inventory at a location ##### ```curl curl -d '{"location_id":655441491,"inventory_item_id":808950810,"available":42}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/inventory_levels/set.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const inventory_level = new admin.rest.resources.InventoryLevel({session: session}); await inventory_level.set({ body: {"location_id": 655441491, "inventory_item_id": 808950810, "available": 42}, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session inventory_level = ShopifyAPI::InventoryLevel.new(session: test_session) inventory_level.set( session: test_session, body: {"location_id" => 655441491, "inventory_item_id" => 808950810, "available" => 42}, ) ``` ##### ```node // Session is built by the OAuth process const inventory_level = new shopify.rest.InventoryLevel({session: session}); await inventory_level.set({ body: {"location_id": 655441491, "inventory_item_id": 808950810, "available": 42}, }); ``` #### response ```json HTTP/1.1 200 OK{"inventory_level":{"inventory_item_id":808950810,"location_id":655441491,"available":42,"updated_at":"2025-10-01T14:53:39-04:00","admin_graphql_api_id":"gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}} ``` * #### Setting an inventory item to a fulfillment service without \"disconnect\_if\_necessary": true\ fails with a 422 error ##### ```curl curl -d '{"location_id":611870435,"inventory_item_id":808950810,"available":42}' \ -X POST "https://your-development-store.myshopify.com/admin/api/2025-10/inventory_levels/set.json" \ -H "X-Shopify-Access-Token: {access_token}" \ -H "Content-Type: application/json" ``` ##### ```remix const { admin, session } = await authenticate.admin(request); const inventory_level = new admin.rest.resources.InventoryLevel({session: session}); await inventory_level.set({ body: {"location_id": 611870435, "inventory_item_id": 808950810, "available": 42}, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session inventory_level = ShopifyAPI::InventoryLevel.new(session: test_session) inventory_level.set( session: test_session, body: {"location_id" => 611870435, "inventory_item_id" => 808950810, "available" => 42}, ) ``` ##### ```node // Session is built by the OAuth process const inventory_level = new shopify.rest.InventoryLevel({session: session}); await inventory_level.set({ body: {"location_id": 611870435, "inventory_item_id": 808950810, "available": 42}, }); ``` #### response ```json HTTP/1.1 422 Unprocessable Entity{"errors":["An item cannot be active at more than one location if one of them is a fulfillment service location."]} ``` *** ## getRetrieves a list of inventory levels [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/queries/inventoryItems) [inventoryItems](https://shopify.dev/docs/api/admin-graphql/latest/queries/inventoryItems) Retrieves a list of inventory levels. You must include `inventory_item_ids`, `location_ids`, or both as filter parameters. **Note:** This endpoint implements pagination by using links that are provided in the response header. To learn more, refer to [Make paginated requests to the REST Admin API](https://shopify.dev/api/usage/pagination-rest). ### Parameters *** api\_version string required *** inventory\_item\_ids ≤ 50 A comma-separated list of inventory item IDs. To find the ID of an inventory item, use the [Inventory Item resource](https://shopify.dev/api/admin-rest/latest/resources/inventoryitem) *** limit ≤ 250 default 50 The maximum number of results to show. *** location\_ids ≤ 50 A comma-separated list of location IDs. To find the ID of a location, use the [Location resource](https://shopify.dev/api/admin-rest/latest/resources/location) *** updated\_at\_min Show inventory levels updated at or after date (format: 2019-03-19T01:21:44-04:00). *** ### Examples Retrieve inventory levels at a single location Query parameters location\_​ids=​655441491 ≤ 50 A comma-separated list of location IDs. To find the ID of a location, use the [Location resource](https://shopify.dev/api/admin-rest/latest/resources/location) Retrieve inventory levels for a single inventory item Query parameters inventory\_​item\_​ids=​808950810 ≤ 50 A comma-separated list of inventory item IDs. To find the ID of an inventory item, use the [Inventory Item resource](https://shopify.dev/api/admin-rest/latest/resources/inventoryitem) Retrieve inventory levels for the specified inventory items and locations Query parameters inventory\_​item\_​ids=​808950810,​39072856 ≤ 50 A comma-separated list of inventory item IDs. To find the ID of an inventory item, use the [Inventory Item resource](https://shopify.dev/api/admin-rest/latest/resources/inventoryitem) location\_​ids=​655441491,​487838322 ≤ 50 A comma-separated list of location IDs. To find the ID of a location, use the [Location resource](https://shopify.dev/api/admin-rest/latest/resources/location) Retrieving inventory levels without specifying `location_ids` or `inventory_item_ids` fails and returns an error get ## /admin/api/2025-10/inventory\_​levels.​json?location\_​ids=​655441491 ```bash curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/inventory_levels.json?location_ids=655441491" \ -H "X-Shopify-Access-Token: {access_token}" ``` {} ## Response JSON ```json HTTP/1.1 200 OK { "inventory_levels": [ { "inventory_item_id": 49148385, "location_id": 655441491, "available": 2, "updated_at": "2025-10-01T14:30:56-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=49148385" }, { "inventory_item_id": 808950810, "location_id": 655441491, "available": 1, "updated_at": "2025-10-01T14:30:56-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810" }, { "inventory_item_id": 457924702, "location_id": 655441491, "available": 4, "updated_at": "2025-10-01T14:30:56-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=457924702" }, { "inventory_item_id": 39072856, "location_id": 655441491, "available": 3, "updated_at": "2025-10-01T14:30:56-04:00", "admin_graphql_api_id": "gid://shopify/InventoryLevel/655441491?inventory_item_id=39072856" } ] } ``` ### examples * #### Retrieve inventory levels at a single location ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/inventory_levels.json?location_ids=655441491" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.InventoryLevel.all({ session: session, location_ids: "655441491", }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::InventoryLevel.all( session: test_session, location_ids: "655441491", ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.InventoryLevel.all({ session: session, location_ids: "655441491", }); ``` #### response ```json HTTP/1.1 200 OK{"inventory_levels":[{"inventory_item_id":49148385,"location_id":655441491,"available":2,"updated_at":"2025-10-01T14:30:56-04:00","admin_graphql_api_id":"gid://shopify/InventoryLevel/655441491?inventory_item_id=49148385"},{"inventory_item_id":808950810,"location_id":655441491,"available":1,"updated_at":"2025-10-01T14:30:56-04:00","admin_graphql_api_id":"gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"},{"inventory_item_id":457924702,"location_id":655441491,"available":4,"updated_at":"2025-10-01T14:30:56-04:00","admin_graphql_api_id":"gid://shopify/InventoryLevel/655441491?inventory_item_id=457924702"},{"inventory_item_id":39072856,"location_id":655441491,"available":3,"updated_at":"2025-10-01T14:30:56-04:00","admin_graphql_api_id":"gid://shopify/InventoryLevel/655441491?inventory_item_id=39072856"}]} ``` * #### Retrieve inventory levels for a single inventory item ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/inventory_levels.json?inventory_item_ids=808950810" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.InventoryLevel.all({ session: session, inventory_item_ids: "808950810", }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::InventoryLevel.all( session: test_session, inventory_item_ids: "808950810", ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.InventoryLevel.all({ session: session, inventory_item_ids: "808950810", }); ``` #### response ```json HTTP/1.1 200 OK{"inventory_levels":[{"inventory_item_id":808950810,"location_id":487838322,"available":9,"updated_at":"2025-10-01T14:30:56-04:00","admin_graphql_api_id":"gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"},{"inventory_item_id":808950810,"location_id":655441491,"available":1,"updated_at":"2025-10-01T14:30:56-04:00","admin_graphql_api_id":"gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"}]} ``` * #### Retrieve inventory levels for the specified inventory items and locations ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/inventory_levels.json?inventory_item_ids=808950810%2C39072856&location_ids=655441491%2C487838322" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.InventoryLevel.all({ session: session, inventory_item_ids: "808950810,39072856", location_ids: "655441491,487838322", }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::InventoryLevel.all( session: test_session, inventory_item_ids: "808950810,39072856", location_ids: "655441491,487838322", ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.InventoryLevel.all({ session: session, inventory_item_ids: "808950810,39072856", location_ids: "655441491,487838322", }); ``` #### response ```json HTTP/1.1 200 OK{"inventory_levels":[{"inventory_item_id":808950810,"location_id":487838322,"available":9,"updated_at":"2025-10-01T14:30:56-04:00","admin_graphql_api_id":"gid://shopify/InventoryLevel/548380009?inventory_item_id=808950810"},{"inventory_item_id":39072856,"location_id":487838322,"available":27,"updated_at":"2025-10-01T14:30:56-04:00","admin_graphql_api_id":"gid://shopify/InventoryLevel/548380009?inventory_item_id=39072856"},{"inventory_item_id":808950810,"location_id":655441491,"available":1,"updated_at":"2025-10-01T14:30:56-04:00","admin_graphql_api_id":"gid://shopify/InventoryLevel/655441491?inventory_item_id=808950810"},{"inventory_item_id":39072856,"location_id":655441491,"available":3,"updated_at":"2025-10-01T14:30:56-04:00","admin_graphql_api_id":"gid://shopify/InventoryLevel/655441491?inventory_item_id=39072856"}]} ``` * #### Retrieving inventory levels without specifying \location\_ids\ or \inventory\_item\_ids\ fails and returns an error ##### ```curl curl -X GET "https://your-development-store.myshopify.com/admin/api/2025-10/inventory_levels.json" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.InventoryLevel.all({ session: session, }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::InventoryLevel.all( session: test_session, ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.InventoryLevel.all({ session: session, }); ``` #### response ```json HTTP/1.1 422 Unprocessable Entity ``` *** ## delDeletes an inventory level from a location [![](https://shopify.dev/images/logos/GraphQL.svg)![](https://shopify.dev/images/logos/GraphQL-dark.svg)](https://shopify.dev/docs/api/admin-graphql/latest/mutations/inventoryDeactivate?example=deletes-an-inventory-level-from-a-location) [inventoryDeactivate](https://shopify.dev/docs/api/admin-graphql/latest/mutations/inventoryDeactivate?example=deletes-an-inventory-level-from-a-location) Deletes an inventory level of an inventory item at a location. Deleting an inventory level for an inventory item removes that item from the specified location. Every inventory item must have at least one inventory level. To move inventory to another location, first connect the inventory item to another location, and then delete the previous inventory level. ### Parameters *** api\_version string required *** inventory\_item\_id required The ID for the inventory item. *** location\_id required The ID of the location that the inventory level belongs to. To find the ID of the location, use the [Location resource](https://shopify.dev/api/admin-rest/latest/resources/location) *** ### Examples Delete an inventory level Query parameters inventory\_​item\_​id=​808950810 required The ID for the inventory item. location\_​id=​655441491 required The ID of the location that the inventory level belongs to. To find the ID of the location, use the [Location resource](https://shopify.dev/api/admin-rest/latest/resources/location) del ## /admin/api/2025-10/inventory\_​levels.​json?inventory\_​item\_​id=​808950810\&location\_​id=​655441491 ```bash curl -X DELETE "https://your-development-store.myshopify.com/admin/api/2025-10/inventory_levels.json?inventory_item_id=808950810&location_id=655441491" \ -H "X-Shopify-Access-Token: {access_token}" ``` {} ## Response JSON ```json HTTP/1.1 204 No Content ``` ### examples * #### Delete an inventory level ##### ```curl curl -X DELETE "https://your-development-store.myshopify.com/admin/api/2025-10/inventory_levels.json?inventory_item_id=808950810&location_id=655441491" \ -H "X-Shopify-Access-Token: {access_token}" ``` ##### ```remix await admin.rest.resources.InventoryLevel.delete({ session: session, inventory_item_id: "808950810", location_id: "655441491", }); ``` ##### ```ruby # Session is activated via Authentication test_session = ShopifyAPI::Context.active_session ShopifyAPI::InventoryLevel.delete( session: test_session, inventory_item_id: "808950810", location_id: "655441491", ) ``` ##### ```node // Session is built by the OAuth process await shopify.rest.InventoryLevel.delete({ session: session, inventory_item_id: "808950810", location_id: "655441491", }); ``` #### response ```json HTTP/1.1 204 No Content ```