# inventoryAdjustQuantity - admin-graphql - MUTATION
Version: unstable

## Description
Adjusts the inventory by a certain quantity.

### Access Scopes
`write_inventory` access scope. Also: The user must have a permission to adjusts an inventory quantity.


## Arguments
* [input](/docs/api/admin-graphql/unstable/input-objects/InventoryAdjustQuantityInput): InventoryAdjustQuantityInput! - Provides the input fields required to update an inventory level.


## Returns
* [inventoryLevel](/docs/api/admin-graphql/unstable/objects/InventoryLevel): InventoryLevel Represents the updated inventory quantity of an inventory item at a specific location.
* [userErrors](/docs/api/admin-graphql/unstable/objects/UserError): UserError! The list of errors that occurred from executing the mutation.


## Examples
### Decrease the available inventory of an item at a location by 2
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/unstable/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation AdjustInventoryQuantity($input: InventoryAdjustQuantityInput!) { inventoryAdjustQuantity(input: $input) { inventoryLevel { id quantities(names: [\\\"available\\\"]) { name quantity } incoming item { id sku } location { id name } } } }\",\n \"variables\": {\n    \"input\": {\n      \"inventoryLevelId\": \"gid://shopify/InventoryLevel/964427794?inventory_item_id=43729076\",\n      \"availableDelta\": -2\n    }\n  }\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: {\n    \"query\": `mutation AdjustInventoryQuantity($input: InventoryAdjustQuantityInput!) {\n      inventoryAdjustQuantity(input: $input) {\n        inventoryLevel {\n          id\n          quantities(names: [\"available\"]) {\n            name\n            quantity\n          }\n          incoming\n          item {\n            id\n            sku\n          }\n          location {\n            id\n            name\n          }\n        }\n      }\n    }`,\n    \"variables\": {\n      \"input\": {\n        \"inventoryLevelId\": \"gid://shopify/InventoryLevel/964427794?inventory_item_id=43729076\",\n        \"availableDelta\": -2\n      }\n    },\n  },\n});\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  mutation AdjustInventoryQuantity($input: InventoryAdjustQuantityInput!) {\n    inventoryAdjustQuantity(input: $input) {\n      inventoryLevel {\n        id\n        quantities(names: [\"available\"]) {\n          name\n          quantity\n        }\n        incoming\n        item {\n          id\n          sku\n        }\n        location {\n          id\n          name\n        }\n      }\n    }\n  }\nQUERY\n\nvariables = {\n  \"input\": {\n    \"inventoryLevelId\": \"gid://shopify/InventoryLevel/964427794?inventory_item_id=43729076\",\n    \"availableDelta\": -2\n  }\n}\n\nresponse = client.query(query: query, variables: variables)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  mutation AdjustInventoryQuantity($input: InventoryAdjustQuantityInput!) {\n    inventoryAdjustQuantity(input: $input) {\n      inventoryLevel {\n        id\n        quantities(names: [\"available\"]) {\n          name\n          quantity\n        }\n        incoming\n        item {\n          id\n          sku\n        }\n        location {\n          id\n          name\n        }\n      }\n    }\n  }`,\n  {\n    variables: {\n      \"input\": {\n        \"inventoryLevelId\": \"gid://shopify/InventoryLevel/964427794?inventory_item_id=43729076\",\n        \"availableDelta\": -2\n      }\n    },\n  },\n);\n\nconst data = await response.json();\n"
Graphql query: "mutation AdjustInventoryQuantity($input: InventoryAdjustQuantityInput!) {\n  inventoryAdjustQuantity(input: $input) {\n    inventoryLevel {\n      id\n      quantities(names: [\"available\"]) {\n        name\n        quantity\n      }\n      incoming\n      item {\n        id\n        sku\n      }\n      location {\n        id\n        name\n      }\n    }\n  }\n}"
#### Graphql Input
{
  "input": {
    "inventoryLevelId": "gid://shopify/InventoryLevel/964427794?inventory_item_id=43729076",
    "availableDelta": -2
  }
}
#### Graphql Response
{
  "data": {
    "inventoryAdjustQuantity": {
      "inventoryLevel": {
        "id": "gid://shopify/InventoryLevel/964427794?inventory_item_id=43729076",
        "quantities": [
          {
            "name": "available",
            "quantity": -1
          }
        ],
        "incoming": 0,
        "item": {
          "id": "gid://shopify/InventoryItem/43729076",
          "sku": "draft-151"
        },
        "location": {
          "id": "gid://shopify/Location/124656943",
          "name": "Shipping Origin"
        }
      }
    }
  }
}

### Increase the available inventory of an item at a location by 3
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/unstable/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation AdjustInventoryQuantity($input: InventoryAdjustQuantityInput!) { inventoryAdjustQuantity(input: $input) { inventoryLevel { id quantities(names: [\\\"available\\\"]) { name quantity } incoming item { id sku } location { id name } } } }\",\n \"variables\": {\n    \"input\": {\n      \"inventoryLevelId\": \"gid://shopify/InventoryLevel/964427794?inventory_item_id=43729076\",\n      \"availableDelta\": 3\n    }\n  }\n}'\n"
Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n  data: {\n    \"query\": `mutation AdjustInventoryQuantity($input: InventoryAdjustQuantityInput!) {\n      inventoryAdjustQuantity(input: $input) {\n        inventoryLevel {\n          id\n          quantities(names: [\"available\"]) {\n            name\n            quantity\n          }\n          incoming\n          item {\n            id\n            sku\n          }\n          location {\n            id\n            name\n          }\n        }\n      }\n    }`,\n    \"variables\": {\n      \"input\": {\n        \"inventoryLevelId\": \"gid://shopify/InventoryLevel/964427794?inventory_item_id=43729076\",\n        \"availableDelta\": 3\n      }\n    },\n  },\n});\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  mutation AdjustInventoryQuantity($input: InventoryAdjustQuantityInput!) {\n    inventoryAdjustQuantity(input: $input) {\n      inventoryLevel {\n        id\n        quantities(names: [\"available\"]) {\n          name\n          quantity\n        }\n        incoming\n        item {\n          id\n          sku\n        }\n        location {\n          id\n          name\n        }\n      }\n    }\n  }\nQUERY\n\nvariables = {\n  \"input\": {\n    \"inventoryLevelId\": \"gid://shopify/InventoryLevel/964427794?inventory_item_id=43729076\",\n    \"availableDelta\": 3\n  }\n}\n\nresponse = client.query(query: query, variables: variables)\n" 
Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n  `#graphql\n  mutation AdjustInventoryQuantity($input: InventoryAdjustQuantityInput!) {\n    inventoryAdjustQuantity(input: $input) {\n      inventoryLevel {\n        id\n        quantities(names: [\"available\"]) {\n          name\n          quantity\n        }\n        incoming\n        item {\n          id\n          sku\n        }\n        location {\n          id\n          name\n        }\n      }\n    }\n  }`,\n  {\n    variables: {\n      \"input\": {\n        \"inventoryLevelId\": \"gid://shopify/InventoryLevel/964427794?inventory_item_id=43729076\",\n        \"availableDelta\": 3\n      }\n    },\n  },\n);\n\nconst data = await response.json();\n"
Graphql query: "mutation AdjustInventoryQuantity($input: InventoryAdjustQuantityInput!) {\n  inventoryAdjustQuantity(input: $input) {\n    inventoryLevel {\n      id\n      quantities(names: [\"available\"]) {\n        name\n        quantity\n      }\n      incoming\n      item {\n        id\n        sku\n      }\n      location {\n        id\n        name\n      }\n    }\n  }\n}"
#### Graphql Input
{
  "input": {
    "inventoryLevelId": "gid://shopify/InventoryLevel/964427794?inventory_item_id=43729076",
    "availableDelta": 3
  }
}
#### Graphql Response
{
  "data": {
    "inventoryAdjustQuantity": {
      "inventoryLevel": {
        "id": "gid://shopify/InventoryLevel/964427794?inventory_item_id=43729076",
        "quantities": [
          {
            "name": "available",
            "quantity": 4
          }
        ],
        "incoming": 0,
        "item": {
          "id": "gid://shopify/InventoryItem/43729076",
          "sku": "draft-151"
        },
        "location": {
          "id": "gid://shopify/Location/124656943",
          "name": "Shipping Origin"
        }
      }
    }
  }
}