Skip to main content

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_order permission
  • 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 update
  • order_items (required): Array representing the final desired set of order items
  • brand_id (optional): The brand ID (can be provided via X-Brand-Id header)

Order Items

Each order item should include:

  • product_id or sku (at least one required): Product identifier
  • quantity (required): Quantity must be greater than 0
  • price (optional): Item price
  • discount (optional): Item discount
  • external_id (optional): External identifier for the item

Behavior

  • Applies the provided list as the final set of order items
  • Existing items are matched by id when provided and preserved when possible
  • Removing or changing quantity for items linked to active fulfillments is blocked
  • For items linked to active fulfillments, product_id and sku are 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.