createShipmentWorkflow - Medusa Core Workflows Reference

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

This workflow creates shipments for a fulfillment. It's used by the Create Shipment Admin API Route.

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

Source Code

Examples#

Steps#

Workflow Hook

Step conditioned by when

Input#

CreateShipmentWorkflowInputCreateShipmentWorkflowInput
idstring
The ID of the fulfillment
The labels associated with the fulfillment.
marked_shipped_bynull | stringOptional
The id of the user that marked fulfillment as shipped

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