{"record":{"id":"d310760cae69c318","repo":"medusajs/medusa","slug":"no-shipping-method-found-for-order-input-order-i","errorCode":null,"errorMessage":"No shipping method found for order ${input.order_id} in order change ${orderChange.id}","messagePattern":"No shipping method found for order (.+?) in order change (.+?)","errorType":"exception","errorClass":"MedusaError","httpStatus":400,"severity":"error","filePath":"packages/core/core-flows/src/draft-order/steps/validate-draft-order-shipping-method-action.ts","lineNumber":57,"sourceCode":" *   },\n *   orderChange: {\n *     id: \"orch_123\",\n *     // other order change details...\n *   }\n * })\n */\nexport const validateDraftOrderShippingMethodActionStep = createStep(\n  \"validate-draft-order-shipping-method-action\",\n  async function ({\n    input,\n    orderChange,\n  }: ValidateDraftOrderShippingMethodActionStepInput) {\n    const associatedAction = (orderChange.actions ?? []).find(\n      (a) => a.id === input.action_id\n    ) as OrderChangeActionDTO\n\n    if (!associatedAction) {\n      throw new MedusaError(\n        MedusaError.Types.INVALID_DATA,\n        `No shipping method found for order ${input.order_id} in order change ${orderChange.id}`\n      )\n    }\n\n    if (associatedAction.action !== ChangeActionType.SHIPPING_ADD) {\n      throw new MedusaError(\n        MedusaError.Types.INVALID_DATA,\n        `Action ${associatedAction.id} is not adding a shipping method`\n      )\n    }\n  }\n)\n","sourceCodeStart":39,"sourceCodeEnd":71,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/core/core-flows/src/draft-order/steps/validate-draft-order-shipping-method-action.ts#L39-L71","documentation":"validateDraftOrderShippingMethodActionStep looks for input.action_id among the order change's actions; if absent, the shipping-method action you target does not exist in the pending change.","triggerScenarios":"Calling the draft-order remove/update shipping method action workflow with an action_id not present on the current pending order change.","commonSituations":"Change already confirmed; stale action id from an earlier UI load; concurrent edit; wrong order's change.","solutions":["Re-fetch the pending order change and its actions, use a current SHIPPING_ADD action id","Verify the order change status is still pending","Refresh client state after confirm operations"],"exampleFix":"// before\nawait deleteDraftOrderShippingMethodWorkflow(container).run({ input: { order_id, action_id: staleId } })\n\n// after\nconst changes = await query.graph({ entity: \"order_change\", filters: { order_id }, fields: [\"status\", \"actions.*\"] })\nconst action = changes.data[0]?.actions.find((a) => a.action === \"SHIPPING_ADD\")\nif (action) {\n  await deleteDraftOrderShippingMethodWorkflow(container).run({ input: { order_id, action_id: action.id } })\n}","handlingStrategy":"validation","validationCode":"const changes = await query.graph({ entity: \"order_change\", filters: { order_id }, fields: [\"actions.id\", \"actions.action\"] })\nconst exists = changes.data[0]?.actions.some((a) => a.id === action_id && a.action === \"SHIPPING_ADD\")","typeGuard":null,"tryCatchPattern":"try { await workflow(scope).run({ input }) } catch (e) { if (/No shipping method found for order .* in order change/.test(e.message)) { /* refetch actions */ } throw e }","preventionTips":["Refetch pending change actions before shipping-method removals","Confirm the change is still pending"],"tags":["draft-order","shipping-method","order-change","not-found"],"backgroundTag":"order-change-action-not-found","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}