> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# appmixer.shopify.inventory.SetInventoryQuantity

- Component: `appmixer.shopify.inventory.SetInventoryQuantity`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.shopify 4.1.0](https://connectors.appmixer.com/connector/appmixer.shopify/4.1.0.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.shopify/4.1.0/component/appmixer.shopify.inventory.SetInventoryQuantity>

Set the available (or on-hand) quantity of a product variant's inventory at a location. Switches inventory tracking on and stocks the item at the location when needed. Returns the inventory level. Needs the write_inventory access scope on the Shopify app.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Inventory Item ID (`inventoryItemId`) | text | The inventory item of the product variant (gid://shopify/InventoryItem/123 or 123), for example variants[].inventoryItem.id of Get Product. A product variant ID (gid://shopify/ProductVariant/123) is accepted too. |
| Location ID (`locationId`) | text | The location (gid://shopify/Location/123 or 123). Leave empty to use the location the item is stocked at, or the store's primary location. |
| Quantity (`quantity`) | number | The new quantity, a whole number. |
| Quantity Type (`quantityName`) | select | Which quantity to set: available for sale, or on hand (available plus committed and reserved units). |
| Reason (`reason`) | select | The reason Shopify records in the inventory history. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Inventory Level ID (`id`) | string | - |
| Active (`isActive`) | boolean | - |
| Created At (`createdAt`) | string | - |
| Updated At (`updatedAt`) | string | - |
| Quantities (`quantities`) | array | - |
| Inventory Item (`item`) | object | - |
| Location (`location`) | object | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.shopify.inventory.SetInventoryQuantity",
  "description": "Set the available (or on-hand) quantity of a product variant's inventory at a location. Switches inventory tracking on and stocks the item at the location when needed. Returns the inventory level. Needs the write_inventory access scope on the Shopify app.",
  "author": "Appmixer <info@appmixer.com>",
  "private": false,
  "auth": {
    "service": "appmixer:shopify",
    "scope": [
      "read_inventory",
      "read_locations",
      "write_products"
    ]
  },
  "quota": {
    "manager": "appmixer:shopify",
    "resources": "requests",
    "scope": {
      "userId": "{{userId}}"
    }
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "inventoryItemId": {
            "type": "string"
          },
          "locationId": {
            "type": "string"
          },
          "quantity": {
            "type": "integer"
          },
          "quantityName": {
            "type": "string",
            "enum": [
              "available",
              "on_hand"
            ]
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "inventoryItemId",
          "quantity"
        ]
      },
      "inspector": {
        "inputs": {
          "inventoryItemId": {
            "type": "text",
            "label": "Inventory Item ID",
            "index": 1,
            "tooltip": "The inventory item of the product variant (gid://shopify/InventoryItem/123 or 123), for example variants[].inventoryItem.id of Get Product. A product variant ID (gid://shopify/ProductVariant/123) is accepted too."
          },
          "locationId": {
            "type": "text",
            "label": "Location ID",
            "index": 2,
            "tooltip": "The location (gid://shopify/Location/123 or 123). Leave empty to use the location the item is stocked at, or the store's primary location."
          },
          "quantity": {
            "type": "number",
            "label": "Quantity",
            "index": 3,
            "tooltip": "The new quantity, a whole number."
          },
          "quantityName": {
            "type": "select",
            "label": "Quantity Type",
            "index": 4,
            "defaultValue": "available",
            "tooltip": "Which quantity to set: available for sale, or on hand (available plus committed and reserved units).",
            "options": [
              {
                "label": "Available",
                "value": "available"
              },
              {
                "label": "On hand",
                "value": "on_hand"
              }
            ]
          },
          "reason": {
            "type": "select",
            "label": "Reason",
            "index": 5,
            "defaultValue": "correction",
            "tooltip": "The reason Shopify records in the inventory history.",
            "options": [
              {
                "label": "Correction",
                "value": "correction"
              },
              {
                "label": "Cycle count",
                "value": "cycle_count_available"
              },
              {
                "label": "Received",
                "value": "received"
              },
              {
                "label": "Restock",
                "value": "restock"
              },
              {
                "label": "Damaged",
                "value": "damaged"
              },
              {
                "label": "Shrinkage",
                "value": "shrinkage"
              },
              {
                "label": "Promotion",
                "value": "promotion"
              },
              {
                "label": "Quality control",
                "value": "quality_control"
              },
              {
                "label": "Safety stock",
                "value": "safety_stock"
              },
              {
                "label": "Other",
                "value": "other"
              }
            ]
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "schema": {
        "type": "object",
        "required": [
          "id",
          "isActive",
          "createdAt",
          "updatedAt",
          "quantities",
          "item",
          "location"
        ],
        "properties": {
          "id": {
            "type": "string",
            "title": "Inventory Level ID",
            "example": "gid://shopify/InventoryLevel/164439392337?inventory_item_id=64806874841169"
          },
          "isActive": {
            "type": "boolean",
            "title": "Active",
            "example": true
          },
          "createdAt": {
            "type": "string",
            "title": "Created At",
            "example": "2026-10-02T10:36:04Z",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "title": "Updated At",
            "example": "2026-10-02T15:33:11Z",
            "format": "date-time"
          },
          "quantities": {
            "type": "array",
            "title": "Quantities",
            "items": {
              "type": "object",
              "required": [
                "name",
                "quantity"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "title": "Name",
                  "example": "available"
                },
                "quantity": {
                  "type": "integer",
                  "title": "Quantity",
                  "example": 7
                }
              }
            },
            "example": [
              {
                "name": "available",
                "quantity": 7
              },
              {
                "name": "on_hand",
                "quantity": 9
              },
              {
                "name": "committed",
                "quantity": 2
              },
              {
                "name": "incoming",
                "quantity": 0
              },
              {
                "name": "reserved",
                "quantity": 0
              }
            ]
          },
          "item": {
            "type": "object",
            "title": "Inventory Item",
            "required": [
              "id",
              "legacyResourceId",
              "tracked",
              "variants"
            ],
            "properties": {
              "id": {
                "type": "string",
                "title": "Inventory Item.ID",
                "example": "gid://shopify/InventoryItem/64806874841169"
              },
              "legacyResourceId": {
                "type": "string",
                "title": "Inventory Item.Legacy Resource ID",
                "example": "64806874841169"
              },
              "sku": {
                "type": "string",
                "title": "Inventory Item.SKU",
                "example": "SNOW-OOS-01"
              },
              "tracked": {
                "type": "boolean",
                "title": "Inventory Item.Tracked",
                "example": true
              },
              "variants": {
                "type": "array",
                "title": "Inventory Item.Variants",
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "legacyResourceId",
                    "title",
                    "displayName",
                    "product"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "title": "ID",
                      "example": "gid://shopify/ProductVariant/62788973264977"
                    },
                    "legacyResourceId": {
                      "type": "string",
                      "title": "Legacy Resource ID",
                      "example": "62788973264977"
                    },
                    "title": {
                      "type": "string",
                      "title": "Title",
                      "example": "Default Title"
                    },
                    "displayName": {
                      "type": "string",
                      "title": "Display Name",
                      "example": "The Out of Stock Snowboard - Default Title"
                    },
                    "product": {
                      "type": "object",
                      "title": "Product",
                      "required": [
                        "id",
                        "title"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "title": "Product.ID",
                          "example": "gid://shopify/Product/16344831623249"
                        },
                        "title": {
                          "type": "string",
                          "title": "Product.Title",
                          "example": "The Out of Stock Snowboard"
                        }
                      }
                    }
                  }
                },
                "example": [
                  {
                    "id": "gid://shopify/ProductVariant/62788973264977",
                    "legacyResourceId": "62788973264977",
                    "title": "Default Title",
                    "displayName": "The Out of Stock Snowboard - Default Title",
                    "product": {
                      "id": "gid://shopify/Product/16344831623249",
                      "title": "The Out of Stock Snowboard"
                    }
                  }
                ]
              }
            }
          },
          "location": {
            "type": "object",
            "title": "Location",
            "required": [
              "id",
              "legacyResourceId",
              "name"
            ],
            "properties": {
              "id": {
                "type": "string",
                "title": "Location.ID",
                "example": "gid://shopify/Location/124679880785"
              },
              "legacyResourceId": {
                "type": "string",
                "title": "Location.Legacy Resource ID",
                "example": "124679880785"
              },
              "name": {
                "type": "string",
                "title": "Location.Name",
                "example": "Shop location"
              }
            }
          }
        }
      }
    }
  ],
  "icon": "(data URI omitted)"
}
```
