medusajs/medusa · error · Error

Action ${associatedAction.id} is not adding a shipping metho

Error message

Action ${associatedAction.id} is not adding a shipping method

What it means

Thrown when updating a claim's shipping method: the referenced action exists but is not of type SHIPPING_ADD. Only shipping-add actions can be updated by this workflow.

Source

Thrown at packages/core/core-flows/src/order/workflows/claim/update-claim-shipping-method.ts:101

  "validate-update-claim-shipping-method",
  async function ({
    orderChange,
    orderClaim,
    input,
  }: UpdateClaimShippingMethodValidationStepInput) {
    throwIfIsCancelled(orderClaim, "Claim")
    throwIfOrderChangeIsNotActive({ orderChange })

    const associatedAction = (orderChange.actions ?? []).find(
      (a) => a.id === input.action_id
    ) as OrderChangeActionDTO

    if (!associatedAction) {
      throw new Error(
        `No shipping method found for claim ${input.claim_id} in order change ${orderChange.id}`
      )
    } else if (associatedAction.action !== ChangeActionType.SHIPPING_ADD) {
      throw new Error(
        `Action ${associatedAction.id} is not adding a shipping method`
      )
    }
  }
)

export const updateClaimShippingMethodWorkflowId =
  "update-claim-shipping-method"
/**
 * This workflow updates a claim's inbound (return) or outbound (delivery of new items) shipping method.
 * It's used by the [Update Inbound Shipping Admin API Route](https://docs.medusajs.com/api/admin/claims/update-inbound-shipping),
 * and the [Update Outbound Shipping Admin API Route](https://docs.medusajs.com/api/admin/claims/update-outbound-shipping).
 *
 * You can use this workflow within your customizations or your own custom workflows, allowing you to update a claim's shipping method
 * in your own custom flows.
 *
 * @example
 * const { result } = await updateClaimShippingMethodWorkflow(container)

View on GitHub (pinned to 5e06e544a2)

Solutions

  1. Filter for action === ChangeActionType.SHIPPING_ADD before selecting the id
  2. Ensure the action id comes from createClaimShippingMethodWorkflow output
  3. Use the item-update workflow if you meant to update an item
Defensive patterns

Strategy: validation

Validate before calling

if (orderChange.actions?.find((a) => a.id === actionId)?.action !== ChangeActionType.SHIPPING_ADD) throw new Error('Wrong action')

Type guard

const isShippingAddAction = (a?: OrderChangeActionDTO) =>
  !!a && a.action === ChangeActionType.SHIPPING_ADD

Prevention

When it happens

Trigger: Calling updateClaimShippingMethodWorkflow with an action_id whose action type is ITEM_ADD, WRITE_OFF_ITEM, etc.

Common situations: Passing the wrong action row from the admin order-change list; mixing up workflows for items vs shipping methods.

Related errors


AI-assisted analysis of medusajs/medusa@5e06e544a2 (2026-08-27). Data as JSON: /api/errors/b3e6e1d0e398c151. Report an issue: GitHub.