Skip to main content
Anchor to orderEditSetQuantity

orderEditSetQuantity

mutation

Requires write_order_edits 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.

•ID!
required

The ID of the calculated order or the order edit session to edit. The edit changes the quantity on the line item.

•ID!
required

The ID of the calculated line item to edit.

•Int!
required

The new quantity to set for the line item. This value cannot be negative.

•Boolean

Whether or not to restock the line item when the updated quantity is less than the original quantity.

•ID
Deprecated

Was this section helpful?

Anchor to OrderEditSetQuantityPayload returnsOrderEditSetQuantityPayload returns

•CalculatedLineItem

The calculated line item with the edits applied but not saved.

•CalculatedOrder

The calculated order with the edits applied but not saved.

•OrderEditSession

The order edit session with the edits applied but not saved.

•[UserError!]!
non-null

The list of errors that occurred from executing the mutation.


Was this section helpful?