{"record":{"id":"155c545fd56b5c4b","repo":"medusajs/medusa","slug":"action-associatedaction-id-is-not-claiming-the","errorCode":null,"errorMessage":"Action ${associatedAction.id} is not claiming the item","messagePattern":"Action (.+?) is not claiming the item","errorType":"validation","errorClass":"Error","httpStatus":500,"severity":"error","filePath":"packages/core/core-flows/src/order/workflows/claim/update-claim-item.ts","lineNumber":108,"sourceCode":"      orderClaim,\n      input,\n    }: UpdateClaimItemValidationStepInput,\n    context\n  ) {\n    throwIfIsCancelled(order, \"Order\")\n    throwIfIsCancelled(orderClaim, \"Claim\")\n    throwIfOrderChangeIsNotActive({ orderChange })\n\n    const associatedAction = (orderChange.actions ?? []).find(\n      (a) => a.id === input.action_id\n    ) as OrderChangeActionDTO\n\n    if (!associatedAction) {\n      throw new Error(\n        `No request claim found for claim ${input.claim_id} in order change ${orderChange.id}`\n      )\n    } else if (associatedAction.action !== ChangeActionType.WRITE_OFF_ITEM) {\n      throw new Error(`Action ${associatedAction.id} is not claiming the item`)\n    }\n  }\n)\n\nexport const updateClaimItemWorkflowId = \"update-claim-item\"\n/**\n * This workflow updates a claim item, added to the claim from an order item.\n * It's used by the [Update Claim Item Admin API Route](https://docs.medusajs.com/api/admin/claims/update-a-claim-item).\n * \n * You can use this workflow within your customizations or your own custom workflows, allowing you to update a claim item\n * in your custom flows.\n * \n * @example\n * const { result } = await updateClaimItemWorkflow(container)\n * .run({\n *   input: {\n *     claim_id: \"claim_123\",\n *     action_id: \"orchact_123\",","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/core/core-flows/src/order/workflows/claim/update-claim-item.ts#L90-L126","documentation":"Thrown when updating a claim item: the referenced order change action exists but its type is not WRITE_OFF_ITEM (the action type used to claim/write off an item). Only write-off actions can be updated here.","triggerScenarios":"Calling updateClaimItemWorkflow with an action_id whose action !== ChangeActionType.WRITE_OFF_ITEM, e.g. an ITEM_ADD (outbound) or SHIPPING_ADD action.","commonSituations":"Confusing inbound (write-off) and outbound (add-item) actions when building the update request; admin UI passing the wrong action row.","solutions":["Select an action with action === ChangeActionType.WRITE_OFF_ADD/WRITE_OFF_ITEM from the claim's order change","For outbound added items use updateClaimAddItemWorkflow instead","Validate action type before invoking the workflow"],"exampleFix":"// before\nawait updateClaimItemWorkflow(container).run({\n  input: { claim_id, action_id: outboundAction.id },\n})\n\n// after\nconst writeOff = orderChange.actions.find(\n  (a) => a.action === ChangeActionType.WRITE_OFF_ITEM\n)\nif (writeOff) {\n  await updateClaimItemWorkflow(container).run({\n    input: { claim_id, action_id: writeOff.id, quantity: 2 },\n  })\n}","handlingStrategy":"validation","validationCode":"const action = orderChange.actions?.find((a) => a.id === actionId)\nif (action?.action !== ChangeActionType.WRITE_OFF_ITEM) throw new Error('Not a claim-item action')","typeGuard":"const isWriteOffAction = (a?: OrderChangeActionDTO) =>\n  !!a && a.action === ChangeActionType.WRITE_OFF_ITEM","tryCatchPattern":null,"preventionTips":["Distinguish inbound (write-off) vs outbound (item add) actions in payloads"],"tags":["order","claim","order-change","validation"],"backgroundTag":"invalid-order-change-action-type","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}