order Edit Set Quantity
Requires access scope.
Sets the quantity of a line item on an order that's being edited. Use this mutation to increase, decrease, or remove items by adjusting their quantities.
Setting the quantity to zero effectively removes the line item from the order. The item still exists as a data structure with zero quantity. When decreasing quantities, you can optionally restock the removed items to inventory by setting the restock parameter to true.
Learn more about editing workflows for existing orders.
Arguments
- •ID!required
The ID of the calculated order or the order edit session to edit. The edit changes the quantity on the line item.
- Anchor to lineItemIdline•ID!
Item Id required The ID of the calculated line item to edit.
- Anchor to quantityquantity•Int!required
The new quantity to set for the line item. This value cannot be negative.
- Anchor to restockrestock•Boolean
Whether or not to restock the line item when the updated quantity is less than the original quantity.
- Anchor to locationIdlocation•ID
Id Deprecated
- Anchor to calculatedLineItemcalculated•Calculated
Line Item Line Item The calculated line item with the edits applied but not saved.
- Anchor to calculatedOrdercalculated•Calculated
Order Order The calculated order with the edits applied but not saved.
- Anchor to orderEditSessionorder•Order
Edit Session Edit Session The order edit session with the edits applied but not saved.
- Anchor to userErrorsuser•[User
Errors Error!]! non-null The list of errors that occurred from executing the mutation.