This documentation provides a reference to the updateDraftOrderWorkflow
. It belongs to the @medusajs/medusa/core-flows
package.
This workflow updates a draft order's details. It's used by the Update Draft Order Admin API Route.
This workflow doesn't update the draft order's items, shipping methods, or promotions. Instead, you have to create a draft order edit using beginDraftOrderEditWorkflow and make updates in the draft order edit. Then, you can confirm the draft order edit using confirmDraftOrderEditWorkflow or request a draft order edit using requestDraftOrderEditWorkflow.
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around updating a draft order.
Source CodeWorkflow hook
Step conditioned by when
View step details
UpdateDraftOrderWorkflowInput
UpdateDraftOrderWorkflowInputid
stringuser_id
stringcustomer_id
stringOptionalemail
stringOptionalsales_channel_id
stringOptionalmetadata
null | Record<string, unknown>OptionalOrderPreviewDTO
OrderPreviewDTOid
stringversion
numberdisplay_id
numberstatus
OrderStatuscurrency_code
stringcreated_at
string | Dateupdated_at
string | Dateoriginal_item_total
BigNumberValueoriginal_item_subtotal
BigNumberValueoriginal_item_tax_total
BigNumberValueitem_total
BigNumberValueitem_subtotal
BigNumberValueitem_tax_total
BigNumberValueoriginal_total
BigNumberValueoriginal_subtotal
BigNumberValueoriginal_tax_total
BigNumberValuetotal
BigNumberValuesubtotal
BigNumberValuetax_total
BigNumberValuediscount_subtotal
BigNumberValuediscount_total
BigNumberValuediscount_tax_total
BigNumberValuegift_card_total
BigNumberValuegift_card_tax_total
BigNumberValueshipping_total
BigNumberValueshipping_subtotal
BigNumberValueshipping_tax_total
BigNumberValueoriginal_shipping_total
BigNumberValueoriginal_shipping_subtotal
BigNumberValueoriginal_shipping_tax_total
BigNumberValueraw_original_item_total
BigNumberRawValueraw_original_item_subtotal
BigNumberRawValueraw_original_item_tax_total
BigNumberRawValueraw_item_total
BigNumberRawValueraw_item_subtotal
BigNumberRawValueraw_item_tax_total
BigNumberRawValueraw_original_total
BigNumberRawValueraw_original_subtotal
BigNumberRawValueraw_original_tax_total
BigNumberRawValueraw_total
BigNumberRawValueraw_subtotal
BigNumberRawValueraw_tax_total
BigNumberRawValueraw_discount_total
BigNumberRawValueraw_discount_tax_total
BigNumberRawValueraw_gift_card_total
BigNumberRawValueraw_gift_card_tax_total
BigNumberRawValueraw_shipping_total
BigNumberRawValueraw_shipping_subtotal
BigNumberRawValueraw_shipping_tax_total
BigNumberRawValueraw_original_shipping_total
BigNumberRawValueraw_original_shipping_subtotal
BigNumberRawValueraw_original_shipping_tax_total
BigNumberRawValueorder_change
OrderChangeDTOitems
OrderLineItemDTO & object[]shipping_methods
OrderShippingMethodDTO & object[]return_requested_total
numberregion_id
stringOptionalcustomer_id
stringOptionalsales_channel_id
stringOptionalemail
stringOptionalis_draft_order
booleanOptionalmetadata
null | Record<string, unknown>Optionalcanceled_at
string | DateOptionalThis section lists the events that are either triggered by the emitEventStep
in the workflow, or by another workflow executed within this workflow.
You can listen to these events in a subscriber, as explained in the Subscribers documentation.
Event | Description | Payload | Action |
---|---|---|---|
| Emitted when the details of an order or draft order is updated. This doesn't include updates made by an edit. |
|