createReturnsStep - Medusa Core Workflows Reference

This documentation provides a reference to the createReturnsStep. It belongs to the @medusajs/medusa/core-flows package.

This step creates returns.

src/workflows/my-workflow.ts
1import { createWorkflow } from "@medusajs/framework/workflows-sdk"2import { createReturnsStep } from "@medusajs/medusa/core-flows"3
4const myWorkflow = createWorkflow(5  "my-workflow",6  () => {7    const data = createReturnsStep([{8      "order_id": "order_123"9    }])10  }11)

Input#

CreateOrderReturnDTO[]CreateOrderReturnDTO[]
order_idstring
The associated order's ID.
return_idstringOptional
The associated return's ID.
descriptionstringOptional
The description of the action.
internal_notestringOptional
The internal note of the action.
referencestringOptional
The name of the data model the action references. For example, return.
reference_idstringOptional
The ID of the record of the data model specified in reference. For example, if reference is return, the value is return_123.
metadatanull | Record<string, unknown>Optional
Holds custom data in key-value pairs.
location_idstringOptional
The ID of the location to return the items to.
itemsobject[]Optional
The items of the return.
shipping_methodstring | Omit<CreateOrderShippingMethodDTO, "order_id">Optional
The shipping method of the return.
refund_amountBigNumberInputOptional
The refund amount of the return.
no_notificationbooleanOptional
Whether the customer should receive notifications related to updates on the return.
claim_idstringOptional
The associated claim's ID.
exchange_idstringOptional
The associated exchange's ID.
created_bynull | stringOptional
The id of the user that creates the fulfillment

Output#

ReturnDTO[]ReturnDTO[]
idstring
The ID of the return.
The status of the return.
order_idstring
The associated order's ID.
The items of the return
display_idnumber
The return's display ID.
metadatanull | Record<string, unknown>
Holds custom data in key-value pairs.
refund_amountBigNumberValueOptional
The refund amount of the return.
raw_refund_amountBigNumberValueOptional
The raw refund amount of the return.
orderOrderDTOOptional
The associated order.
exchange_idstringOptional
The associated exchange's ID.
exchangeOrderExchangeDTOOptional
The associated exchange.
claim_idstringOptional
The associated claim's ID.
claimOrderClaimDTOOptional
The associated claim.
location_idstringOptional
The ID of the location to return the items to.
no_notificationbooleanOptional
Whether the customer should receive notifications related to updates on the return.
created_bynull | stringOptional
The id of the user that created the return
shipping_methodsOrderShippingMethodDTO[]Optional
The shipping methods used to receive the returned items.
transactionsOrderTransactionDTO[]Optional
The return's transactions if refund is required.
created_atstring | DateOptional
The creation date of the return.
updated_atstring | DateOptional
The update date of the return.
deleted_atstring | DateOptional
The deletion date of the return.
canceled_atstring | DateOptional
The cancelation date of the return.
requested_atstring | DateOptional
The request date of the return.
received_atstring | DateOptional
The receival date of the return.
Was this page helpful?
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break