updateOrderItems
Updates order items for a V2 order.
The provided items represent the desired final set of line items for the order.
Requirements
- User must have
update_orderpermission - Valid brand context must be provided (via argument or X-Brand-Id header)
- Order must exist and be in one of: "draft", "pending", "in_progress", "fulfilled"
- Order must be using the V2 aggregate (internal_version = "v2")
- Order items array must be provided and contain at least one item
Arguments
order_id(required): The ID of the order to updateorder_items(required): Array representing the final desired set of order itemsbrand_id(optional): The brand ID (can be provided via X-Brand-Id header)
Order Items
Each order item should include:
product_idorsku(at least one required): Product identifierquantity(required): Quantity must be greater than 0price(optional): Item pricediscount(optional): Item discountexternal_id(optional): External identifier for the item
Behavior
- Applies the provided list as the final set of order items
- Existing items are matched by
idwhen provided and preserved when possible - Removing or changing quantity for items linked to active fulfillments is blocked
- For items linked to active fulfillments,
product_idandskuare immutable - Validates product existence (adds alert if product not found but continues)
- Validates quantity is positive
- Returns the updated order with current order items
updateOrderItems(
input: UpdateOrderItemsInput!
): V2Order!
Arguments
updateOrderItems.input ● UpdateOrderItemsInput! non-null input common
Parameters for UpdateOrderItems
Type
V2Order object orders
The V2 order type. This type represents a V2 order in the system with only the fields necessary for draft creation and details.