Skip to main content

updateOrderItem

Update a single order item in place.

This updates one order item without recreating the line, so its fulfillment and allocation history are preserved. Use it to link, change or unlink the product on a line, or to update quantity, price or discount without replacing the whole order item set. Legacy callers may continue to identify the item with id.

Business Rules

  • id is accepted as a backwards-compatible alias for order_item_id.
  • If both id and order_item_id are provided, they must identify the same item.
  • When unlink_product is true, the order item's current product link is removed (its SKU and name are left in place).
  • product_id and unlink_product cannot be provided together.
  • When product_id is provided, the order item is linked to that product and adopts its SKU and name. An existing link is only replaced when a new product_id is given.
  • quantity, price and discount are only changed when explicitly provided.
  • The selected product must belong to the same company as the order.
  • Product link changes are blocked once the line's inventory has been allocated.
  • Quantity cannot be reduced below the quantity that has already been allocated.
  • Product link changes are only supported for V2 orders.

Error Scenarios

  • **NOT_FOUND**: when the order, order item, or selected product does not exist.
  • **BAD_REQUEST**: when the input contains conflicting identifiers or product actions.
  • **UNPROCESSABLE_CONTENT**: when the order item's inventory has been allocated.

Permissions Required

  • update_order_item permission for V1 orders.
  • update_order permission for V2 orders.
updateOrderItem(
input: UpdateOrderItemInput!
): OrderItem!

Arguments

updateOrderItem.input ● UpdateOrderItemInput! non-null input common

Parameters for UpdateOrderItem

Type

OrderItem object orders

The order item type. This type represents an order item in the system.