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
idis accepted as a backwards-compatible alias fororder_item_id.- If both
idandorder_item_idare provided, they must identify the same item. - When
unlink_productis true, the order item's current product link is removed (its SKU and name are left in place). product_idandunlink_productcannot be provided together.- When
product_idis provided, the order item is linked to that product and adopts its SKU and name. An existing link is only replaced when a newproduct_idis given. quantity,priceanddiscountare 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_itempermission for V1 orders.update_orderpermission 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.