medusajs/medusa · error · MedusaError
No request to add item for order ${input.order_id} in order
Error message
No request to add item for order ${input.order_id} in order change ${orderChange.id} What it means
validateDraftOrderUpdateActionItemStep requires the given action_id to exist among the order change's actions; thrown when trying to update a draft-order add-item request whose action no longer exists on the change.
Source
Thrown at packages/core/core-flows/src/draft-order/steps/validate-draft-order-update-action-item.ts:55
* },
* orderChange: {
* id: "orch_123",
* // other order change details...
* }
* })
*/
export const validateDraftOrderUpdateActionItemStep = createStep(
"validate-draft-order-update-action-item",
async function ({
input,
orderChange,
}: ValidateDraftOrderUpdateActionItemStepInput) {
const associatedAction = (orderChange.actions ?? []).find(
(a) => a.id === input.action_id
) as OrderChangeActionDTO
if (!associatedAction) {
throw new MedusaError(
MedusaError.Types.INVALID_DATA,
`No request to add item for order ${input.order_id} in order change ${orderChange.id}`
)
}
if (associatedAction.action !== ChangeActionType.ITEM_ADD) {
throw new MedusaError(
MedusaError.Types.INVALID_DATA,
`Action ${associatedAction.id} is not adding an item`
)
}
}
)
View on GitHub (pinned to 5e06e544a2)
Solutions
- Re-fetch the pending order change and its ITEM_ADD actions; use a valid id
- Ensure the draft order is still in a pending/unconfirmed change state
- Refresh the client after confirmations
Example fix
// before
await updateDraftOrderUpdateItemActionWorkflow(container).run({ input: { order_id, action_id: staleId, data: { quantity: 3 } } })
// after
const action = pendingChange.actions.find((a) => a.id === wantedId && a.action === "ITEM_ADD")
if (action) {
await updateDraftOrderUpdateItemActionWorkflow(container).run({ input: { order_id, action_id: action.id, data: { quantity: 3 } } })
} Defensive patterns
Strategy: validation
Validate before calling
const changes = await query.graph({ entity: "order_change", filters: { order_id }, fields: ["actions.id", "actions.action"] })
const action = changes.data[0]?.actions.find((a) => a.id === action_id && a.action === "ITEM_ADD")
if (!action) throw new Error("Stale action") Try / catch
try { await workflow(scope).run({ input }) } catch (e) { if (/No request to add item/.test(e.message)) { /* refetch and reselect action */ } throw e } Prevention
- Refetch pending add-item actions before editing their quantity
When it happens
Trigger: Calling updateDraftOrderUpdateItemActionWorkflow (edit a pending 'add item' request) with an action_id absent from the current order change.
Common situations: Draft order confirmed so pending actions cleared; stale action id in the client; concurrent admin edits.
Related errors
- No item found for order ${input.order_id} in order change ${
- No shipping method found for order ${input.order_id} in orde
- A shipping method with id ${input.shipping_method_id} was no
- Action ${associatedAction.id} is not adding or updating an i
- Action ${associatedAction.id} is not adding an item
AI-assisted analysis of medusajs/medusa@5e06e544a2 (2026-08-27).
Data as JSON: /api/errors/9b8b21de6745163c.
Report an issue: GitHub.