- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Menu
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
requestItemReturnValidationStep - Medusa Core Workflows Reference
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.
Note: You can retrieve an order, return, and order change details using Query,
or useQueryGraphStep.
Example#
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})
Input#
RequestItemReturnValidationStepInput
RequestItemReturnValidationStepInputThe data to validate that items can be added to a return.
RequestItemReturnValidationStepInput
RequestItemReturnValidationStepInputorder
Pick<OrderDTO, "id" | "items">The order's details.
order
Pick<OrderDTO, "id" | "items">orderReturn
ReturnDTOThe return's details.
orderReturn
ReturnDTOorderChange
OrderChangeDTOThe order change's details.
orderChange
OrderChangeDTOitems
RequestItemReturnWorkflowInput["items"]The items to be added to the return.
items
RequestItemReturnWorkflowInput["items"]Was this page helpful?