- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
cancelOrderFulfillmentWorkflow - Medusa Core Workflows Reference
This documentation provides a reference to the cancelOrderFulfillmentWorkflow
. It belongs to the @medusajs/medusa/core-flows
package.
This workflow cancels an order's fulfillment. It's used by the Cancel Order's Fulfillment Admin API Route.
This workflow has a hook that allows you to perform custom actions on the canceled fulfillment. For example, you can pass under additional_data
custom data that
allows you to update custom data models linked to the fulfillment.
You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around canceling a fulfillment.
Source CodeExamples#
Steps#
Workflow Hook
Step conditioned by when
Input#
CancelOrderFulfillmentWorkflowInput
CancelOrderFulfillmentWorkflowInputThe data to cancel an order's fulfillment, along with custom data that's passed to the workflow's hooks.
CancelOrderFulfillmentWorkflowInput
CancelOrderFulfillmentWorkflowInputorder_id
stringThe ID of the order to cancel its fulfillment.
order_id
stringfulfillment_id
stringThe ID of the fulfillment to cancel.
fulfillment_id
stringno_notification
booleanOptionalWhether to notify the customer about the cancellation.
no_notification
booleanOptionalcanceled_by
stringOptionalThe ID of the user that canceled the fulfillment.
canceled_by
stringOptionaladditional_data
Record<string, unknown>OptionalAdditional data that can be passed through the additional_data
property in HTTP requests.
Learn more in this documentation.
additional_data
Record<string, unknown>Optionaladditional_data
property in HTTP requests.
Learn more in this documentation.Hooks#
Hooks allow you to inject custom functionalities into the workflow. You'll receive data from the workflow, as well as additional data sent through an HTTP request.
Learn more about Hooks and Additional Data.
orderFulfillmentCanceled#
This hook is executed after the fulfillment is canceled. You can consume this hook to perform custom actions on the canceled fulfillment.
Example
Input
Handlers consuming this hook accept the following input.
input
objectThe input data for the hook.
input
objectfulfillment
FulfillmentDTOThe fulfillment details.
fulfillment
FulfillmentDTOadditional_data
Record<string, unknown> | undefinedAdditional data that can be passed through the additional\_data
property in HTTP requests.
Learn more in this documentation.
additional_data
Record<string, unknown> | undefinedadditional\_data
property in HTTP requests.
Learn more in this documentation.