Loading...
Was this page helpful?
This documentation provides a reference to the requestItemReturnValidationStep
. It belongs to the @medusajs/medusa/core-flows
package.
This step validates that items can be added to a return. If the order or return is canceled, the order change is not active, the items do not exist in the order, or the return reasons are invalid, the step will throw an error.
1const data = requestItemReturnValidationStep({2 order: {3 id: "order_123",4 items: [5 {6 id: "orli_123",7 // other item details...8 }9 ]10 },11 orderChange: {12 id: "orch_123",13 // other order change details...14 },15 orderReturn: {16 id: "return_123",17 // other return details...18 },19 items: [20 {21 id: "orli_123",22 quantity: 1,23 }24 ]25})
RequestItemReturnValidationStepInput
RequestItemReturnValidationStepInputorder
Pick<OrderDTO, "id" | "items">orderReturn
ReturnDTOorderChange
OrderChangeDTOitems
RequestItemReturnWorkflowInput["items"]