docs: regenerate core-flows reference + OAS for draft order updates (#12280)

* docs: regenerate core-flows reference for updates in draft orders

* generate OAS
This commit is contained in:
Shahed Nasser authored and GitHub committed 2025-04-24 12:01:46 +03:00
1 parent 71a5dc448d
commit 4946b67152
67 files changed
+184591 -175292

No files matched your search

@@ -14129,7 +14129,7 @@ paths:
post:
operationId: PostDraftOrders
summary: Create Draft Order
description: Create a draft order. This creates an order with the `is_draft_order` property enabled.
description: Create a draft order. This creates an order with the `is_draft_order` property enabled. You can later convert the draft order to an order.
x-authenticated: true
parameters:
- name: fields
@@ -14588,7 +14588,7 @@ paths:
post:
operationId: PostDraftOrdersId
summary: Update a Draft Order
description: Update a draft order's details.
description: Update a draft order's details. This doesn't include updating the draft order's items, shipping methods, or promotions. To update those, you need to create an edit that you can later request or confirm.
x-authenticated: true
parameters:
- name: id
@@ -14743,7 +14743,7 @@ paths:
operationId: PostDraftOrdersIdEdit
summary: Create a Draft Order Edit
x-sidebar-summary: Create Edit
description: Create an edit on a draft order. This will allow you to make changes to the draft order's items, shipping methods, or promotions before confirming them later.
description: Create an edit on a draft order. This will allow you to make changes to the draft order's items, shipping methods, or promotions. Once you've made the necessar changes, you can later either request the edit (which requires a confirmation from the customer), or force-confirm the edit.
x-authenticated: true
parameters:
- name: id
@@ -14917,9 +14917,9 @@ paths:
/admin/draft-orders/{id}/edit/items:
post:
operationId: PostDraftOrdersIdEditItems
summary: Add Item to Draft Order
summary: Add Item to Draft Order Edit
x-sidebar-summary: Add Item
description: Add an Item to a draft order.
description: Add an item to a draft order edit.
x-authenticated: true
parameters:
- name: id
@@ -14988,9 +14988,9 @@ paths:
/admin/draft-orders/{id}/edit/items/item/{item_id}:
post:
operationId: PostDraftOrdersIdEditItemsItemItem_id
summary: Update Item in Draft Order
summary: Update Existing Item in Draft Order Edit
x-sidebar-summary: Update Item
description: Update an item in a draft order.
description: Update an existing item in a draft order edit.
x-authenticated: true
parameters:
- name: id
@@ -15064,10 +15064,10 @@ paths:
/admin/draft-orders/{id}/edit/items/{action_id}:
post:
operationId: PostDraftOrdersIdEditItemsAction_id
summary: Update Item Changes in Draft Order
x-sidebar-summary: Update Item Changes
summary: Update New Item in Draft Order Edit
x-sidebar-summary: Update New Item
description: |
Update changes made on an item (addition or update) in the draft order by the ID of the item's `ITEM_ADD` or `ITEM_UPDATE` action.
Update a new item that was added to a draft order edit by the ID of the item's `ITEM_ADD` action.
Every item has an `actions` property, whose value is an array of actions. You can check the action's name using its `action` property, and use the value of the `id` property.
x-authenticated: true
@@ -15080,7 +15080,7 @@ paths:
type: string
- name: action_id
in: path
description: The ID of the item's `ITEM_ADD` or `ITEM_UPDATE` action.
description: The ID of the item's `ITEM_ADD` action.
required: true
schema:
type: string
@@ -15142,10 +15142,10 @@ paths:
x-workflow: updateDraftOrderActionItemWorkflow
delete:
operationId: DeleteDraftOrdersIdEditItemsAction_id
summary: Remove Item from Draft Order
summary: Remove Item from Draft Order Edit
x-sidebar-summary: Remove Item
description: |
Remove an order item from a draft order by the ID of the item's `ITEM_REMOVE` action.
Remove an order item from a draft order edit by the ID of the item's `ITEM_ADD` or `ITEM_UPDATE` action.
Every item has an `actions` property, whose value is an array of actions. You can check the action's name using its `action` property, and use the value of the `id` property.
x-authenticated: true
@@ -15158,7 +15158,7 @@ paths:
type: string
- name: action_id
in: path
description: The ID of the order item's `ITEM_REMOVE` action.
description: The ID of the order item's `ITEM_ADD` or `ITEM_UPDATE` action.
required: true
schema:
type: string
@@ -15210,9 +15210,9 @@ paths:
/admin/draft-orders/{id}/edit/promotions:
post:
operationId: PostDraftOrdersIdEditPromotions
summary: Add Promotions to Draft Order
summary: Add Promotions to Draft Order Edit
x-sidebar-summary: Add Promotions
description: Add promotions to a draft order.
description: Add promotions to a draft order edit.
x-authenticated: true
parameters:
- name: id
@@ -15285,9 +15285,9 @@ paths:
x-workflow: addDraftOrderPromotionWorkflow
delete:
operationId: DeleteDraftOrdersIdEditPromotions
summary: Remove Promotions from Draft Order
summary: Remove Promotions from Draft Order Edit
x-sidebar-summary: Remove Promotions
description: Remove specified promotions from a draft order.
description: Remove specified promotions from a draft order edit.
x-authenticated: true
parameters:
- name: id
@@ -15411,9 +15411,9 @@ paths:
/admin/draft-orders/{id}/edit/shipping-methods:
post:
operationId: PostDraftOrdersIdEditShippingMethods
summary: Add Shipping Method to Draft Order
summary: Add Shipping Method to Draft Order Edit
x-sidebar-summary: Add Shipping Method
description: Add a shipping method to a draft order.
description: Add a shipping method to a draft order edit.
x-authenticated: true
parameters:
- name: id
@@ -15481,9 +15481,9 @@ paths:
/admin/draft-orders/{id}/edit/shipping-methods/method/{method_id}:
post:
operationId: PostDraftOrdersIdEditShippingMethodsMethodMethod_id
summary: Update Shipping Method in Draft Order
summary: Update Existing Shipping Method in Draft Order Edit
x-sidebar-summary: Update Shipping Method
description: Update a shipping method in a draft order
description: Update an existing shipping method in a draft order edit.
x-authenticated: true
parameters:
- name: id
@@ -15552,9 +15552,9 @@ paths:
x-workflow: updateDraftOrderShippingMethodWorkflow
delete:
operationId: DeleteDraftOrdersIdEditShippingMethodsMethodMethod_id
summary: Remove Shipping Method from Draft Order
summary: Remove Shipping Method from Draft Order Edit
x-sidebar-summary: Remove Shipping Method
description: Remove the shipping method in a draft order that is being edited.
description: Remove an existing shipping method from a draft order edit.
x-authenticated: true
parameters:
- name: id
@@ -15620,10 +15620,10 @@ paths:
/admin/draft-orders/{id}/edit/shipping-methods/{action_id}:
post:
operationId: PostDraftOrdersIdEditShippingMethodsAction_id
summary: Update Shipping Method Changes in Draft Order
x-sidebar-summary: Update Shipping Method Changes
summary: Update New Shipping Method in Draft Order Edit
x-sidebar-summary: Update New Shipping Method
description: |
Update changes made on a shipping method (addition or update) in a draft order using the `ID` of the method's `SHIPPING_ADD` or `SHIPPING_UPDATE` action.
Update a new shipping method that was added to a draft order edit using the `ID` of the method's `SHIPPING_ADD` action.
Every shipping method has an `actions` property, whose value is an array of actions. You can check the action's name using its `action` property, and use the value of the `id` property.
x-authenticated: true
@@ -15636,7 +15636,7 @@ paths:
type: string
- name: action_id
in: path
description: The ID of the shipping method's `SHIPPING_ADD` or `SHIPPING_UPDATE` action.
description: The ID of the shipping method's `SHIPPING_ADD` action.
required: true
schema:
type: string
@@ -15701,7 +15701,7 @@ paths:
summary: Remove New Shipping Method from Draft Order
x-sidebar-summary: Remove New Shipping Method
description: |
Remove the shipping method in a draft order using the `ID` of the method's `SHIPPING_ADD` action.
Remove a shipping method that was added to a draft order edit using the `ID` of the method's `SHIPPING_ADD` action.
Every shipping method has an `actions` property, whose value is an array of actions. You can check the action's name using its `action` property, and use the value of the `id` property.
x-authenticated: true
@@ -1785,7 +1785,7 @@ post:
summary: Create Draft Order
description: >-
Create a draft order. This creates an order with the `is_draft_order`
property enabled.
property enabled. You can later convert the draft order to an order.
x-authenticated: true
parameters:
- name: fields
@@ -70,7 +70,10 @@ get:
post:
operationId: PostDraftOrdersId
summary: Update a Draft Order
description: Update a draft order's details.
description: >-
Update a draft order's details. This doesn't include updating the draft
order's items, shipping methods, or promotions. To update those, you need to
create an edit that you can later request or confirm.
x-authenticated: true
parameters:
- name: id
@@ -4,8 +4,9 @@ post:
x-sidebar-summary: Create Edit
description: >-
Create an edit on a draft order. This will allow you to make changes to the
draft order's items, shipping methods, or promotions before confirming them
later.
draft order's items, shipping methods, or promotions. Once you've made the
necessar changes, you can later either request the edit (which requires a
confirmation from the customer), or force-confirm the edit.
x-authenticated: true
parameters:
- name: id
@@ -1,8 +1,8 @@
post:
operationId: PostDraftOrdersIdEditItems
summary: Add Item to Draft Order
summary: Add Item to Draft Order Edit
x-sidebar-summary: Add Item
description: Add an Item to a draft order.
description: Add an item to a draft order edit.
x-authenticated: true
parameters:
- name: id
@@ -1,8 +1,8 @@
post:
operationId: PostDraftOrdersIdEditItemsItemItem_id
summary: Update Item in Draft Order
summary: Update Existing Item in Draft Order Edit
x-sidebar-summary: Update Item
description: Update an item in a draft order.
description: Update an existing item in a draft order edit.
x-authenticated: true
parameters:
- name: id
@@ -1,10 +1,10 @@
post:
operationId: PostDraftOrdersIdEditItemsAction_id
summary: Update Item Changes in Draft Order
x-sidebar-summary: Update Item Changes
summary: Update New Item in Draft Order Edit
x-sidebar-summary: Update New Item
description: >
Update changes made on an item (addition or update) in the draft order by
the ID of the item's `ITEM_ADD` or `ITEM_UPDATE` action.
Update a new item that was added to a draft order edit by the ID of the
item's `ITEM_ADD` action.
Every item has an `actions` property, whose value is an array of actions.
@@ -20,7 +20,7 @@ post:
type: string
- name: action_id
in: path
description: The ID of the item's `ITEM_ADD` or `ITEM_UPDATE` action.
description: The ID of the item's `ITEM_ADD` action.
required: true
schema:
type: string
@@ -64,11 +64,11 @@ post:
x-workflow: updateDraftOrderActionItemWorkflow
delete:
operationId: DeleteDraftOrdersIdEditItemsAction_id
summary: Remove Item from Draft Order
summary: Remove Item from Draft Order Edit
x-sidebar-summary: Remove Item
description: >
Remove an order item from a draft order by the ID of the item's
`ITEM_REMOVE` action.
Remove an order item from a draft order edit by the ID of the item's
`ITEM_ADD` or `ITEM_UPDATE` action.
Every item has an `actions` property, whose value is an array of actions.
@@ -84,7 +84,7 @@ delete:
type: string
- name: action_id
in: path
description: The ID of the order item's `ITEM_REMOVE` action.
description: The ID of the order item's `ITEM_ADD` or `ITEM_UPDATE` action.
required: true
schema:
type: string
@@ -1,8 +1,8 @@
post:
operationId: PostDraftOrdersIdEditPromotions
summary: Add Promotions to Draft Order
summary: Add Promotions to Draft Order Edit
x-sidebar-summary: Add Promotions
description: Add promotions to a draft order.
description: Add promotions to a draft order edit.
x-authenticated: true
parameters:
- name: id
@@ -54,9 +54,9 @@ post:
x-workflow: addDraftOrderPromotionWorkflow
delete:
operationId: DeleteDraftOrdersIdEditPromotions
summary: Remove Promotions from Draft Order
summary: Remove Promotions from Draft Order Edit
x-sidebar-summary: Remove Promotions
description: Remove specified promotions from a draft order.
description: Remove specified promotions from a draft order edit.
x-authenticated: true
parameters:
- name: id
@@ -1,8 +1,8 @@
post:
operationId: PostDraftOrdersIdEditShippingMethods
summary: Add Shipping Method to Draft Order
summary: Add Shipping Method to Draft Order Edit
x-sidebar-summary: Add Shipping Method
description: Add a shipping method to a draft order.
description: Add a shipping method to a draft order edit.
x-authenticated: true
parameters:
- name: id
@@ -1,8 +1,8 @@
post:
operationId: PostDraftOrdersIdEditShippingMethodsMethodMethod_id
summary: Update Shipping Method in Draft Order
summary: Update Existing Shipping Method in Draft Order Edit
x-sidebar-summary: Update Shipping Method
description: Update a shipping method in a draft order
description: Update an existing shipping method in a draft order edit.
x-authenticated: true
parameters:
- name: id
@@ -57,9 +57,9 @@ post:
x-workflow: updateDraftOrderShippingMethodWorkflow
delete:
operationId: DeleteDraftOrdersIdEditShippingMethodsMethodMethod_id
summary: Remove Shipping Method from Draft Order
summary: Remove Shipping Method from Draft Order Edit
x-sidebar-summary: Remove Shipping Method
description: Remove the shipping method in a draft order that is being edited.
description: Remove an existing shipping method from a draft order edit.
x-authenticated: true
parameters:
- name: id
@@ -1,11 +1,10 @@
post:
operationId: PostDraftOrdersIdEditShippingMethodsAction_id
summary: Update Shipping Method Changes in Draft Order
x-sidebar-summary: Update Shipping Method Changes
summary: Update New Shipping Method in Draft Order Edit
x-sidebar-summary: Update New Shipping Method
description: >
Update changes made on a shipping method (addition or update) in a draft
order using the `ID` of the method's `SHIPPING_ADD` or `SHIPPING_UPDATE`
action.
Update a new shipping method that was added to a draft order edit using the
`ID` of the method's `SHIPPING_ADD` action.
Every shipping method has an `actions` property, whose value is an array of
@@ -21,9 +20,7 @@ post:
type: string
- name: action_id
in: path
description: >-
The ID of the shipping method's `SHIPPING_ADD` or `SHIPPING_UPDATE`
action.
description: The ID of the shipping method's `SHIPPING_ADD` action.
required: true
schema:
type: string
@@ -70,8 +67,8 @@ delete:
summary: Remove New Shipping Method from Draft Order
x-sidebar-summary: Remove New Shipping Method
description: >
Remove the shipping method in a draft order using the `ID` of the method's
`SHIPPING_ADD` action.
Remove a shipping method that was added to a draft order edit using the `ID`
of the method's `SHIPPING_ADD` action.
Every shipping method has an `actions` property, whose value is an array of
File diff suppressed because it is too large. Load diff
+33 -23
View File
@@ -6155,24 +6155,24 @@ export const generatedEditDates = {
"references/types/FileTypes/interfaces/types.FileTypes.UploadFileUrlDTO/page.mdx": "2025-04-23T07:49:49.091Z",
"references/types/FileTypes/types/types.FileTypes.FileAccessPermission/page.mdx": "2025-04-23T07:49:49.087Z",
"references/workflows/types/workflows.Void/page.mdx": "2025-04-23T07:49:56.553Z",
"references/core_flows/Draft_Order/Steps_Draft_Order/functions/core_flows.Draft_Order.Steps_Draft_Order.validateDraftOrderStep/page.mdx": "2025-04-23T16:21:18.490Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.addDraftOrderItemsWorkflow/page.mdx": "2025-04-23T16:21:18.507Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.addDraftOrderPromotionWorkflow/page.mdx": "2025-04-23T16:21:18.524Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.addDraftOrderShippingMethodsWorkflow/page.mdx": "2025-04-23T16:21:18.540Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.beginDraftOrderEditWorkflow/page.mdx": "2025-04-23T16:21:18.556Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.cancelDraftOrderEditWorkflow/page.mdx": "2025-04-23T16:21:18.558Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.confirmDraftOrderEditWorkflow/page.mdx": "2025-04-23T16:21:18.577Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.convertDraftOrderWorkflow/page.mdx": "2025-04-23T16:21:18.591Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.removeDraftOrderActionItemWorkflow/page.mdx": "2025-04-23T16:21:18.608Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.removeDraftOrderActionShippingMethodWorkflow/page.mdx": "2025-04-23T16:21:18.624Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.removeDraftOrderPromotionsWorkflow/page.mdx": "2025-04-23T16:21:18.639Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.removeDraftOrderShippingMethodWorkflow/page.mdx": "2025-04-23T16:21:18.670Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.requestDraftOrderEditWorkflow/page.mdx": "2025-04-23T16:21:18.655Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderActionItemWorkflow/page.mdx": "2025-04-23T16:21:18.687Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderActionShippingMethodWorkflow/page.mdx": "2025-04-23T16:21:18.703Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderItemWorkflow/page.mdx": "2025-04-23T16:21:18.719Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderShippingMethodWorkflow/page.mdx": "2025-04-23T16:21:18.750Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderWorkflow/page.mdx": "2025-04-23T16:21:18.735Z",
"references/core_flows/Draft_Order/Steps_Draft_Order/functions/core_flows.Draft_Order.Steps_Draft_Order.validateDraftOrderStep/page.mdx": "2025-04-24T08:23:52.495Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.addDraftOrderItemsWorkflow/page.mdx": "2025-04-24T08:23:52.526Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.addDraftOrderPromotionWorkflow/page.mdx": "2025-04-24T08:23:52.561Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.addDraftOrderShippingMethodsWorkflow/page.mdx": "2025-04-24T08:23:52.591Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.beginDraftOrderEditWorkflow/page.mdx": "2025-04-24T08:23:52.627Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.cancelDraftOrderEditWorkflow/page.mdx": "2025-04-24T08:23:52.634Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.confirmDraftOrderEditWorkflow/page.mdx": "2025-04-24T08:23:52.659Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.convertDraftOrderWorkflow/page.mdx": "2025-04-24T08:23:52.701Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.removeDraftOrderActionItemWorkflow/page.mdx": "2025-04-24T08:23:52.732Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.removeDraftOrderActionShippingMethodWorkflow/page.mdx": "2025-04-24T08:23:52.762Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.removeDraftOrderPromotionsWorkflow/page.mdx": "2025-04-24T08:23:52.790Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.removeDraftOrderShippingMethodWorkflow/page.mdx": "2025-04-24T08:23:52.983Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.requestDraftOrderEditWorkflow/page.mdx": "2025-04-24T08:23:52.816Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderActionItemWorkflow/page.mdx": "2025-04-24T08:23:52.842Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderActionShippingMethodWorkflow/page.mdx": "2025-04-24T08:23:52.871Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderItemWorkflow/page.mdx": "2025-04-24T08:23:52.895Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderShippingMethodWorkflow/page.mdx": "2025-04-24T08:23:52.958Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderWorkflow/page.mdx": "2025-04-24T08:23:53.010Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/variables/core_flows.Draft_Order.Workflows_Draft_Order.addDraftOrderItemsWorkflowId/page.mdx": "2025-04-23T16:21:18.492Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/variables/core_flows.Draft_Order.Workflows_Draft_Order.addDraftOrderPromotionWorkflowId/page.mdx": "2025-04-23T16:21:18.508Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/variables/core_flows.Draft_Order.Workflows_Draft_Order.addDraftOrderShippingMethodsWorkflowId/page.mdx": "2025-04-23T16:21:18.524Z",
@@ -6190,7 +6190,7 @@ export const generatedEditDates = {
"references/core_flows/Draft_Order/Workflows_Draft_Order/variables/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderItemWorkflowId/page.mdx": "2025-04-23T16:21:18.703Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/variables/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderWorkflowId/page.mdx": "2025-04-23T16:21:18.656Z",
"references/core_flows/Draft_Order/core_flows.Draft_Order.Steps_Draft_Order/page.mdx": "2025-04-23T16:21:18.489Z",
"references/core_flows/Draft_Order/core_flows.Draft_Order.Workflows_Draft_Order/page.mdx": "2025-04-23T16:21:18.491Z",
"references/core_flows/Draft_Order/core_flows.Draft_Order.Workflows_Draft_Order/page.mdx": "2025-04-24T08:23:52.496Z",
"references/core_flows/Order/Steps_Order/functions/core_flows.Order.Steps_Order.registerOrderDeliveryStep/page.mdx": "2025-04-23T16:21:19.273Z",
"references/core_flows/Order/Steps_Order/variables/core_flows.Order.Steps_Order.registerOrderDeliveryStepId/page.mdx": "2025-04-23T16:21:19.272Z",
"references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderCreditLinesWorkflow/page.mdx": "2025-04-23T16:21:19.790Z",
@@ -6199,12 +6199,22 @@ export const generatedEditDates = {
"references/core_flows/Order/functions/core_flows.Order.fetchShippingOptionForOrderWorkflow/page.mdx": "2025-04-23T16:21:20.928Z",
"references/core_flows/Order/variables/core_flows.Order.fetchShippingOptionsForOrderWorkflowId/page.mdx": "2025-04-23T16:21:20.924Z",
"references/core_flows/core_flows.Draft_Order/page.mdx": "2025-04-23T16:21:18.488Z",
"references/core_flows/interfaces/core_flows.CancelDraftOrderEditWorkflowInput/page.mdx": "2025-04-23T16:21:21.715Z",
"references/core_flows/interfaces/core_flows.CancelDraftOrderEditWorkflowInput/page.mdx": "2025-04-24T08:23:57.279Z",
"references/core_flows/interfaces/core_flows.ConfirmDraftOrderEditWorkflowInput/page.mdx": "2025-04-23T16:21:21.716Z",
"references/core_flows/interfaces/core_flows.UpdateDraftOrderShippingMethodWorkflowInput/page.mdx": "2025-04-23T16:21:21.717Z",
"references/core_flows/interfaces/core_flows.UpdateDraftOrderWorkflowInput/page.mdx": "2025-04-23T16:21:21.719Z",
"references/core_flows/interfaces/core_flows.UpdateDraftOrderShippingMethodWorkflowInput/page.mdx": "2025-04-24T08:23:57.285Z",
"references/core_flows/interfaces/core_flows.UpdateDraftOrderWorkflowInput/page.mdx": "2025-04-24T08:23:57.288Z",
"references/core_flows/types/core_flows.FetchShippingOptionForOrderWorkflowInput/page.mdx": "2025-04-23T16:21:21.815Z",
"references/core_flows/types/core_flows.FetchShippingOptionForOrderWorkflowOutput/page.mdx": "2025-04-23T16:21:21.821Z",
"references/core_flows/types/core_flows.RequestDraftOrderEditWorkflowInput/page.mdx": "2025-04-23T16:21:21.717Z",
"references/core_flows/types/core_flows.GenerateProductCsvStepOutput/page.mdx": "2025-04-23T16:21:22.403Z"
"references/core_flows/types/core_flows.GenerateProductCsvStepOutput/page.mdx": "2025-04-23T16:21:22.403Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.convertDraftOrderStep/page.mdx": "2025-04-24T08:23:52.683Z",
"references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderStep/page.mdx": "2025-04-24T08:23:52.930Z",
"references/core_flows/interfaces/core_flows.AddDraftOrderPromotionWorkflowInput/page.mdx": "2025-04-24T08:23:57.277Z",
"references/core_flows/interfaces/core_flows.AddDraftOrderShippingMethodsWorkflowInput/page.mdx": "2025-04-24T08:23:57.278Z",
"references/core_flows/interfaces/core_flows.ConvertDraftOrderStepInput/page.mdx": "2025-04-24T08:23:57.281Z",
"references/core_flows/interfaces/core_flows.ConvertDraftOrderWorkflowInput/page.mdx": "2025-04-24T08:23:57.280Z",
"references/core_flows/interfaces/core_flows.RemoveDraftOrderPromotionsWorkflowInput/page.mdx": "2025-04-24T08:23:57.282Z",
"references/core_flows/interfaces/core_flows.RemoveDraftOrderShippingMethodWorkflowInput/page.mdx": "2025-04-24T08:23:57.283Z",
"references/core_flows/interfaces/core_flows.UpdateDraftOrderStepInput/page.mdx": "2025-04-24T08:23:57.295Z",
"references/core_flows/interfaces/core_flows.ValidateDraftOrderStepInput/page.mdx": "2025-04-24T08:23:57.277Z"
}
@@ -3359,6 +3359,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.confirmDraftOrderEditWorkflow/page.mdx",
"pathname": "/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.confirmDraftOrderEditWorkflow"
},
{
"filePath": "/www/apps/resources/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.convertDraftOrderStep/page.mdx",
"pathname": "/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.convertDraftOrderStep"
},
{
"filePath": "/www/apps/resources/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.convertDraftOrderWorkflow/page.mdx",
"pathname": "/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.convertDraftOrderWorkflow"
@@ -3399,6 +3403,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderShippingMethodWorkflow/page.mdx",
"pathname": "/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderShippingMethodWorkflow"
},
{
"filePath": "/www/apps/resources/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderStep/page.mdx",
"pathname": "/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderStep"
},
{
"filePath": "/www/apps/resources/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderWorkflow/page.mdx",
"pathname": "/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderWorkflow"
@@ -7371,6 +7379,14 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/core_flows/core_flows.User/page.mdx",
"pathname": "/references/core_flows/core_flows.User"
},
{
"filePath": "/www/apps/resources/references/core_flows/interfaces/core_flows.AddDraftOrderPromotionWorkflowInput/page.mdx",
"pathname": "/references/core_flows/interfaces/core_flows.AddDraftOrderPromotionWorkflowInput"
},
{
"filePath": "/www/apps/resources/references/core_flows/interfaces/core_flows.AddDraftOrderShippingMethodsWorkflowInput/page.mdx",
"pathname": "/references/core_flows/interfaces/core_flows.AddDraftOrderShippingMethodsWorkflowInput"
},
{
"filePath": "/www/apps/resources/references/core_flows/interfaces/core_flows.AddShippingMethodToCartStepInput/page.mdx",
"pathname": "/references/core_flows/interfaces/core_flows.AddShippingMethodToCartStepInput"
@@ -7443,6 +7459,14 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/core_flows/interfaces/core_flows.ConfirmVariantInventoryWorkflowOutput/page.mdx",
"pathname": "/references/core_flows/interfaces/core_flows.ConfirmVariantInventoryWorkflowOutput"
},
{
"filePath": "/www/apps/resources/references/core_flows/interfaces/core_flows.ConvertDraftOrderStepInput/page.mdx",
"pathname": "/references/core_flows/interfaces/core_flows.ConvertDraftOrderStepInput"
},
{
"filePath": "/www/apps/resources/references/core_flows/interfaces/core_flows.ConvertDraftOrderWorkflowInput/page.mdx",
"pathname": "/references/core_flows/interfaces/core_flows.ConvertDraftOrderWorkflowInput"
},
{
"filePath": "/www/apps/resources/references/core_flows/interfaces/core_flows.CreateDefaultSalesChannelStepInput/page.mdx",
"pathname": "/references/core_flows/interfaces/core_flows.CreateDefaultSalesChannelStepInput"
@@ -7595,6 +7619,14 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/core_flows/interfaces/core_flows.RemoteStepInput/page.mdx",
"pathname": "/references/core_flows/interfaces/core_flows.RemoteStepInput"
},
{
"filePath": "/www/apps/resources/references/core_flows/interfaces/core_flows.RemoveDraftOrderPromotionsWorkflowInput/page.mdx",
"pathname": "/references/core_flows/interfaces/core_flows.RemoveDraftOrderPromotionsWorkflowInput"
},
{
"filePath": "/www/apps/resources/references/core_flows/interfaces/core_flows.RemoveDraftOrderShippingMethodWorkflowInput/page.mdx",
"pathname": "/references/core_flows/interfaces/core_flows.RemoveDraftOrderShippingMethodWorkflowInput"
},
{
"filePath": "/www/apps/resources/references/core_flows/interfaces/core_flows.RemoveLineItemAdjustmentsStepInput/page.mdx",
"pathname": "/references/core_flows/interfaces/core_flows.RemoveLineItemAdjustmentsStepInput"
@@ -7643,6 +7675,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/core_flows/interfaces/core_flows.UpdateDraftOrderShippingMethodWorkflowInput/page.mdx",
"pathname": "/references/core_flows/interfaces/core_flows.UpdateDraftOrderShippingMethodWorkflowInput"
},
{
"filePath": "/www/apps/resources/references/core_flows/interfaces/core_flows.UpdateDraftOrderStepInput/page.mdx",
"pathname": "/references/core_flows/interfaces/core_flows.UpdateDraftOrderStepInput"
},
{
"filePath": "/www/apps/resources/references/core_flows/interfaces/core_flows.UpdateDraftOrderWorkflowInput/page.mdx",
"pathname": "/references/core_flows/interfaces/core_flows.UpdateDraftOrderWorkflowInput"
@@ -7683,6 +7719,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/core_flows/interfaces/core_flows.ValidateDeletedPaymentSessionsStepInput/page.mdx",
"pathname": "/references/core_flows/interfaces/core_flows.ValidateDeletedPaymentSessionsStepInput"
},
{
"filePath": "/www/apps/resources/references/core_flows/interfaces/core_flows.ValidateDraftOrderStepInput/page.mdx",
"pathname": "/references/core_flows/interfaces/core_flows.ValidateDraftOrderStepInput"
},
{
"filePath": "/www/apps/resources/references/core_flows/interfaces/core_flows.ValidateInventoryDeleteStepInput/page.mdx",
"pathname": "/references/core_flows/interfaces/core_flows.ValidateInventoryDeleteStepInput"
@@ -7271,6 +7271,14 @@ const generatedgeneratedCommerceModulesSidebarSidebar = {
"path": "https://docs.medusajs.com/resources/references/medusa-workflows/steps/setOrderTaxLinesForItemsStep",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "ref",
"title": "updateDraftOrderStep",
"path": "https://docs.medusajs.com/resources/references/medusa-workflows/updateDraftOrderStep",
"children": []
},
{
"loaded": true,
"isPathHref": true,
@@ -1200,7 +1200,7 @@ const generatedgeneratedReferencesSidebarSidebar = {
"type": "link",
"path": "/references/medusa-workflows/addDraftOrderItemsWorkflow",
"title": "addDraftOrderItemsWorkflow",
"description": "",
"description": "Add items to a draft order.",
"children": []
},
{
@@ -1209,7 +1209,7 @@ const generatedgeneratedReferencesSidebarSidebar = {
"type": "link",
"path": "/references/medusa-workflows/addDraftOrderPromotionWorkflow",
"title": "addDraftOrderPromotionWorkflow",
"description": "",
"description": "Add promotions to a draft order.",
"children": []
},
{
@@ -1218,7 +1218,7 @@ const generatedgeneratedReferencesSidebarSidebar = {
"type": "link",
"path": "/references/medusa-workflows/addDraftOrderShippingMethodsWorkflow",
"title": "addDraftOrderShippingMethodsWorkflow",
"description": "",
"description": "Add shipping methods to a draft order.",
"children": []
},
{
@@ -1227,7 +1227,7 @@ const generatedgeneratedReferencesSidebarSidebar = {
"type": "link",
"path": "/references/medusa-workflows/beginDraftOrderEditWorkflow",
"title": "beginDraftOrderEditWorkflow",
"description": "",
"description": "Create a draft order edit request.",
"children": []
},
{
@@ -1236,7 +1236,7 @@ const generatedgeneratedReferencesSidebarSidebar = {
"type": "link",
"path": "/references/medusa-workflows/cancelDraftOrderEditWorkflow",
"title": "cancelDraftOrderEditWorkflow",
"description": "",
"description": "Cancel a draft order edit.",
"children": []
},
{
@@ -1245,7 +1245,7 @@ const generatedgeneratedReferencesSidebarSidebar = {
"type": "link",
"path": "/references/medusa-workflows/confirmDraftOrderEditWorkflow",
"title": "confirmDraftOrderEditWorkflow",
"description": "",
"description": "Confirm a draft order edit.",
"children": []
},
{
@@ -1254,7 +1254,7 @@ const generatedgeneratedReferencesSidebarSidebar = {
"type": "link",
"path": "/references/medusa-workflows/convertDraftOrderWorkflow",
"title": "convertDraftOrderWorkflow",
"description": "",
"description": "Convert a draft order to a pending order.",
"children": []
},
{
@@ -1263,7 +1263,7 @@ const generatedgeneratedReferencesSidebarSidebar = {
"type": "link",
"path": "/references/medusa-workflows/removeDraftOrderActionItemWorkflow",
"title": "removeDraftOrderActionItemWorkflow",
"description": "",
"description": "Remove an item from a draft order edit.",
"children": []
},
{
@@ -1272,7 +1272,7 @@ const generatedgeneratedReferencesSidebarSidebar = {
"type": "link",
"path": "/references/medusa-workflows/removeDraftOrderActionShippingMethodWorkflow",
"title": "removeDraftOrderActionShippingMethodWorkflow",
"description": "",
"description": "Remove a shipping method from an edited draft order.",
"children": []
},
{
@@ -1281,7 +1281,7 @@ const generatedgeneratedReferencesSidebarSidebar = {
"type": "link",
"path": "/references/medusa-workflows/removeDraftOrderPromotionsWorkflow",
"title": "removeDraftOrderPromotionsWorkflow",
"description": "",
"description": "Remove promotions from a draft order edit.",
"children": []
},
{
@@ -1290,7 +1290,7 @@ const generatedgeneratedReferencesSidebarSidebar = {
"type": "link",
"path": "/references/medusa-workflows/removeDraftOrderShippingMethodWorkflow",
"title": "removeDraftOrderShippingMethodWorkflow",
"description": "",
"description": "Remove an existing shipping method from a draft order edit.",
"children": []
},
{
@@ -1299,7 +1299,7 @@ const generatedgeneratedReferencesSidebarSidebar = {
"type": "link",
"path": "/references/medusa-workflows/requestDraftOrderEditWorkflow",
"title": "requestDraftOrderEditWorkflow",
"description": "",
"description": "Request a draft order edit.",
"children": []
},
{
@@ -1308,7 +1308,7 @@ const generatedgeneratedReferencesSidebarSidebar = {
"type": "link",
"path": "/references/medusa-workflows/updateDraftOrderActionItemWorkflow",
"title": "updateDraftOrderActionItemWorkflow",
"description": "",
"description": "Update a new item in a draft order edit.",
"children": []
},
{
@@ -1317,7 +1317,7 @@ const generatedgeneratedReferencesSidebarSidebar = {
"type": "link",
"path": "/references/medusa-workflows/updateDraftOrderActionShippingMethodWorkflow",
"title": "updateDraftOrderActionShippingMethodWorkflow",
"description": "",
"description": "Update a new shipping method in a draft order edit.",
"children": []
},
{
@@ -1326,7 +1326,7 @@ const generatedgeneratedReferencesSidebarSidebar = {
"type": "link",
"path": "/references/medusa-workflows/updateDraftOrderItemWorkflow",
"title": "updateDraftOrderItemWorkflow",
"description": "",
"description": "Update an item in a draft order edit.",
"children": []
},
{
@@ -1335,7 +1335,7 @@ const generatedgeneratedReferencesSidebarSidebar = {
"type": "link",
"path": "/references/medusa-workflows/updateDraftOrderShippingMethodWorkflow",
"title": "updateDraftOrderShippingMethodWorkflow",
"description": "",
"description": "Update an existing shipping method in a draft order edit.",
"children": []
},
{
@@ -1344,7 +1344,7 @@ const generatedgeneratedReferencesSidebarSidebar = {
"type": "link",
"path": "/references/medusa-workflows/updateDraftOrderWorkflow",
"title": "updateDraftOrderWorkflow",
"description": "",
"description": "Update a draft order's details.",
"children": []
}
]
@@ -1363,6 +1363,24 @@ const generatedgeneratedReferencesSidebarSidebar = {
"title": "validateDraftOrderStep",
"description": "",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/references/medusa-workflows/convertDraftOrderStep",
"title": "convertDraftOrderStep",
"description": "",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/references/medusa-workflows/updateDraftOrderStep",
"title": "updateDraftOrderStep",
"description": "",
"children": []
}
]
}
@@ -1049,6 +1049,11 @@ export const slugChanges = [
"newSlug": "/references/medusa-workflows/confirmDraftOrderEditWorkflow",
"filePath": "/www/apps/resources/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.confirmDraftOrderEditWorkflow/page.mdx"
},
{
"origSlug": "/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.convertDraftOrderStep",
"newSlug": "/references/medusa-workflows/convertDraftOrderStep",
"filePath": "/www/apps/resources/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.convertDraftOrderStep/page.mdx"
},
{
"origSlug": "/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.convertDraftOrderWorkflow",
"newSlug": "/references/medusa-workflows/convertDraftOrderWorkflow",
@@ -1099,6 +1104,11 @@ export const slugChanges = [
"newSlug": "/references/medusa-workflows/updateDraftOrderShippingMethodWorkflow",
"filePath": "/www/apps/resources/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderShippingMethodWorkflow/page.mdx"
},
{
"origSlug": "/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderStep",
"newSlug": "/references/medusa-workflows/updateDraftOrderStep",
"filePath": "/www/apps/resources/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderStep/page.mdx"
},
{
"origSlug": "/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderWorkflow",
"newSlug": "/references/medusa-workflows/updateDraftOrderWorkflow",
@@ -11,19 +11,26 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
This documentation provides a reference to the `validateDraftOrderStep`. It belongs to the `@medusajs/medusa/core-flows` package.
```ts title="src/workflows/my-workflow.ts"
import { createWorkflow } from "@medusajs/framework/workflows-sdk"
import { validateDraftOrderStep } from "@medusajs/medusa/core-flows"
This step validates that an order is a draft order. It throws an error otherwise.
const myWorkflow = createWorkflow(
"my-workflow",
() => {
const data = validateDraftOrderStep("{value}")
:::note
You can retrieve a draft order's details using [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query),
or [useQueryGraphStep](https://docs.medusajs.com/resources/references/medusa-workflows/steps/useQueryGraphStep).
:::
## Example
```ts
const data = validateDraftOrderStep({
order: {
id: "order_123",
// other order details...
}
)
})
```
## Input
<TypeList types={[{"name":"ValidateDraftOrderStepInput","type":"`ValidateDraftOrderStepInput`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="validateDraftOrderStep"/>
<TypeList types={[{"name":"ValidateDraftOrderStepInput","type":"[ValidateDraftOrderStepInput](../../../../interfaces/core_flows.ValidateDraftOrderStepInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the draft order to validate.","expandable":false,"children":[{"name":"order","type":"[OrderDTO](../../../../../fulfillment/interfaces/fulfillment.OrderDTO/page.mdx)","description":"The draft order to validate.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The version of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"The order's display ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[OrderStatus](../../../../../fulfillment/types/fulfillment.OrderStatus/page.mdx)","description":"The status of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_tax_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","Line truncated
@@ -1,7 +1,7 @@
---
slug: /references/medusa-workflows/addDraftOrderItemsWorkflow
sidebar_label: addDraftOrderItemsWorkflow
sidebar_description: ""
sidebar_description: Add items to a draft order.
tags:
- remote query
- order
@@ -20,7 +20,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
This documentation provides a reference to the `addDraftOrderItemsWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/add-draft-order-items.ts#L27" />
This workflow adds items to a draft order. It's used by the
[Add Item to Draft Order Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_postdraftordersidedititems).
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around adding items to
a draft order.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/add-draft-order-items.ts#L50" />
## Examples
@@ -41,9 +47,10 @@ export async function POST(
const { result } = await addDraftOrderItemsWorkflow(req.scope)
.run({
input: {
"order_id": "order_123",
"items": [{
"quantity": 24
order_id: "order_123",
items: [{
variant_id: "variant_123",
quantity: 1
}]
}
})
@@ -69,9 +76,10 @@ export default async function handleOrderPlaced({
const { result } = await addDraftOrderItemsWorkflow(container)
.run({
input: {
"order_id": "order_123",
"items": [{
"quantity": 24
order_id: "order_123",
items: [{
variant_id: "variant_123",
quantity: 1
}]
}
})
@@ -97,9 +105,10 @@ export default async function myCustomJob(
const { result } = await addDraftOrderItemsWorkflow(container)
.run({
input: {
"order_id": "order_123",
"items": [{
"quantity": 24
order_id: "order_123",
items: [{
variant_id: "variant_123",
quantity: 1
}]
}
})
@@ -126,9 +135,10 @@ const myWorkflow = createWorkflow(
const result = addDraftOrderItemsWorkflow
.runAsStep({
input: {
"order_id": "order_123",
"items": [{
"quantity": 24
order_id: "order_123",
items: [{
variant_id: "variant_123",
quantity: 1
}]
}
})
@@ -1,7 +1,7 @@
---
slug: /references/medusa-workflows/addDraftOrderPromotionWorkflow
sidebar_label: addDraftOrderPromotionWorkflow
sidebar_description: ""
sidebar_description: Add promotions to a draft order.
tags:
- remote query
- order
@@ -14,7 +14,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
This documentation provides a reference to the `addDraftOrderPromotionWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/add-draft-order-promotions.ts#L30" />
This workflow adds promotions to a draft order. It's used by the
[Add Promotion to Draft Order Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_postdraftordersideditpromotions).
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around adding promotions to
a draft order.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/add-draft-order-promotions.ts#L59" />
## Examples
@@ -34,7 +40,10 @@ export async function POST(
) {
const { result } = await addDraftOrderPromotionWorkflow(req.scope)
.run({
input: "{value}"
input: {
order_id: "order_123",
promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"]
}
})
res.send(result)
@@ -57,7 +66,10 @@ export default async function handleOrderPlaced({
}: SubscriberArgs < { id: string } > ) {
const { result } = await addDraftOrderPromotionWorkflow(container)
.run({
input: "{value}"
input: {
order_id: "order_123",
promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"]
}
})
console.log(result)
@@ -80,7 +92,10 @@ export default async function myCustomJob(
) {
const { result } = await addDraftOrderPromotionWorkflow(container)
.run({
input: "{value}"
input: {
order_id: "order_123",
promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"]
}
})
console.log(result)
@@ -104,7 +119,10 @@ const myWorkflow = createWorkflow(
() => {
const result = addDraftOrderPromotionWorkflow
.runAsStep({
input: "{value}"
input: {
order_id: "order_123",
promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"]
}
})
}
)
@@ -119,7 +137,7 @@ const myWorkflow = createWorkflow(
## Input
<TypeList types={[{"name":"AddDraftOrderPromotionWorkflowInput","type":"`AddDraftOrderPromotionWorkflowInput`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="addDraftOrderPromotionWorkflow"/>
<TypeList types={[{"name":"AddDraftOrderPromotionWorkflowInput","type":"[AddDraftOrderPromotionWorkflowInput](../../../../interfaces/core_flows.AddDraftOrderPromotionWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the promotions to add to a draft order.","expandable":false,"children":[{"name":"order_id","type":"`string`","description":"The ID of the draft order to add the promotions to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"promo_codes","type":"`string`[]","description":"The codes of the promotions to add to the draft order.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="addDraftOrderPromotionWorkflow"/>
## Output
@@ -1,7 +1,7 @@
---
slug: /references/medusa-workflows/addDraftOrderShippingMethodsWorkflow
sidebar_label: addDraftOrderShippingMethodsWorkflow
sidebar_description: ""
sidebar_description: Add shipping methods to a draft order.
tags:
- remote query
- order
@@ -15,7 +15,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
This documentation provides a reference to the `addDraftOrderShippingMethodsWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/add-draft-order-shipping-methods.ts#L44" />
This workflow adds shipping methods to a draft order. It's used by the
[Add Shipping Method to Draft Order Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_postdraftordersideditshippingmethods).
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around adding shipping methods to
a draft order.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/add-draft-order-shipping-methods.ts#L69" />
## Examples
@@ -35,7 +41,11 @@ export async function POST(
) {
const { result } = await addDraftOrderShippingMethodsWorkflow(req.scope)
.run({
input: "{value}"
input: {
order_id: "order_123",
shipping_option_id: "so_123",
custom_amount: 10
}
})
res.send(result)
@@ -58,7 +68,11 @@ export default async function handleOrderPlaced({
}: SubscriberArgs < { id: string } > ) {
const { result } = await addDraftOrderShippingMethodsWorkflow(container)
.run({
input: "{value}"
input: {
order_id: "order_123",
shipping_option_id: "so_123",
custom_amount: 10
}
})
console.log(result)
@@ -81,7 +95,11 @@ export default async function myCustomJob(
) {
const { result } = await addDraftOrderShippingMethodsWorkflow(container)
.run({
input: "{value}"
input: {
order_id: "order_123",
shipping_option_id: "so_123",
custom_amount: 10
}
})
console.log(result)
@@ -105,7 +123,11 @@ const myWorkflow = createWorkflow(
() => {
const result = addDraftOrderShippingMethodsWorkflow
.runAsStep({
input: "{value}"
input: {
order_id: "order_123",
shipping_option_id: "so_123",
custom_amount: 10
}
})
}
)
@@ -120,7 +142,7 @@ const myWorkflow = createWorkflow(
## Input
<TypeList types={[{"name":"AddDraftOrderShippingMethodsWorkflowInput","type":"`AddDraftOrderShippingMethodsWorkflowInput`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="addDraftOrderShippingMethodsWorkflow"/>
<TypeList types={[{"name":"AddDraftOrderShippingMethodsWorkflowInput","type":"[AddDraftOrderShippingMethodsWorkflowInput](../../../../interfaces/core_flows.AddDraftOrderShippingMethodsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the shipping methods to add to a draft order.","expandable":false,"children":[{"name":"order_id","type":"`string`","description":"The ID of the draft order to add the shipping methods to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_id","type":"`string`","description":"The ID of the shipping option to add as a shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"custom_amount","type":"`null` \\| [BigNumberInput](../../../../../types/types/types.BigNumberInput/page.mdx)","description":"The custom amount to add the shipping method with.\nIf not specified, the shipping option's fixed or calculated price will be used.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="addDraftOrderShippingMethodsWorkflow"/>
## Output
@@ -1,7 +1,7 @@
---
slug: /references/medusa-workflows/beginDraftOrderEditWorkflow
sidebar_label: beginDraftOrderEditWorkflow
sidebar_description: ""
sidebar_description: Create a draft order edit request.
tags:
- remote query
- order
@@ -14,7 +14,15 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
This documentation provides a reference to the `beginDraftOrderEditWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/begin-draft-order-edit.ts#L14" />
This workflow begins a draft order edit. It's used by the
[Create Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_postdraftordersidedit).
The draft order edit can later be requested using [requestDraftOrderEditWorkflow](../core_flows.Draft_Order.Workflows_Draft_Order.requestDraftOrderEditWorkflow/page.mdx) or confirmed using [confirmDraftOrderEditWorkflow](../core_flows.Draft_Order.Workflows_Draft_Order.confirmDraftOrderEditWorkflow/page.mdx).
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
creating a draft order edit request.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/begin-draft-order-edit.ts#L35" />
## Examples
@@ -35,7 +43,7 @@ export async function POST(
const { result } = await beginDraftOrderEditWorkflow(req.scope)
.run({
input: {
"order_id": "order_123"
order_id: "order_123",
}
})
@@ -60,7 +68,7 @@ export default async function handleOrderPlaced({
const { result } = await beginDraftOrderEditWorkflow(container)
.run({
input: {
"order_id": "order_123"
order_id: "order_123",
}
})
@@ -85,7 +93,7 @@ export default async function myCustomJob(
const { result } = await beginDraftOrderEditWorkflow(container)
.run({
input: {
"order_id": "order_123"
order_id: "order_123",
}
})
@@ -111,7 +119,7 @@ const myWorkflow = createWorkflow(
const result = beginDraftOrderEditWorkflow
.runAsStep({
input: {
"order_id": "order_123"
order_id: "order_123",
}
})
}
@@ -123,7 +131,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"beginDraftOrderEditWorkflow","steps":[{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":1},{"type":"step","name":"validateDraftOrderStep","description":"","link":"../../../Steps_Draft_Order/functions/core_flows.Draft_Order.Steps_Draft_Order.validateDraftOrderStep/page.mdx","depth":2},{"type":"step","name":"createOrderChangeStep","description":"This step creates an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.createOrderChangeStep/page.mdx","depth":3},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":4}]}} />
<WorkflowDiagram workflow={{"name":"beginDraftOrderEditWorkflow","steps":[{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":1},{"type":"step","name":"validateDraftOrderStep","description":"This step validates that an order is a draft order. It throws an error otherwise.\n\n:::note\n\nYou can retrieve a draft order's details using [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query),\nor [useQueryGraphStep](https://docs.medusajs.com/resources/references/medusa-workflows/steps/useQueryGraphStep).\n\n:::","link":"../../../Steps_Draft_Order/functions/core_flows.Draft_Order.Steps_Draft_Order.validateDraftOrderStep/page.mdx","depth":2},{"type":"step","name":"createOrderChangeStep","description":"This step creates an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.createOrderChangeStep/page.mdx","depth":3},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":4}]}} />
## Input
@@ -1,7 +1,7 @@
---
slug: /references/medusa-workflows/cancelDraftOrderEditWorkflow
sidebar_label: cancelDraftOrderEditWorkflow
sidebar_description: ""
sidebar_description: Cancel a draft order edit.
tags:
- remote query
- order
@@ -14,7 +14,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
This documentation provides a reference to the `cancelDraftOrderEditWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/cancel-draft-order-edit.ts#L27" />
This workflow cancels a draft order edit. It's used by the
[Cancel Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_deletedraftordersidedit).
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
cancelling a draft order edit.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/cancel-draft-order-edit.ts#L52" />
## Examples
@@ -35,7 +41,7 @@ export async function POST(
const { result } = await cancelDraftOrderEditWorkflow(req.scope)
.run({
input: {
"order_id": "order_123"
order_id: "order_123",
}
})
@@ -60,7 +66,7 @@ export default async function handleOrderPlaced({
const { result } = await cancelDraftOrderEditWorkflow(container)
.run({
input: {
"order_id": "order_123"
order_id: "order_123",
}
})
@@ -85,7 +91,7 @@ export default async function myCustomJob(
const { result } = await cancelDraftOrderEditWorkflow(container)
.run({
input: {
"order_id": "order_123"
order_id: "order_123",
}
})
@@ -111,7 +117,7 @@ const myWorkflow = createWorkflow(
const result = cancelDraftOrderEditWorkflow
.runAsStep({
input: {
"order_id": "order_123"
order_id: "order_123",
}
})
}
@@ -127,4 +133,4 @@ const myWorkflow = createWorkflow(
## Input
<TypeList types={[{"name":"CancelDraftOrderEditWorkflowInput","type":"[CancelDraftOrderEditWorkflowInput](../../../../interfaces/core_flows.CancelDraftOrderEditWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="cancelDraftOrderEditWorkflow"/>
<TypeList types={[{"name":"CancelDraftOrderEditWorkflowInput","type":"[CancelDraftOrderEditWorkflowInput](../../../../interfaces/core_flows.CancelDraftOrderEditWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the draft order edit to cancel.","expandable":false,"children":[{"name":"order_id","type":"`string`","description":"The ID of the draft order to cancel the edit for.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="cancelDraftOrderEditWorkflow"/>
@@ -1,7 +1,7 @@
---
slug: /references/medusa-workflows/confirmDraftOrderEditWorkflow
sidebar_label: confirmDraftOrderEditWorkflow
sidebar_description: ""
sidebar_description: Confirm a draft order edit.
tags:
- remote query
- order
@@ -18,7 +18,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
This documentation provides a reference to the `confirmDraftOrderEditWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/confirm-draft-order-edit.ts#L36" />
This workflow confirms a draft order edit. It's used by the
[Confirm Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_postdraftordersideditconfirm).
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
confirming a draft order edit.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/confirm-draft-order-edit.ts#L56" />
## Examples
@@ -39,8 +45,8 @@ export async function POST(
const { result } = await confirmDraftOrderEditWorkflow(req.scope)
.run({
input: {
"order_id": "order_123",
"confirmed_by": "{value}"
order_id: "order_123",
confirmed_by: "user_123",
}
})
@@ -65,8 +71,8 @@ export default async function handleOrderPlaced({
const { result } = await confirmDraftOrderEditWorkflow(container)
.run({
input: {
"order_id": "order_123",
"confirmed_by": "{value}"
order_id: "order_123",
confirmed_by: "user_123",
}
})
@@ -91,8 +97,8 @@ export default async function myCustomJob(
const { result } = await confirmDraftOrderEditWorkflow(container)
.run({
input: {
"order_id": "order_123",
"confirmed_by": "{value}"
order_id: "order_123",
confirmed_by: "user_123",
}
})
@@ -118,8 +124,8 @@ const myWorkflow = createWorkflow(
const result = confirmDraftOrderEditWorkflow
.runAsStep({
input: {
"order_id": "order_123",
"confirmed_by": "{value}"
order_id: "order_123",
confirmed_by: "user_123",
}
})
}
@@ -0,0 +1,36 @@
---
slug: /references/medusa-workflows/convertDraftOrderStep
sidebar_label: convertDraftOrderStep
sidebar_description: ""
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# convertDraftOrderStep - Medusa Core Workflows Reference
This documentation provides a reference to the `convertDraftOrderStep`. It belongs to the `@medusajs/medusa/core-flows` package.
This step converts a draft order to a pending order.
```ts title="src/workflows/my-workflow.ts"
import { createWorkflow } from "@medusajs/framework/workflows-sdk"
import { convertDraftOrderStep } from "@medusajs/medusa/core-flows"
const myWorkflow = createWorkflow(
"my-workflow",
() => {
const data = convertDraftOrderStep({
"id": "id_BOUXu32Hh5N"
})
}
)
```
## Input
<TypeList types={[{"name":"ConvertDraftOrderStepInput","type":"[ConvertDraftOrderStepInput](../../../../interfaces/core_flows.ConvertDraftOrderStepInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the draft order to convert to an order.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the draft order to convert to an order.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="convertDraftOrderStep"/>
## Output
<TypeList types={[{"name":"OrderDTO","type":"[OrderDTO](../../../../../fulfillment/interfaces/fulfillment.OrderDTO/page.mdx)","optional":false,"defaultValue":"","description":"The order details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The version of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"The order's display ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[OrderStatus](../../../../../fulfillment/types/fulfillment.OrderStatus/page.mdx)","description":"The status of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_tax_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandablLine truncated
@@ -1,7 +1,7 @@
---
slug: /references/medusa-workflows/convertDraftOrderWorkflow
sidebar_label: convertDraftOrderWorkflow
sidebar_description: ""
sidebar_description: Convert a draft order to a pending order.
---
import { TypeList, WorkflowDiagram } from "docs-ui"
@@ -10,7 +10,7 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
This documentation provides a reference to the `convertDraftOrderWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/convert-draft-order.ts#L79" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/convert-draft-order.ts#L97" />
## Examples
@@ -25,12 +25,15 @@ import type {
import { convertDraftOrderWorkflow } from "@medusajs/medusa/core-flows"
export async function POST(
req: MedusaRequest,
res: MedusaResponse
) {
``
`typescript
const order = await convertDraftOrderWorkflow({ id: "order_123" })
req: MedusaRequest,
res: MedusaResponse
) {
const { result } = await convertDraftOrderWorkflow(req.scope)
.run({
input: {
id: "order_123",
}
})
res.send(result)
}
@@ -47,12 +50,15 @@ import {
import { convertDraftOrderWorkflow } from "@medusajs/medusa/core-flows"
export default async function handleOrderPlaced({
event: { data },
container,
}: SubscriberArgs < { id: string } > ) {
``
`typescript
const order = await convertDraftOrderWorkflow({ id: "order_123" })
event: { data },
container,
}: SubscriberArgs < { id: string } > ) {
const { result } = await convertDraftOrderWorkflow(container)
.run({
input: {
id: "order_123",
}
})
console.log(result)
}
@@ -70,11 +76,14 @@ import { MedusaContainer } from "@medusajs/framework/types"
import { convertDraftOrderWorkflow } from "@medusajs/medusa/core-flows"
export default async function myCustomJob(
container: MedusaContainer
) {
``
`typescript
const order = await convertDraftOrderWorkflow({ id: "order_123" })
container: MedusaContainer
) {
const { result } = await convertDraftOrderWorkflow(container)
.run({
input: {
id: "order_123",
}
})
console.log(result)
}
@@ -93,11 +102,14 @@ import { createWorkflow } from "@medusajs/framework/workflows-sdk"
import { convertDraftOrderWorkflow } from "@medusajs/medusa/core-flows"
const myWorkflow = createWorkflow(
"my-workflow",
() => {
``
`typescript
const order = convertDraftOrderWorkflow({ id: "order_123" })
"my-workflow",
() => {
const result = convertDraftOrderWorkflow
.runAsStep({
input: {
id: "order_123",
}
})
}
)
```
@@ -107,7 +119,7 @@ const order = convertDraftOrderWorkflow({ id: "order_123" })
## Input
<TypeList types={[{"name":"ConvertDraftOrderWorkflowInput","type":"`ConvertDraftOrderWorkflowInput`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="convertDraftOrderWorkflow"/>
<TypeList types={[{"name":"ConvertDraftOrderWorkflowInput","type":"[ConvertDraftOrderWorkflowInput](../../../../interfaces/core_flows.ConvertDraftOrderWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the draft order to convert to an order.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the draft order to convert to an order.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="convertDraftOrderWorkflow"/>
## Output
@@ -1,7 +1,7 @@
---
slug: /references/medusa-workflows/removeDraftOrderActionItemWorkflow
sidebar_label: removeDraftOrderActionItemWorkflow
sidebar_description: ""
sidebar_description: Remove an item from a draft order edit.
tags:
- remote query
- order
@@ -14,7 +14,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
This documentation provides a reference to the `removeDraftOrderActionItemWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-item.ts#L28" />
This workflow removes an item that was added or updated in a draft order edit. It's used by the
[Remove Item from Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_deletedraftordersidedititemsaction\_id).
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
removing an item from a draft order edit.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-item.ts#L48" />
## Examples
@@ -35,8 +41,8 @@ export async function POST(
const { result } = await removeDraftOrderActionItemWorkflow(req.scope)
.run({
input: {
"order_id": "order_123",
"action_id": "{value}"
order_id: "order_123",
action_id: "action_123",
}
})
@@ -61,8 +67,8 @@ export default async function handleOrderPlaced({
const { result } = await removeDraftOrderActionItemWorkflow(container)
.run({
input: {
"order_id": "order_123",
"action_id": "{value}"
order_id: "order_123",
action_id: "action_123",
}
})
@@ -87,8 +93,8 @@ export default async function myCustomJob(
const { result } = await removeDraftOrderActionItemWorkflow(container)
.run({
input: {
"order_id": "order_123",
"action_id": "{value}"
order_id: "order_123",
action_id: "action_123",
}
})
@@ -114,8 +120,8 @@ const myWorkflow = createWorkflow(
const result = removeDraftOrderActionItemWorkflow
.runAsStep({
input: {
"order_id": "order_123",
"action_id": "{value}"
order_id: "order_123",
action_id: "action_123",
}
})
}
@@ -1,7 +1,7 @@
---
slug: /references/medusa-workflows/removeDraftOrderActionShippingMethodWorkflow
sidebar_label: removeDraftOrderActionShippingMethodWorkflow
sidebar_description: ""
sidebar_description: Remove a shipping method from an edited draft order.
tags:
- remote query
- order
@@ -14,7 +14,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
This documentation provides a reference to the `removeDraftOrderActionShippingMethodWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-shipping-method.ts#L32" />
This workflow removes a shipping method that was added to an edited draft order. It's used by the
[Remove Shipping Method from Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_deletedraftordersideditshippingmethodsaction\_id).
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
removing a shipping method from an edited draft order.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-shipping-method.ts#L52" />
## Examples
@@ -36,8 +42,8 @@ export async function POST(
.scope)
.run({
input: {
"order_id": "order_123",
"action_id": "{value}"
order_id: "order_123",
action_id: "action_123",
}
})
@@ -63,8 +69,8 @@ export default async function handleOrderPlaced({
container)
.run({
input: {
"order_id": "order_123",
"action_id": "{value}"
order_id: "order_123",
action_id: "action_123",
}
})
@@ -90,8 +96,8 @@ export default async function myCustomJob(
container)
.run({
input: {
"order_id": "order_123",
"action_id": "{value}"
order_id: "order_123",
action_id: "action_123",
}
})
@@ -117,8 +123,8 @@ const myWorkflow = createWorkflow(
const result = removeDraftOrderActionShippingMethodWorkflow
.runAsStep({
input: {
"order_id": "order_123",
"action_id": "{value}"
order_id: "order_123",
action_id: "action_123",
}
})
}
@@ -1,7 +1,7 @@
---
slug: /references/medusa-workflows/removeDraftOrderPromotionsWorkflow
sidebar_label: removeDraftOrderPromotionsWorkflow
sidebar_description: ""
sidebar_description: Remove promotions from a draft order edit.
tags:
- remote query
- order
@@ -14,7 +14,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
This documentation provides a reference to the `removeDraftOrderPromotionsWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-promotions.ts#L31" />
This workflow removes promotions from a draft order edit. It's used by the
[Remove Promotions from Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_deletedraftordersideditpromotions).
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
removing promotions from a draft order edit.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-promotions.ts#L60" />
## Examples
@@ -34,7 +40,10 @@ export async function POST(
) {
const { result } = await removeDraftOrderPromotionsWorkflow(req.scope)
.run({
input: "{value}"
input: {
order_id: "order_123",
promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"],
}
})
res.send(result)
@@ -57,7 +66,10 @@ export default async function handleOrderPlaced({
}: SubscriberArgs < { id: string } > ) {
const { result } = await removeDraftOrderPromotionsWorkflow(container)
.run({
input: "{value}"
input: {
order_id: "order_123",
promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"],
}
})
console.log(result)
@@ -80,7 +92,10 @@ export default async function myCustomJob(
) {
const { result } = await removeDraftOrderPromotionsWorkflow(container)
.run({
input: "{value}"
input: {
order_id: "order_123",
promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"],
}
})
console.log(result)
@@ -104,7 +119,10 @@ const myWorkflow = createWorkflow(
() => {
const result = removeDraftOrderPromotionsWorkflow
.runAsStep({
input: "{value}"
input: {
order_id: "order_123",
promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"],
}
})
}
)
@@ -119,7 +137,7 @@ const myWorkflow = createWorkflow(
## Input
<TypeList types={[{"name":"RemoveDraftOrderPromotionsWorkflowInput","type":"`RemoveDraftOrderPromotionsWorkflowInput`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="removeDraftOrderPromotionsWorkflow"/>
<TypeList types={[{"name":"RemoveDraftOrderPromotionsWorkflowInput","type":"[RemoveDraftOrderPromotionsWorkflowInput](../../../../interfaces/core_flows.RemoveDraftOrderPromotionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the promotions to remove from a draft order.","expandable":false,"children":[{"name":"order_id","type":"`string`","description":"The ID of the draft order to remove the promotions from.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"promo_codes","type":"`string`[]","description":"The codes of the promotions to remove from the draft order.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="removeDraftOrderPromotionsWorkflow"/>
## Output
@@ -1,7 +1,7 @@
---
slug: /references/medusa-workflows/removeDraftOrderShippingMethodWorkflow
sidebar_label: removeDraftOrderShippingMethodWorkflow
sidebar_description: ""
sidebar_description: Remove an existing shipping method from a draft order edit.
tags:
- remote query
- order
@@ -15,7 +15,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
This documentation provides a reference to the `removeDraftOrderShippingMethodWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-shipping-method.ts#L38" />
This workflow removes an existing shipping method from a draft order edit. It's used by the
[Remove Shipping Method from Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_deletedraftordersideditshippingmethodsmethodmethod\_id).
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
removing a shipping method from a draft order edit.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-shipping-method.ts#L61" />
## Examples
@@ -35,7 +41,10 @@ export async function POST(
) {
const { result } = await removeDraftOrderShippingMethodWorkflow(req.scope)
.run({
input: "{value}"
input: {
order_id: "order_123",
shipping_method_id: "sm_123",
}
})
res.send(result)
@@ -58,7 +67,10 @@ export default async function handleOrderPlaced({
}: SubscriberArgs < { id: string } > ) {
const { result } = await removeDraftOrderShippingMethodWorkflow(container)
.run({
input: "{value}"
input: {
order_id: "order_123",
shipping_method_id: "sm_123",
}
})
console.log(result)
@@ -81,7 +93,10 @@ export default async function myCustomJob(
) {
const { result } = await removeDraftOrderShippingMethodWorkflow(container)
.run({
input: "{value}"
input: {
order_id: "order_123",
shipping_method_id: "sm_123",
}
})
console.log(result)
@@ -105,7 +120,10 @@ const myWorkflow = createWorkflow(
() => {
const result = removeDraftOrderShippingMethodWorkflow
.runAsStep({
input: "{value}"
input: {
order_id: "order_123",
shipping_method_id: "sm_123",
}
})
}
)
@@ -120,7 +138,7 @@ const myWorkflow = createWorkflow(
## Input
<TypeList types={[{"name":"RemoveDraftOrderShippingMethodWorkflowInput","type":"`RemoveDraftOrderShippingMethodWorkflowInput`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="removeDraftOrderShippingMethodWorkflow"/>
<TypeList types={[{"name":"RemoveDraftOrderShippingMethodWorkflowInput","type":"[RemoveDraftOrderShippingMethodWorkflowInput](../../../../interfaces/core_flows.RemoveDraftOrderShippingMethodWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the shipping method to remove from a draft order.","expandable":false,"children":[{"name":"order_id","type":"`string`","description":"The ID of the draft order to remove the shipping method from.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_method_id","type":"`string`","description":"The ID of the shipping method to remove.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="removeDraftOrderShippingMethodWorkflow"/>
## Output
@@ -1,7 +1,7 @@
---
slug: /references/medusa-workflows/requestDraftOrderEditWorkflow
sidebar_label: requestDraftOrderEditWorkflow
sidebar_description: ""
sidebar_description: Request a draft order edit.
tags:
- remote query
- order
@@ -16,7 +16,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
This documentation provides a reference to the `requestDraftOrderEditWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/request-draft-order-edit.ts#L51" />
This workflow requests a draft order edit. It's used by the
[Request Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_postdraftordersideditrequest).
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
requesting a draft order edit.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/request-draft-order-edit.ts#L71" />
## Examples
@@ -37,7 +43,8 @@ export async function POST(
const { result } = await requestDraftOrderEditWorkflow(req.scope)
.run({
input: {
"order_id": "order_123"
order_id: "order_123",
requested_by: "user_123",
}
})
@@ -62,7 +69,8 @@ export default async function handleOrderPlaced({
const { result } = await requestDraftOrderEditWorkflow(container)
.run({
input: {
"order_id": "order_123"
order_id: "order_123",
requested_by: "user_123",
}
})
@@ -87,7 +95,8 @@ export default async function myCustomJob(
const { result } = await requestDraftOrderEditWorkflow(container)
.run({
input: {
"order_id": "order_123"
order_id: "order_123",
requested_by: "user_123",
}
})
@@ -113,7 +122,8 @@ const myWorkflow = createWorkflow(
const result = requestDraftOrderEditWorkflow
.runAsStep({
input: {
"order_id": "order_123"
order_id: "order_123",
requested_by: "user_123",
}
})
}
@@ -1,7 +1,7 @@
---
slug: /references/medusa-workflows/updateDraftOrderActionItemWorkflow
sidebar_label: updateDraftOrderActionItemWorkflow
sidebar_description: ""
sidebar_description: Update a new item in a draft order edit.
tags:
- remote query
- order
@@ -14,7 +14,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
This documentation provides a reference to the `updateDraftOrderActionItemWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-item.ts#L28" />
This workflow updates a new item that was added to a draft order edit. It's used by the
[Update New Item in Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_postdraftordersidedititemsaction\_id).
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
updating a new item in a draft order edit.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-item.ts#L51" />
## Examples
@@ -35,9 +41,11 @@ export async function POST(
const { result } = await updateDraftOrderActionItemWorkflow(req.scope)
.run({
input: {
"order_id": "order_123",
"action_id": "{value}",
"data": {}
order_id: "order_123",
action_id: "action_123",
data: {
quantity: 2,
}
}
})
@@ -62,9 +70,11 @@ export default async function handleOrderPlaced({
const { result } = await updateDraftOrderActionItemWorkflow(container)
.run({
input: {
"order_id": "order_123",
"action_id": "{value}",
"data": {}
order_id: "order_123",
action_id: "action_123",
data: {
quantity: 2,
}
}
})
@@ -89,9 +99,11 @@ export default async function myCustomJob(
const { result } = await updateDraftOrderActionItemWorkflow(container)
.run({
input: {
"order_id": "order_123",
"action_id": "{value}",
"data": {}
order_id: "order_123",
action_id: "action_123",
data: {
quantity: 2,
}
}
})
@@ -117,9 +129,11 @@ const myWorkflow = createWorkflow(
const result = updateDraftOrderActionItemWorkflow
.runAsStep({
input: {
"order_id": "order_123",
"action_id": "{value}",
"data": {}
order_id: "order_123",
action_id: "action_123",
data: {
quantity: 2,
}
}
})
}
@@ -1,7 +1,7 @@
---
slug: /references/medusa-workflows/updateDraftOrderActionShippingMethodWorkflow
sidebar_label: updateDraftOrderActionShippingMethodWorkflow
sidebar_description: ""
sidebar_description: Update a new shipping method in a draft order edit.
tags:
- remote query
- order
@@ -14,7 +14,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
This documentation provides a reference to the `updateDraftOrderActionShippingMethodWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-shipping-method.ts#L33" />
This workflow updates a new shipping method that was added to a draft order edit. It's used by the
[Update New Shipping Method in Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_postdraftordersideditshippingmethodsaction\_id).
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
updating a new shipping method in a draft order edit.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-shipping-method.ts#L56" />
## Examples
@@ -36,9 +42,11 @@ export async function POST(
.scope)
.run({
input: {
"order_id": "order_123",
"action_id": "{value}",
"data": {}
order_id: "order_123",
action_id: "action_123",
data: {
custom_amount: 10,
}
}
})
@@ -64,9 +72,11 @@ export default async function handleOrderPlaced({
container)
.run({
input: {
"order_id": "order_123",
"action_id": "{value}",
"data": {}
order_id: "order_123",
action_id: "action_123",
data: {
custom_amount: 10,
}
}
})
@@ -92,9 +102,11 @@ export default async function myCustomJob(
container)
.run({
input: {
"order_id": "order_123",
"action_id": "{value}",
"data": {}
order_id: "order_123",
action_id: "action_123",
data: {
custom_amount: 10,
}
}
})
@@ -120,9 +132,11 @@ const myWorkflow = createWorkflow(
const result = updateDraftOrderActionShippingMethodWorkflow
.runAsStep({
input: {
"order_id": "order_123",
"action_id": "{value}",
"data": {}
order_id: "order_123",
action_id: "action_123",
data: {
custom_amount: 10,
}
}
})
}
@@ -1,7 +1,7 @@
---
slug: /references/medusa-workflows/updateDraftOrderItemWorkflow
sidebar_label: updateDraftOrderItemWorkflow
sidebar_description: ""
sidebar_description: Update an item in a draft order edit.
tags:
- remote query
- order
@@ -14,7 +14,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
This documentation provides a reference to the `updateDraftOrderItemWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/update-draft-order-item.ts#L33" />
This workflow updates an item in a draft order edit. It's used by the
[Update Item in Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_postdraftordersidedititemsitemitem\_id).
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
updating an item in a draft order edit.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/update-draft-order-item.ts#L53" />
## Examples
@@ -35,11 +41,8 @@ export async function POST(
const { result } = await updateDraftOrderItemWorkflow(req.scope)
.run({
input: {
"order_id": "order_123",
"items": [{
"id": "id_kjpPS2S1yZ6z",
"quantity": 24
}]
order_id: "order_123",
items: [{ id: "orli_123", quantity: 2 }],
}
})
@@ -64,11 +67,8 @@ export default async function handleOrderPlaced({
const { result } = await updateDraftOrderItemWorkflow(container)
.run({
input: {
"order_id": "order_123",
"items": [{
"id": "id_kjpPS2S1yZ6z",
"quantity": 24
}]
order_id: "order_123",
items: [{ id: "orli_123", quantity: 2 }],
}
})
@@ -93,11 +93,8 @@ export default async function myCustomJob(
const { result } = await updateDraftOrderItemWorkflow(container)
.run({
input: {
"order_id": "order_123",
"items": [{
"id": "id_kjpPS2S1yZ6z",
"quantity": 24
}]
order_id: "order_123",
items: [{ id: "orli_123", quantity: 2 }],
}
})
@@ -123,11 +120,8 @@ const myWorkflow = createWorkflow(
const result = updateDraftOrderItemWorkflow
.runAsStep({
input: {
"order_id": "order_123",
"items": [{
"id": "id_kjpPS2S1yZ6z",
"quantity": 24
}]
order_id: "order_123",
items: [{ id: "orli_123", quantity: 2 }],
}
})
}
@@ -1,7 +1,7 @@
---
slug: /references/medusa-workflows/updateDraftOrderShippingMethodWorkflow
sidebar_label: updateDraftOrderShippingMethodWorkflow
sidebar_description: ""
sidebar_description: Update an existing shipping method in a draft order edit.
tags:
- remote query
- order
@@ -15,7 +15,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
This documentation provides a reference to the `updateDraftOrderShippingMethodWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/update-draft-order-shipping-method.ts#L53" />
This workflow updates an existing shipping method in a draft order edit. It's used by the
[Update Shipping Method in Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_postdraftordersideditshippingmethodsmethodmethod\_id).
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
updating an existing shipping method in a draft order edit.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/update-draft-order-shipping-method.ts#L79" />
## Examples
@@ -36,9 +42,10 @@ export async function POST(
const { result } = await updateDraftOrderShippingMethodWorkflow(req.scope)
.run({
input: {
"order_id": "order_123",
"data": {
"shipping_method_id": "{value}"
order_id: "order_123",
data: {
shipping_method_id: "sm_123",
custom_amount: 10,
}
}
})
@@ -64,9 +71,10 @@ export default async function handleOrderPlaced({
const { result } = await updateDraftOrderShippingMethodWorkflow(container)
.run({
input: {
"order_id": "order_123",
"data": {
"shipping_method_id": "{value}"
order_id: "order_123",
data: {
shipping_method_id: "sm_123",
custom_amount: 10,
}
}
})
@@ -92,9 +100,10 @@ export default async function myCustomJob(
const { result } = await updateDraftOrderShippingMethodWorkflow(container)
.run({
input: {
"order_id": "order_123",
"data": {
"shipping_method_id": "{value}"
order_id: "order_123",
data: {
shipping_method_id: "sm_123",
custom_amount: 10,
}
}
})
@@ -121,9 +130,10 @@ const myWorkflow = createWorkflow(
const result = updateDraftOrderShippingMethodWorkflow
.runAsStep({
input: {
"order_id": "order_123",
"data": {
"shipping_method_id": "{value}"
order_id: "order_123",
data: {
shipping_method_id: "sm_123",
custom_amount: 10,
}
}
})
@@ -140,7 +150,7 @@ const myWorkflow = createWorkflow(
## Input
<TypeList types={[{"name":"UpdateDraftOrderShippingMethodWorkflowInput","type":"[UpdateDraftOrderShippingMethodWorkflowInput](../../../../interfaces/core_flows.UpdateDraftOrderShippingMethodWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_id","type":"`string`","description":"The ID of the order to update the shipping method in its edit.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"shipping_method_id","type":"`string`","description":"The ID of the shipping method to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_id","type":"`string`","description":"The ID of the shipping option to associate with the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"custom_amount","type":"[BigNumberInput](../../../../../types/types/types.BigNumberInput/page.mdx)","description":"Set a custom amount for the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"internal_note","type":"`null` \\| `string`","description":"A note viewed by admins only related to the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="updateDraftOrderShippingMethodWorkflow"/>
<TypeList types={[{"name":"UpdateDraftOrderShippingMethodWorkflowInput","type":"[UpdateDraftOrderShippingMethodWorkflowInput](../../../../interfaces/core_flows.UpdateDraftOrderShippingMethodWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the shipping method to update in the order edit.","expandable":false,"children":[{"name":"order_id","type":"`string`","description":"The ID of the order to update the shipping method in its edit.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"shipping_method_id","type":"`string`","description":"The ID of the shipping method to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_id","type":"`string`","description":"The ID of the shipping method's option.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"custom_amount","type":"[BigNumberInput](../../../../../types/types/types.BigNumberInput/page.mdx)","description":"Set a custom amount for the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"internal_note","type":"`null` \\| `string`","description":"A note viewed by admins only related to the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="updateDraftOrderShippingMethodWorkflow"/>
## Output
@@ -0,0 +1,45 @@
---
slug: /references/medusa-workflows/updateDraftOrderStep
sidebar_label: updateDraftOrderStep
sidebar_description: ""
tags:
- order
- step
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# updateDraftOrderStep - Medusa Core Workflows Reference
This documentation provides a reference to the `updateDraftOrderStep`. It belongs to the `@medusajs/medusa/core-flows` package.
This step updates a draft order's details.
:::note
You can retrieve a draft order's details using [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query),
or [useQueryGraphStep](https://docs.medusajs.com/resources/references/medusa-workflows/steps/useQueryGraphStep).
:::
## Example
```ts
const data = updateDraftOrderStep({
order: {
id: "order_123",
// other order details...
},
input: {
// details to update...
}
})
```
## Input
<TypeList types={[{"name":"UpdateDraftOrderStepInput","type":"[UpdateDraftOrderStepInput](../../../../interfaces/core_flows.UpdateDraftOrderStepInput/page.mdx)","optional":false,"defaultValue":"","description":"The input for the update draft order step.","expandable":false,"children":[{"name":"order","type":"[OrderDTO](../../../../../fulfillment/interfaces/fulfillment.OrderDTO/page.mdx)","description":"The draft order to update.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The version of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"The order's display ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[OrderStatus](../../../../../fulfillment/types/fulfillment.OrderStatus/page.mdx)","description":"The status of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_tax_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BLine truncated
## Output
<TypeList types={[{"name":"OrderDTO","type":"[OrderDTO](../../../../../fulfillment/interfaces/fulfillment.OrderDTO/page.mdx)","optional":false,"defaultValue":"","description":"The order details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The version of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"The order's display ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[OrderStatus](../../../../../fulfillment/types/fulfillment.OrderStatus/page.mdx)","description":"The status of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_tax_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandablLine truncated
@@ -1,7 +1,7 @@
---
slug: /references/medusa-workflows/updateDraftOrderWorkflow
sidebar_label: updateDraftOrderWorkflow
sidebar_description: ""
sidebar_description: Update a draft order's details.
tags:
- remote query
- order
@@ -15,7 +15,18 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
This documentation provides a reference to the `updateDraftOrderWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/update-draft-order.ts#L90" />
This workflow updates a draft order's details. It's used by the
[Update Draft Order Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_postdraftordersid).
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](../core_flows.Draft_Order.Workflows_Draft_Order.beginDraftOrderEditWorkflow/page.mdx) and make updates in the draft order edit.
Then, you can confirm the draft order edit using [confirmDraftOrderEditWorkflow](../core_flows.Draft_Order.Workflows_Draft_Order.confirmDraftOrderEditWorkflow/page.mdx) or request a draft order edit
using [requestDraftOrderEditWorkflow](../core_flows.Draft_Order.Workflows_Draft_Order.requestDraftOrderEditWorkflow/page.mdx).
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
updating a draft order.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/update-draft-order.ts#L149" />
## Examples
@@ -36,8 +47,9 @@ export async function POST(
const { result } = await updateDraftOrderWorkflow(req.scope)
.run({
input: {
"id": "id_KPdfMxf8zFK",
"user_id": "{value}"
id: "order_123",
user_id: "user_123",
customer_id: "cus_123",
}
})
@@ -62,8 +74,9 @@ export default async function handleOrderPlaced({
const { result } = await updateDraftOrderWorkflow(container)
.run({
input: {
"id": "id_KPdfMxf8zFK",
"user_id": "{value}"
id: "order_123",
user_id: "user_123",
customer_id: "cus_123",
}
})
@@ -88,8 +101,9 @@ export default async function myCustomJob(
const { result } = await updateDraftOrderWorkflow(container)
.run({
input: {
"id": "id_KPdfMxf8zFK",
"user_id": "{value}"
id: "order_123",
user_id: "user_123",
customer_id: "cus_123",
}
})
@@ -115,8 +129,9 @@ const myWorkflow = createWorkflow(
const result = updateDraftOrderWorkflow
.runAsStep({
input: {
"id": "id_KPdfMxf8zFK",
"user_id": "{value}"
id: "order_123",
user_id: "user_123",
customer_id: "cus_123",
}
})
}
@@ -128,11 +143,11 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"updateDraftOrderWorkflow","steps":[{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":1},{"type":"step","name":"validateDraftOrderStep","description":"","link":"../../../Steps_Draft_Order/functions/core_flows.Draft_Order.Steps_Draft_Order.validateDraftOrderStep/page.mdx","depth":2},{"type":"step","name":"registerOrderChangesStep","description":"This step registers an order changes.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.registerOrderChangesStep/page.mdx","depth":3},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":4},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":5}]}} />
<WorkflowDiagram workflow={{"name":"updateDraftOrderWorkflow","steps":[{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":1},{"type":"step","name":"validateDraftOrderStep","description":"This step validates that an order is a draft order. It throws an error otherwise.\n\n:::note\n\nYou can retrieve a draft order's details using [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query),\nor [useQueryGraphStep](https://docs.medusajs.com/resources/references/medusa-workflows/steps/useQueryGraphStep).\n\n:::","link":"../../../Steps_Draft_Order/functions/core_flows.Draft_Order.Steps_Draft_Order.validateDraftOrderStep/page.mdx","depth":2},{"type":"step","name":"updateDraftOrderStep","description":"This step updates a draft order's details.\n\n:::note\n\nYou can retrieve a draft order's details using [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query),\nor [useQueryGraphStep](https://docs.medusajs.com/resources/references/medusa-workflows/steps/useQueryGraphStep).\n\n:::","link":"../core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderStep/page.mdx","depth":3},{"type":"step","name":"registerOrderChangesStep","description":"This step registers an order changes.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.registerOrderChangesStep/page.mdx","depth":4},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":5},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":6}]}} />
## Input
<TypeList types={[{"name":"UpdateDraftOrderWorkflowInput","type":"[UpdateDraftOrderWorkflowInput](../../../../interfaces/core_flows.UpdateDraftOrderWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the draft order to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"user_id","type":"`string`","description":"The ID of the user updating the draft order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address","type":"[UpsertOrderAddressDTO](../../../../../order/interfaces/order.UpsertOrderAddressDTO/page.mdx)","description":"Create or update the shipping address of the draft order.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"billing_address","type":"[UpsertOrderAddressDTO](../../../../../order/interfaces/order.UpsertOrderAddressDTO/page.mdx)","description":"Create or update the billing address of the draft order.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"customer_id","type":"`string`","description":"The ID of the customer to associate the draft order with.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","typLine truncated
<TypeList types={[{"name":"UpdateDraftOrderWorkflowInput","type":"[UpdateDraftOrderWorkflowInput](../../../../interfaces/core_flows.UpdateDraftOrderWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the draft order to update.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the draft order to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"user_id","type":"`string`","description":"The ID of the user updating the draft order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address","type":"[UpsertOrderAddressDTO](../../../../../order/interfaces/order.UpsertOrderAddressDTO/page.mdx)","description":"Create or update the shipping address of the draft order.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"billing_address","type":"[UpsertOrderAddressDTO](../../../../../order/interfaces/order.UpsertOrderAddressDTO/page.mdx)","description":"Create or update the billing address of the draft order.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"customer_id","type":"`string`","description":"The ID of the customer to associate the draft order with.","optional":true,"defaultValue":"","expandable":Line truncated
## Output
@@ -8,6 +8,7 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
- [beginDraftOrderEditWorkflow](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.beginDraftOrderEditWorkflow/page.mdx)
- [cancelDraftOrderEditWorkflow](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.cancelDraftOrderEditWorkflow/page.mdx)
- [confirmDraftOrderEditWorkflow](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.confirmDraftOrderEditWorkflow/page.mdx)
- [convertDraftOrderStep](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.convertDraftOrderStep/page.mdx)
- [convertDraftOrderWorkflow](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.convertDraftOrderWorkflow/page.mdx)
- [removeDraftOrderActionItemWorkflow](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.removeDraftOrderActionItemWorkflow/page.mdx)
- [removeDraftOrderActionShippingMethodWorkflow](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.removeDraftOrderActionShippingMethodWorkflow/page.mdx)
@@ -18,4 +19,5 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
- [updateDraftOrderActionShippingMethodWorkflow](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderActionShippingMethodWorkflow/page.mdx)
- [updateDraftOrderItemWorkflow](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderItemWorkflow/page.mdx)
- [updateDraftOrderShippingMethodWorkflow](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderShippingMethodWorkflow/page.mdx)
- [updateDraftOrderStep](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderStep/page.mdx)
- [updateDraftOrderWorkflow](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderWorkflow/page.mdx)
@@ -0,0 +1,7 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# AddDraftOrderPromotionWorkflowInput
The details of the promotions to add to a draft order.
<TypeList types={[{"name":"order_id","type":"`string`","description":"The ID of the draft order to add the promotions to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"promo_codes","type":"`string`[]","description":"The codes of the promotions to add to the draft order.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="AddDraftOrderPromotionWorkflowInput"/>
@@ -0,0 +1,7 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# AddDraftOrderShippingMethodsWorkflowInput
The details of the shipping methods to add to a draft order.
<TypeList types={[{"name":"order_id","type":"`string`","description":"The ID of the draft order to add the shipping methods to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_id","type":"`string`","description":"The ID of the shipping option to add as a shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"custom_amount","type":"`null` \\| [BigNumberInput](../../../types/types/types.BigNumberInput/page.mdx)","description":"The custom amount to add the shipping method with.\nIf not specified, the shipping option's fixed or calculated price will be used.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="AddDraftOrderShippingMethodsWorkflowInput"/>
@@ -2,4 +2,6 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
# CancelDraftOrderEditWorkflowInput
<TypeList types={[{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="CancelDraftOrderEditWorkflowInput"/>
The details of the draft order edit to cancel.
<TypeList types={[{"name":"order_id","type":"`string`","description":"The ID of the draft order to cancel the edit for.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="CancelDraftOrderEditWorkflowInput"/>
@@ -0,0 +1,7 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# ConvertDraftOrderStepInput
The details of the draft order to convert to an order.
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the draft order to convert to an order.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="ConvertDraftOrderStepInput"/>
@@ -0,0 +1,7 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# ConvertDraftOrderWorkflowInput
The details of the draft order to convert to an order.
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the draft order to convert to an order.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="ConvertDraftOrderWorkflowInput"/>
@@ -0,0 +1,7 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# RemoveDraftOrderPromotionsWorkflowInput
The details of the promotions to remove from a draft order.
<TypeList types={[{"name":"order_id","type":"`string`","description":"The ID of the draft order to remove the promotions from.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"promo_codes","type":"`string`[]","description":"The codes of the promotions to remove from the draft order.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="RemoveDraftOrderPromotionsWorkflowInput"/>
@@ -0,0 +1,7 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# RemoveDraftOrderShippingMethodWorkflowInput
The details of the shipping method to remove from a draft order.
<TypeList types={[{"name":"order_id","type":"`string`","description":"The ID of the draft order to remove the shipping method from.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_method_id","type":"`string`","description":"The ID of the shipping method to remove.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="RemoveDraftOrderShippingMethodWorkflowInput"/>
@@ -2,4 +2,6 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
# UpdateDraftOrderShippingMethodWorkflowInput
<TypeList types={[{"name":"order_id","type":"`string`","description":"The ID of the order to update the shipping method in its edit.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"shipping_method_id","type":"`string`","description":"The ID of the shipping method to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_id","type":"`string`","description":"The ID of the shipping option to associate with the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"custom_amount","type":"[BigNumberInput](../../../types/types/types.BigNumberInput/page.mdx)","description":"Set a custom amount for the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"internal_note","type":"`null` \\| `string`","description":"A note viewed by admins only related to the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="UpdateDraftOrderShippingMethodWorkflowInput"/>
The details of the shipping method to update in the order edit.
<TypeList types={[{"name":"order_id","type":"`string`","description":"The ID of the order to update the shipping method in its edit.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"shipping_method_id","type":"`string`","description":"The ID of the shipping method to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_id","type":"`string`","description":"The ID of the shipping method's option.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"custom_amount","type":"[BigNumberInput](../../../types/types/types.BigNumberInput/page.mdx)","description":"Set a custom amount for the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"internal_note","type":"`null` \\| `string`","description":"A note viewed by admins only related to the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="UpdateDraftOrderShippingMethodWorkflowInput"/>
@@ -0,0 +1,7 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# UpdateDraftOrderStepInput
The input for the update draft order step.
<TypeList types={[{"name":"order","type":"[OrderDTO](../../../fulfillment/interfaces/fulfillment.OrderDTO/page.mdx)","description":"The draft order to update.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The version of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"The order's display ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[OrderStatus](../../../fulfillment/types/fulfillment.OrderStatus/page.mdx)","description":"The status of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_subtotal","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_tax_total","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_tax_total","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numLine truncated
@@ -2,4 +2,6 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
# UpdateDraftOrderWorkflowInput
The details of the draft order to update.
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the draft order to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"user_id","type":"`string`","description":"The ID of the user updating the draft order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address","type":"[UpsertOrderAddressDTO](../../../order/interfaces/order.UpsertOrderAddressDTO/page.mdx)","description":"Create or update the shipping address of the draft order.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"billing_address","type":"[UpsertOrderAddressDTO](../../../order/interfaces/order.UpsertOrderAddressDTO/page.mdx)","description":"Create or update the billing address of the draft order.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"customer_id","type":"`string`","description":"The ID of the customer to associate the draft order with.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The new email of the draft order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`string`","description":"The ID of the sales channel to associate the draft order wLine truncated
@@ -0,0 +1,7 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# ValidateDraftOrderStepInput
The details of the draft order to validate.
<TypeList types={[{"name":"order","type":"[OrderDTO](../../../fulfillment/interfaces/fulfillment.OrderDTO/page.mdx)","description":"The draft order to validate.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The version of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"The order's display ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[OrderStatus](../../../fulfillment/types/fulfillment.OrderStatus/page.mdx)","description":"The status of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_subtotal","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_tax_total","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_tax_total","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"nLine truncated