createFulfillmentWorkflow - Medusa Core Workflows Reference

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

This workflow creates a fulfillment, which can be used for an order, return, exchanges, and similar concepts. The workflow is used by the Create Fulfillment Admin API Route.

You can use this workflow within your own customizations or custom workflows, allowing you to create a fulfillment within your custom flows.

NoteYou can retrieve an order's details using Query, or useQueryGraphStep.
Source Code

Examples#

Steps#

Workflow Hook

Step conditioned by when

Input#

CreateFulfillmentWorkflowInputCreateFulfillmentWorkflowInput
location_idstring
The associated location's ID.
provider_idstring
The associated fulfillment provider's ID.
The address associated with the fulfillment. It's used for delivery.
The items associated with the fulfillment.
packed_atDate | nullOptional
The date the fulfillment was packed.
shipped_atDate | nullOptional
The date the fulfillment was shipped.
created_bystring | nullOptional
The id of the user that creates the fulfillment
delivered_atDate | nullOptional
The date the fulfillment was delivered.
canceled_atDate | nullOptional
The date the fulfillment was canceled.
dataRecord<string, unknown> | nullOptional
The data necessary for the associated fulfillment provider to process the fulfillment.
shipping_option_idstring | nullOptional
The associated shipping option's ID.
metadataRecord<string, unknown> | nullOptional
Holds custom data in key-value pairs.
The labels associated with the fulfillment.
The associated fulfillment 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