Ostorya dev docs

Admin API/Inventory/Mutations

inventorySetQuantities

mutation

Sets absolute quantities (e.g. after a stock count). compareQuantity guards against overwriting a change you haven't seen.

Returns InventorySetQuantitiesPayload!

mutation InventorySetQuantities($input: InventorySetQuantitiesInput!) {
  inventorySetQuantities(input: $input) {
    inventoryAdjustmentGroup {
      id
      createdAt
      reason
      referenceDocumentUri
    }
    userErrors {
      code
      message
      field
    }
  }
}

# Variables
{
  "input": {
    "name": "",
    "quantities": [
      {
        "inventoryItemId": "gid://ostorya/InventoryItem/0f8c5b1e-…",
        "locationId": "gid://ostorya/Location/0f8c5b1e-…",
        "quantity": 1
      }
    ],
    "reason": ""
  }
}

Arguments

Payload

inventoryAdjustmentGroupInventoryAdjustmentGroup
userErrors[UserError!]!required