createReturnFulfillmentStep - Medusa Core Workflows Reference

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

This step creates a fulfillment for a return.

Example#

Code
1const data = createReturnFulfillmentStep({2  location_id: "sloc_123",3  provider_id: "provider_123",4  delivery_address: {5    first_name: "John",6    last_name: "Doe",7    address_1: "Test Street 1",8    city: "Test City",9    postal_code: "12345",10    country_code: "US",11    phone: "123456789",12  },13  items: [14    {15      title: "Shirt",16      sku: "shirt",17      quantity: 1,18      barcode: "123456789",19    }20  ]21})

Input#

CreateFulfillmentDTOCreateFulfillmentDTO
The fulfillment to be created.
location_idstring
The associated location's ID.
provider_idstring
The associated fulfillment provider's ID.
delivery_addressOmit<CreateFulfillmentAddressDTO, "fulfillment_id">
The address associated with the fulfillment. It's used for delivery.
itemsOmit<CreateFulfillmentItemDTO, "fulfillment_id">[]
The items associated with the fulfillment.
locationStockLocationDTOOptional
The associated location's data.
packed_atnull | DateOptional
The date the fulfillment was packed.
shipped_atnull | DateOptional
The date the fulfillment was shipped.
created_bynull | stringOptional
The id of the user that created the fulfillment
delivered_atnull | DateOptional
The date the fulfillment was delivered.
canceled_atnull | DateOptional
The date the fulfillment was canceled.
datanull | Record<string, unknown>Optional
The data necessary for the associated fulfillment provider to process the fulfillment.
shipping_option_idnull | stringOptional
The associated shipping option's ID.
requires_shippingbooleanOptional
Flag to indicate whether shipping is required
metadatanull | Record<string, unknown>Optional
Holds custom data in key-value pairs.
labelsOmit<CreateFulfillmentLabelDTO, "fulfillment_id">[]Optional
The labels associated with the fulfillment.
orderPartial<OrderDTO>Optional
The associated order to be sent to the provider.

Output#

FulfillmentDTOFulfillmentDTO
The fulfillment details.
idstring
The ID of the fulfillment.
location_idstring
The associated location's ID.
packed_atnull | Date
The date the fulfillment was packed.
shipped_atnull | Date
The date the fulfillment was shipped.
delivered_atnull | Date
The date the fulfillment was delivered.
canceled_atnull | Date
The date the fulfillment was canceled.
datanull | Record<string, unknown>
The data necessary for the fulfillment provider to process the fulfillment.
provider_idstring
The associated fulfillment provider's ID.
shipping_option_idnull | string
The associated shipping option's ID.
metadatanull | Record<string, unknown>
Holds custom data in key-value pairs.
shipping_optionnull | ShippingOptionDTO
The associated shipping option.
requires_shippingboolean
Flag to indidcate whether shipping is required
The associated fulfillment provider.
delivery_addressFulfillmentAddressDTO
The associated fulfillment address used for delivery.
The items of the fulfillment.
The labels of the fulfillment.
created_atDate
The creation date of the fulfillment.
updated_atDate
The update date of the fulfillment.
deleted_atnull | Date
The deletion date of the fulfillment.
marked_shipped_bynull | stringOptional
The id of the user that marked fulfillment as shipped
created_bynull | stringOptional
The id of the user that created the fulfillment
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