chore(docs): Generated References (automated) (#14182)

Generated the following references:
- `api_key_models`
- `auth_models`
- `cart_models`
- `core_flows`
- `currency_models`
- `customer_models`
- `file`
- `file_service`
- `fulfillment`
- `fulfillment_models`
- `helper_steps`
- `inventory_next_models`
- `js_sdk`
- `module_events`
- `modules`
- `notification`
- `notification_service`
- `order`
- `order_models`
- `payment`
- `payment_models`
- `pricing_models`
- `product_models`
- `promotion`
- `promotion_models`
- `region_models`
- `sales_channel_models`
- `stock_location_next_models`
- `store_models`
- `tax_models`
- `types`
- `user_models`
- `utils`
- `workflows`


---

> [!NOTE]
> Regenerates documentation references with updated schemas/fields and source links, adds locking guidance to fulfillment delivery workflow, expands notification step IO, and tweaks examples/sample values.
> 
> - **Docs Generation**:
>   - Regenerated reference pages across `core_flows`, `fulfillment`, `inventory`, `order`, etc., with updated TypeList schemas and examples.
> - **Fulfillment Workflows/Steps**:
>   - Updated IO schemas (e.g., added `custom_display_id` on `OrderDTO`, `carry_over_promotions` on `OrderChangeDTO`).
>   - Added locking guidance and workflow steps (`acquireLockStep`/`releaseLockStep`) to `markFulfillmentAsDeliveredWorkflow` plus new note/tag.
>   - Refreshed example snippets and sample values.
> - **Notification Step** (`sendNotificationsStep`):
>   - Input expanded with `from`, `content`, `provider_data`, `attachments`; `template` now optional.
>   - Output includes `provider_data` and `attachments` fields.
> - **Order Steps/Workflows**:
>   - IO schemas updated to include `custom_display_id` and `carry_over_promotions` where applicable; added `ordering` on change actions.
>   - Example payloads adjusted (IDs, currencies, amounts).
> - **Meta**:
>   - Updated `<SourceCodeLink>` URLs to new commit hashes throughout.
> 
> <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit eeb0dac7b19d51860531a491208b2b3b853aa4db. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup>


Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2025-12-02 06:59:52 +00:00
1 parent aba10608ae
commit 21f61ec160
983 files changed
+663541 -639365

No files matched your search

File diff suppressed because it is too large. Load diff
@@ -3559,6 +3559,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.cancelDraftOrderEditWorkflow/page.mdx",
"pathname": "/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.cancelDraftOrderEditWorkflow"
},
{
"filePath": "/www/apps/resources/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.computeDraftOrderAdjustmentsWorkflow/page.mdx",
"pathname": "/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.computeDraftOrderAdjustmentsWorkflow"
},
{
"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"
@@ -3639,6 +3643,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/core_flows/Draft_Order/Workflows_Draft_Order/variables/core_flows.Draft_Order.Workflows_Draft_Order.cancelDraftOrderEditWorkflowId/page.mdx",
"pathname": "/references/core_flows/Draft_Order/Workflows_Draft_Order/variables/core_flows.Draft_Order.Workflows_Draft_Order.cancelDraftOrderEditWorkflowId"
},
{
"filePath": "/www/apps/resources/references/core_flows/Draft_Order/Workflows_Draft_Order/variables/core_flows.Draft_Order.Workflows_Draft_Order.computeDraftOrderAdjustmentsWorkflowId/page.mdx",
"pathname": "/references/core_flows/Draft_Order/Workflows_Draft_Order/variables/core_flows.Draft_Order.Workflows_Draft_Order.computeDraftOrderAdjustmentsWorkflowId"
},
{
"filePath": "/www/apps/resources/references/core_flows/Draft_Order/Workflows_Draft_Order/variables/core_flows.Draft_Order.Workflows_Draft_Order.confirmDraftOrderEditWorkflowId/page.mdx",
"pathname": "/references/core_flows/Draft_Order/Workflows_Draft_Order/variables/core_flows.Draft_Order.Workflows_Draft_Order.confirmDraftOrderEditWorkflowId"
@@ -4483,6 +4491,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/core_flows/Order/Steps_Order/functions/core_flows.Order.Steps_Order.deleteReturnsStep/page.mdx",
"pathname": "/references/core_flows/Order/Steps_Order/functions/core_flows.Order.Steps_Order.deleteReturnsStep"
},
{
"filePath": "/www/apps/resources/references/core_flows/Order/Steps_Order/functions/core_flows.Order.Steps_Order.listOrderChangeActionsByTypeStep/page.mdx",
"pathname": "/references/core_flows/Order/Steps_Order/functions/core_flows.Order.Steps_Order.listOrderChangeActionsByTypeStep"
},
{
"filePath": "/www/apps/resources/references/core_flows/Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx",
"pathname": "/references/core_flows/Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep"
@@ -4819,6 +4831,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.completeOrderWorkflow/page.mdx",
"pathname": "/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.completeOrderWorkflow"
},
{
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.computeAdjustmentsForPreviewWorkflow/page.mdx",
"pathname": "/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.computeAdjustmentsForPreviewWorkflow"
},
{
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.confirmClaimRequestValidationStep/page.mdx",
"pathname": "/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.confirmClaimRequestValidationStep"
@@ -5011,6 +5027,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.maybeRefreshShippingMethodsWorkflow/page.mdx",
"pathname": "/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.maybeRefreshShippingMethodsWorkflow"
},
{
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.onCarryPromotionsFlagSet/page.mdx",
"pathname": "/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.onCarryPromotionsFlagSet"
},
{
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.orderClaimAddNewItemValidationStep/page.mdx",
"pathname": "/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.orderClaimAddNewItemValidationStep"
@@ -5235,6 +5255,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateOrderChangeActionsWorkflow/page.mdx",
"pathname": "/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateOrderChangeActionsWorkflow"
},
{
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateOrderChangeWorkflow/page.mdx",
"pathname": "/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateOrderChangeWorkflow"
},
{
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateOrderChangesWorkflow/page.mdx",
"pathname": "/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateOrderChangesWorkflow"
@@ -5307,6 +5331,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateReturnWorkflow/page.mdx",
"pathname": "/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateReturnWorkflow"
},
{
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.validateCarryPromotionsFlagStep/page.mdx",
"pathname": "/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.validateCarryPromotionsFlagStep"
},
{
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.validateOrderCreditLinesStep/page.mdx",
"pathname": "/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.validateOrderCreditLinesStep"
@@ -5395,6 +5423,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/variables/core_flows.Order.Workflows_Order.completeOrderWorkflowId/page.mdx",
"pathname": "/references/core_flows/Order/Workflows_Order/variables/core_flows.Order.Workflows_Order.completeOrderWorkflowId"
},
{
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/variables/core_flows.Order.Workflows_Order.computeAdjustmentsForPreviewWorkflowId/page.mdx",
"pathname": "/references/core_flows/Order/Workflows_Order/variables/core_flows.Order.Workflows_Order.computeAdjustmentsForPreviewWorkflowId"
},
{
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/variables/core_flows.Order.Workflows_Order.confirmClaimRequestWorkflowId/page.mdx",
"pathname": "/references/core_flows/Order/Workflows_Order/variables/core_flows.Order.Workflows_Order.confirmClaimRequestWorkflowId"
@@ -5519,6 +5551,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/variables/core_flows.Order.Workflows_Order.maybeRefreshShippingMethodsWorkflowId/page.mdx",
"pathname": "/references/core_flows/Order/Workflows_Order/variables/core_flows.Order.Workflows_Order.maybeRefreshShippingMethodsWorkflowId"
},
{
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/variables/core_flows.Order.Workflows_Order.onCarryPromotionsFlagSetId/page.mdx",
"pathname": "/references/core_flows/Order/Workflows_Order/variables/core_flows.Order.Workflows_Order.onCarryPromotionsFlagSetId"
},
{
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/variables/core_flows.Order.Workflows_Order.orderClaimAddNewItemWorkflowId/page.mdx",
"pathname": "/references/core_flows/Order/Workflows_Order/variables/core_flows.Order.Workflows_Order.orderClaimAddNewItemWorkflowId"
@@ -5635,6 +5671,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/variables/core_flows.Order.Workflows_Order.updateOrderChangeActionsWorkflowId/page.mdx",
"pathname": "/references/core_flows/Order/Workflows_Order/variables/core_flows.Order.Workflows_Order.updateOrderChangeActionsWorkflowId"
},
{
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/variables/core_flows.Order.Workflows_Order.updateOrderChangeWorkflowId/page.mdx",
"pathname": "/references/core_flows/Order/Workflows_Order/variables/core_flows.Order.Workflows_Order.updateOrderChangeWorkflowId"
},
{
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/variables/core_flows.Order.Workflows_Order.updateOrderChangesWorkflowId/page.mdx",
"pathname": "/references/core_flows/Order/Workflows_Order/variables/core_flows.Order.Workflows_Order.updateOrderChangesWorkflowId"
@@ -7899,6 +7939,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/core_flows/interfaces/core_flows.CancelDraftOrderEditWorkflowInput/page.mdx",
"pathname": "/references/core_flows/interfaces/core_flows.CancelDraftOrderEditWorkflowInput"
},
{
"filePath": "/www/apps/resources/references/core_flows/interfaces/core_flows.ComputeDraftOrderAdjustmentsWorkflowInput/page.mdx",
"pathname": "/references/core_flows/interfaces/core_flows.ComputeDraftOrderAdjustmentsWorkflowInput"
},
{
"filePath": "/www/apps/resources/references/core_flows/interfaces/core_flows.ConfirmDraftOrderEditWorkflowInput/page.mdx",
"pathname": "/references/core_flows/interfaces/core_flows.ConfirmDraftOrderEditWorkflowInput"
@@ -8399,6 +8443,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/core_flows/types/core_flows.CompleteOrdersWorkflowInput/page.mdx",
"pathname": "/references/core_flows/types/core_flows.CompleteOrdersWorkflowInput"
},
{
"filePath": "/www/apps/resources/references/core_flows/types/core_flows.ComputeAdjustmentsForPreviewWorkflowInput/page.mdx",
"pathname": "/references/core_flows/types/core_flows.ComputeAdjustmentsForPreviewWorkflowInput"
},
{
"filePath": "/www/apps/resources/references/core_flows/types/core_flows.ConfirmClaimRequestValidationStepInput/page.mdx",
"pathname": "/references/core_flows/types/core_flows.ConfirmClaimRequestValidationStepInput"
@@ -9223,6 +9271,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/core_flows/types/core_flows.NotifyOnFailureStepInput/page.mdx",
"pathname": "/references/core_flows/types/core_flows.NotifyOnFailureStepInput"
},
{
"filePath": "/www/apps/resources/references/core_flows/types/core_flows.OnCarryPromotionsFlagSetWorkflowInput/page.mdx",
"pathname": "/references/core_flows/types/core_flows.OnCarryPromotionsFlagSetWorkflowInput"
},
{
"filePath": "/www/apps/resources/references/core_flows/types/core_flows.OrderAddLineItemWorkflowOutput/page.mdx",
"pathname": "/references/core_flows/types/core_flows.OrderAddLineItemWorkflowOutput"
@@ -12907,6 +12959,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/js_sdk/admin/Order/methods/js_sdk.admin.Order.update/page.mdx",
"pathname": "/references/js_sdk/admin/Order/methods/js_sdk.admin.Order.update"
},
{
"filePath": "/www/apps/resources/references/js_sdk/admin/Order/methods/js_sdk.admin.Order.updateOrderChange/page.mdx",
"pathname": "/references/js_sdk/admin/Order/methods/js_sdk.admin.Order.updateOrderChange"
},
{
"filePath": "/www/apps/resources/references/js_sdk/admin/Order/properties/js_sdk.admin.Order.client/page.mdx",
"pathname": "/references/js_sdk/admin/Order/properties/js_sdk.admin.Order.client"
@@ -17875,6 +17931,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/promotion/interfaces/promotion.PromotionDTO/page.mdx",
"pathname": "/references/promotion/interfaces/promotion.PromotionDTO"
},
{
"filePath": "/www/apps/resources/references/promotion/interfaces/promotion.PromotionLimitExceededAction/page.mdx",
"pathname": "/references/promotion/interfaces/promotion.PromotionLimitExceededAction"
},
{
"filePath": "/www/apps/resources/references/promotion/interfaces/promotion.PromotionRuleDTO/page.mdx",
"pathname": "/references/promotion/interfaces/promotion.PromotionRuleDTO"
@@ -20775,6 +20835,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminOrderChangeAction/page.mdx",
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminOrderChangeAction"
},
{
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminOrderChangeResponse/page.mdx",
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminOrderChangeResponse"
},
{
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminOrderChangesFilters/page.mdx",
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminOrderChangesFilters"
@@ -21539,6 +21603,10 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateOrder/page.mdx",
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateOrder"
},
{
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateOrderChange/page.mdx",
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateOrderChange"
},
{
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateOrderEditItem/page.mdx",
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateOrderEditItem"
@@ -1266,6 +1266,15 @@ const generatedgeneratedReferencesSidebarSidebar = {
"description": "Cancel a draft order edit.",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/references/medusa-workflows/computeDraftOrderAdjustmentsWorkflow",
"title": "computeDraftOrderAdjustmentsWorkflow",
"description": "Refresh the promotions in a draft order.",
"children": []
},
{
"loaded": true,
"isPathHref": true,
@@ -2504,6 +2513,15 @@ const generatedgeneratedReferencesSidebarSidebar = {
"description": "Complete one or more orders.",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/references/medusa-workflows/computeAdjustmentsForPreviewWorkflow",
"title": "computeAdjustmentsForPreviewWorkflow",
"description": "Compute adjustments for an order edit, exchange, claim, or return.",
"children": []
},
{
"loaded": true,
"isPathHref": true,
@@ -3026,6 +3044,15 @@ const generatedgeneratedReferencesSidebarSidebar = {
"description": "Update one or more order change actions.",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/references/medusa-workflows/updateOrderChangeWorkflow",
"title": "updateOrderChangeWorkflow",
"description": "Update an order change.",
"children": []
},
{
"loaded": true,
"isPathHref": true,
@@ -3358,6 +3385,15 @@ const generatedgeneratedReferencesSidebarSidebar = {
"description": "",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/references/medusa-workflows/steps/listOrderChangeActionsByTypeStep",
"title": "listOrderChangeActionsByTypeStep",
"description": "",
"children": []
},
{
"loaded": true,
"isPathHref": true,
@@ -3781,6 +3817,15 @@ const generatedgeneratedReferencesSidebarSidebar = {
"description": "Mark a payment collection for an order as paid.",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/references/medusa-workflows/onCarryPromotionsFlagSet",
"title": "onCarryPromotionsFlagSet",
"description": "Toggle carrying over promotions to outbound exchange items.",
"children": []
},
{
"loaded": true,
"isPathHref": true,
@@ -4105,6 +4150,15 @@ const generatedgeneratedReferencesSidebarSidebar = {
"description": "",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/references/medusa-workflows/validateCarryPromotionsFlagStep",
"title": "validateCarryPromotionsFlagStep",
"description": "",
"children": []
},
{
"loaded": true,
"isPathHref": true,
@@ -1084,6 +1084,11 @@ export const slugChanges = [
"newSlug": "/references/medusa-workflows/cancelDraftOrderEditWorkflow",
"filePath": "/www/apps/resources/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.cancelDraftOrderEditWorkflow/page.mdx"
},
{
"origSlug": "/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.computeDraftOrderAdjustmentsWorkflow",
"newSlug": "/references/medusa-workflows/computeDraftOrderAdjustmentsWorkflow",
"filePath": "/www/apps/resources/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.computeDraftOrderAdjustmentsWorkflow/page.mdx"
},
{
"origSlug": "/references/core_flows/Draft_Order/Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.confirmDraftOrderEditWorkflow",
"newSlug": "/references/medusa-workflows/confirmDraftOrderEditWorkflow",
@@ -1689,6 +1694,11 @@ export const slugChanges = [
"newSlug": "/references/medusa-workflows/steps/deleteReturnsStep",
"filePath": "/www/apps/resources/references/core_flows/Order/Steps_Order/functions/core_flows.Order.Steps_Order.deleteReturnsStep/page.mdx"
},
{
"origSlug": "/references/core_flows/Order/Steps_Order/functions/core_flows.Order.Steps_Order.listOrderChangeActionsByTypeStep",
"newSlug": "/references/medusa-workflows/steps/listOrderChangeActionsByTypeStep",
"filePath": "/www/apps/resources/references/core_flows/Order/Steps_Order/functions/core_flows.Order.Steps_Order.listOrderChangeActionsByTypeStep/page.mdx"
},
{
"origSlug": "/references/core_flows/Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep",
"newSlug": "/references/medusa-workflows/steps/previewOrderChangeStep",
@@ -1939,6 +1949,11 @@ export const slugChanges = [
"newSlug": "/references/medusa-workflows/completeOrderWorkflow",
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.completeOrderWorkflow/page.mdx"
},
{
"origSlug": "/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.computeAdjustmentsForPreviewWorkflow",
"newSlug": "/references/medusa-workflows/computeAdjustmentsForPreviewWorkflow",
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.computeAdjustmentsForPreviewWorkflow/page.mdx"
},
{
"origSlug": "/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.confirmClaimRequestValidationStep",
"newSlug": "/references/medusa-workflows/confirmClaimRequestValidationStep",
@@ -2179,6 +2194,11 @@ export const slugChanges = [
"newSlug": "/references/medusa-workflows/maybeRefreshShippingMethodsWorkflow",
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.maybeRefreshShippingMethodsWorkflow/page.mdx"
},
{
"origSlug": "/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.onCarryPromotionsFlagSet",
"newSlug": "/references/medusa-workflows/onCarryPromotionsFlagSet",
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.onCarryPromotionsFlagSet/page.mdx"
},
{
"origSlug": "/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.orderClaimAddNewItemValidationStep",
"newSlug": "/references/medusa-workflows/orderClaimAddNewItemValidationStep",
@@ -2459,6 +2479,11 @@ export const slugChanges = [
"newSlug": "/references/medusa-workflows/updateOrderChangeActionsWorkflow",
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateOrderChangeActionsWorkflow/page.mdx"
},
{
"origSlug": "/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateOrderChangeWorkflow",
"newSlug": "/references/medusa-workflows/updateOrderChangeWorkflow",
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateOrderChangeWorkflow/page.mdx"
},
{
"origSlug": "/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateOrderChangesWorkflow",
"newSlug": "/references/medusa-workflows/updateOrderChangesWorkflow",
@@ -2549,6 +2574,11 @@ export const slugChanges = [
"newSlug": "/references/medusa-workflows/updateReturnWorkflow",
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateReturnWorkflow/page.mdx"
},
{
"origSlug": "/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.validateCarryPromotionsFlagStep",
"newSlug": "/references/medusa-workflows/validateCarryPromotionsFlagStep",
"filePath": "/www/apps/resources/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.validateCarryPromotionsFlagStep/page.mdx"
},
{
"origSlug": "/references/core_flows/Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.validateOrderCreditLinesStep",
"newSlug": "/references/medusa-workflows/validateOrderCreditLinesStep",
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
This documentation provides a reference to the ApiKey data model. It belongs to the API Key Module.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/modules/api-key/src/models/api-key.ts#L3" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/modules/api-key/src/models/api-key.ts#L3" />
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"token","type":"`TextProperty`","description":"The token of the API key","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"salt","type":"`TextProperty`","description":"Salt used to create the API key token.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"redacted","type":"`TextProperty`","description":"The redacted form of the api key's token. this is useful when showing portion of the token.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`TextProperty`","description":"The title of the API key","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"EnumProperty&#60;[\"publishable\", \"secret\"]&#62;","description":"The type of the API key. Can be `secret` or `publishable`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`TextProperty`","description":"The ID of the user that created the API key","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_used_at","type":"`DateTimeProperty`","description":"The date the API key was last used.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"revoked_by","type":"`TextProperty`","description":"The ID of the user that revoked the API key","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"revoked_at","type":"`DateTimeProperty`","description":"The date the API key was revoked.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="ApiKey"/>
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
This documentation provides a reference to the AuthIdentity data model. It belongs to the Auth Module.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/modules/auth/src/models/auth-identity.ts#L4" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/modules/auth/src/models/auth-identity.ts#L4" />
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the auth identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_identities","type":"HasMany&#60;[ProviderIdentity](../auth_models.ProviderIdentity/page.mdx)&#62;","description":"The associated `ProviderIdentity` records.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the provider identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"entity_id","type":"`TextProperty`","description":"The entity ID of the provider identity","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider","type":"`TextProperty`","description":"The ID of the provider that created this identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"auth_identity","type":"BelongsTo&#60;[AuthIdentity](./page.mdx)&#62;","description":"The associated `AuthIdentity`.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the auth identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_identities","type":"HasMany&#60;[ProviderIdentity](../auth_models.ProviderIdentity/page.mdx)&#62;","description":"The associated `ProviderIdentity` records.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"app_metadata","type":"`JSONProperty`","description":"The app metadata of the auth identity","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"user_metadata","type":"`JSONProperty`","description":"The user metadata of the provider identity.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`JSONProperty`","description":"The provider metadata of the provider identity.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"app_metadata","type":"`JSONProperty`","description":"The app metadata of the auth identity","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="AuthIdentity"/>
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
This documentation provides a reference to the ProviderIdentity data model. It belongs to the Auth Module.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/modules/auth/src/models/provider-identity.ts#L4" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/modules/auth/src/models/provider-identity.ts#L4" />
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the provider identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"entity_id","type":"`TextProperty`","description":"The entity ID of the provider identity","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider","type":"`TextProperty`","description":"The ID of the provider that created this identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"auth_identity","type":"BelongsTo&#60;[AuthIdentity](../auth_models.AuthIdentity/page.mdx)&#62;","description":"The associated `AuthIdentity`.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the auth identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_identities","type":"HasMany&#60;[ProviderIdentity](./page.mdx)&#62;","description":"The associated `ProviderIdentity` records.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the provider identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"entity_id","type":"`TextProperty`","description":"The entity ID of the provider identity","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider","type":"`TextProperty`","description":"The ID of the provider that created this identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"auth_identity","type":"BelongsTo&#60;[AuthIdentity](../auth_models.AuthIdentity/page.mdx)&#62;","description":"The associated `AuthIdentity`.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"user_metadata","type":"`JSONProperty`","description":"The user metadata of the provider identity.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`JSONProperty`","description":"The provider metadata of the provider identity.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"app_metadata","type":"`JSONProperty`","description":"The app metadata of the auth identity","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"user_metadata","type":"`JSONProperty`","description":"The user metadata of the provider identity.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`JSONProperty`","description":"The provider metadata of the provider identity.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="ProviderIdentity"/>
@@ -19,7 +19,7 @@ In this document, you’ll learn about the different methods in the Cache Module
:::note[Deprecation Notice]
The Cache Module is deprecated starting from [Medusa v2.11.0](https://github.com/medusajs/medusa/releases/tag/v2.11.0). [Use the Caching Module](#) instead.
The Cache Module is deprecated starting from [Medusa v2.11.0](https://github.com/medusajs/medusa/releases/tag/v2.11.0). [Use the Caching Module](https://docs.medusajs.com/resources/infrastructure-modules/caching) instead.
:::
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
This documentation provides a reference to the Address data model. It belongs to the Cart Module.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/modules/cart/src/models/address.ts#L3" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/modules/cart/src/models/address.ts#L3" />
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`TextProperty`","description":"The ID of the customer that the address belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`TextProperty`","description":"The company of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`TextProperty`","description":"The first name of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`TextProperty`","description":"The last name of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`TextProperty`","description":"The first line of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`TextProperty`","description":"The second line of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`TextProperty`","description":"The city of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`TextProperty`","description":"The ISO 2 country code of the address. For example, `us`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`TextProperty`","description":"The province of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`TextProperty`","description":"The postal code of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`TextProperty`","description":"The phone of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`JSONProperty`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="Address"/>
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
This documentation provides a reference to the Cart data model. It belongs to the Cart Module.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/modules/cart/src/models/cart.ts#L7" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/modules/cart/src/models/cart.ts#L7" />
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`TextProperty`","description":"The ISO 3 currency code of the cart, such as `usd`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"HasMany&#60;[LineItem](../cart_models.LineItem/page.mdx)&#62;","description":"The associated items.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`TextProperty`","description":"The title of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`NumberProperty`","description":"The quantity of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`BooleanProperty`","description":"Whether the line item requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_discountable","type":"`BooleanProperty`","description":"Whether the line item is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`BooleanProperty`","description":"Whether the line item is a giftcard.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item's price is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_custom_price","type":"`BooleanProperty`","description":"Whether the line item's price is custom.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"unit_price","type":"`BigNumberProperty`","description":"The unit price of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustments","type":"HasMany&#60;[LineItemAdjustment](../cart_models.LineItemAdjustment/page.mdx)&#62;","description":"The associated adjustments.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the line item adjustment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`BigNumberProperty`","description":"The amount of the line item adjustment","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item adjustment is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item","type":"BelongsTo&#60;[LineItem](../cart_models.LineItem/page.mdx)&#62;","description":"The associated line item.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"description","type":"`TextProperty`","description":"The description of the line item adjustment","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`TextProperty`","description":"The code of promotion that applied the adjustment","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`TextProperty`","description":"The ID of the external provider that the adjustment is related to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion_id","type":"`TextProperty`","description":"The ID of the applied promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`JSONProperty`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"tax_lines","type":"HasMany&#60;[LineItemTaxLine](../cart_models.LineItemTaxLine/page.mdx)&#62;","description":"The associated tax\\_lines.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the line item tax line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`TextProperty`","description":"The code of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rate","type":"`FloatProperty`","description":"The rate of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item","type":"BelongsTo&#60;[LineItem](../cart_models.LineItem/page.mdx)&#62;","description":"The associated line item.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"description","type":"`TextProperty`","description":"The description of the line item tax line","optional":true,"defaultValue":"","expandableLine truncated
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
This documentation provides a reference to the CreditLine data model. It belongs to the Cart Module.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/modules/cart/src/models/credit-line.ts#L4" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/modules/cart/src/models/credit-line.ts#L4" />
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the credit line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"cart","type":"BelongsTo&#60;[Cart](../cart_models.Cart/page.mdx)&#62;","description":"The associated cart.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`TextProperty`","description":"The ISO 3 currency code of the cart, such as `usd`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"HasMany&#60;[LineItem](../cart_models.LineItem/page.mdx)&#62;","description":"The associated items.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`TextProperty`","description":"The title of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`NumberProperty`","description":"The quantity of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`BooleanProperty`","description":"Whether the line item requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_discountable","type":"`BooleanProperty`","description":"Whether the line item is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`BooleanProperty`","description":"Whether the line item is a giftcard.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item's price is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_custom_price","type":"`BooleanProperty`","description":"Whether the line item's price is custom.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"unit_price","type":"`BigNumberProperty`","description":"The unit price of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustments","type":"HasMany&#60;[LineItemAdjustment](../cart_models.LineItemAdjustment/page.mdx)&#62;","description":"The associated adjustments.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"tax_lines","type":"HasMany&#60;[LineItemTaxLine](../cart_models.LineItemTaxLine/page.mdx)&#62;","description":"The associated tax\\_lines.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"cart","type":"BelongsTo&#60;[Cart](../cart_models.Cart/page.mdx)&#62;","description":"The associated cart.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"subtitle","type":"`TextProperty`","description":"The subtitle of the line item","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`TextProperty`","description":"The thumbnail URL of the line item","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_id","type":"`TextProperty`","description":"The ID of the variant added to the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`TextProperty`","description":"The ID of the product added to the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_title","type":"`TextProperty`","description":"The title of the line item's product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_description","type":"`TextProperty`","description":"The description of the line item's product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_subtitle","type":"`TextProperty`","description":"The subtitle of the line item's product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_type","type":"`TextProperty`","description":"The type of the line item's product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_type_id","type":"`TextProperty`","description":"The ID of the type of the line item's product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_collection","type":"`TextProperty`","description":"The collection of the line item's product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_handle","type":"`TextProperty`","description":"The unique handle of the line item's product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_sku","tLine truncated
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
This documentation provides a reference to the LineItem data model. It belongs to the Cart Module.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/modules/cart/src/models/line-item.ts#L6" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/modules/cart/src/models/line-item.ts#L6" />
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`TextProperty`","description":"The title of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`NumberProperty`","description":"The quantity of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`BooleanProperty`","description":"Whether the line item requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_discountable","type":"`BooleanProperty`","description":"Whether the line item is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`BooleanProperty`","description":"Whether the line item is a giftcard.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item's price is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_custom_price","type":"`BooleanProperty`","description":"Whether the line item's price is custom.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"unit_price","type":"`BigNumberProperty`","description":"The unit price of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustments","type":"HasMany&#60;[LineItemAdjustment](../cart_models.LineItemAdjustment/page.mdx)&#62;","description":"The associated adjustments.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the line item adjustment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`BigNumberProperty`","description":"The amount of the line item adjustment","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item adjustment is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item","type":"BelongsTo&#60;[LineItem](./page.mdx)&#62;","description":"The associated line item.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`TextProperty`","description":"The title of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`NumberProperty`","description":"The quantity of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`BooleanProperty`","description":"Whether the line item requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_discountable","type":"`BooleanProperty`","description":"Whether the line item is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`BooleanProperty`","description":"Whether the line item is a giftcard.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item's price is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_custom_price","type":"`BooleanProperty`","description":"Whether the line item's price is custom.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"unit_price","type":"`BigNumberProperty`","description":"The unit price of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustments","type":"HasMany&#60;[LineItemAdjustment](../cart_models.LineItemAdjustment/page.mdx)&#62;","description":"The associated adjustments.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"tax_lines","type":"HasMany&#60;[LineItemTaxLine](../cart_models.LineItemTaxLine/page.mdx)&#62;","description":"The associated tax\\_lines.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"cart","type":"BelongsTo&#60;[Cart](../cart_models.Cart/page.mdx)&#62;","description":"The associated cart.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"subtitle","type":"`TextProperty`","description":"The subtitle of the line item","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`TextProperty`","description":"The thumbnail URL of the line item","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name"Line truncated
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
This documentation provides a reference to the LineItemAdjustment data model. It belongs to the Cart Module.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/modules/cart/src/models/line-item-adjustment.ts#L4" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/modules/cart/src/models/line-item-adjustment.ts#L4" />
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the line item adjustment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`BigNumberProperty`","description":"The amount of the line item adjustment","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item adjustment is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item","type":"BelongsTo&#60;[LineItem](../cart_models.LineItem/page.mdx)&#62;","description":"The associated line item.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`TextProperty`","description":"The title of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`NumberProperty`","description":"The quantity of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`BooleanProperty`","description":"Whether the line item requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_discountable","type":"`BooleanProperty`","description":"Whether the line item is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`BooleanProperty`","description":"Whether the line item is a giftcard.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item's price is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_custom_price","type":"`BooleanProperty`","description":"Whether the line item's price is custom.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"unit_price","type":"`BigNumberProperty`","description":"The unit price of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustments","type":"HasMany&#60;[LineItemAdjustment](./page.mdx)&#62;","description":"The associated adjustments.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the line item adjustment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`BigNumberProperty`","description":"The amount of the line item adjustment","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item adjustment is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item","type":"BelongsTo&#60;[LineItem](../cart_models.LineItem/page.mdx)&#62;","description":"The associated line item.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"description","type":"`TextProperty`","description":"The description of the line item adjustment","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`TextProperty`","description":"The code of promotion that applied the adjustment","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`TextProperty`","description":"The ID of the external provider that the adjustment is related to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion_id","type":"`TextProperty`","description":"The ID of the applied promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`JSONProperty`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"tax_lines","type":"HasMany&#60;[LineItemTaxLine](../cart_models.LineItemTaxLine/page.mdx)&#62;","description":"The associated tax\\_lines.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the line item tax line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`TextProperty`","description":"The code of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rate","type":"`FloatProperty`","description":"The rate of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item","type":"BelongsTo&#60;[LineItem](../cart_models.LineItem/page.mdx)&#62;","description":"The associated line item.","optional":false,"defaultValue":"","expandable":true,Line truncated
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
This documentation provides a reference to the LineItemTaxLine data model. It belongs to the Cart Module.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/modules/cart/src/models/line-item-tax-line.ts#L4" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/modules/cart/src/models/line-item-tax-line.ts#L4" />
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the line item tax line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`TextProperty`","description":"The code of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rate","type":"`FloatProperty`","description":"The rate of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item","type":"BelongsTo&#60;[LineItem](../cart_models.LineItem/page.mdx)&#62;","description":"The associated line item.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`TextProperty`","description":"The title of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`NumberProperty`","description":"The quantity of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`BooleanProperty`","description":"Whether the line item requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_discountable","type":"`BooleanProperty`","description":"Whether the line item is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`BooleanProperty`","description":"Whether the line item is a giftcard.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item's price is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_custom_price","type":"`BooleanProperty`","description":"Whether the line item's price is custom.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"unit_price","type":"`BigNumberProperty`","description":"The unit price of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustments","type":"HasMany&#60;[LineItemAdjustment](../cart_models.LineItemAdjustment/page.mdx)&#62;","description":"The associated adjustments.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the line item adjustment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`BigNumberProperty`","description":"The amount of the line item adjustment","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item adjustment is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item","type":"BelongsTo&#60;[LineItem](../cart_models.LineItem/page.mdx)&#62;","description":"The associated line item.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"description","type":"`TextProperty`","description":"The description of the line item adjustment","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`TextProperty`","description":"The code of promotion that applied the adjustment","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`TextProperty`","description":"The ID of the external provider that the adjustment is related to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion_id","type":"`TextProperty`","description":"The ID of the applied promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`JSONProperty`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"tax_lines","type":"HasMany&#60;[LineItemTaxLine](./page.mdx)&#62;","description":"The associated tax\\_lines.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the line item tax line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`TextProperty`","description":"The code of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rate","type":"`FloatProperty`","description":"The rate of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item","type":"BelongsTo&#60;[LineItem](../cart_models.LineItem/page.mdx)&#62;","description":"The associated line item.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"description","typeLine truncated
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
This documentation provides a reference to the ShippingMethod data model. It belongs to the Cart Module.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/modules/cart/src/models/shipping-method.ts#L6" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/modules/cart/src/models/shipping-method.ts#L6" />
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`TextProperty`","description":"The name of the shipping method","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`BigNumberProperty`","description":"The amount of the shipping method","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the shipping method's amount is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"cart","type":"BelongsTo&#60;[Cart](../cart_models.Cart/page.mdx)&#62;","description":"The associated cart.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`TextProperty`","description":"The ISO 3 currency code of the cart, such as `usd`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"HasMany&#60;[LineItem](../cart_models.LineItem/page.mdx)&#62;","description":"The associated items.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`TextProperty`","description":"The title of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`NumberProperty`","description":"The quantity of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`BooleanProperty`","description":"Whether the line item requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_discountable","type":"`BooleanProperty`","description":"Whether the line item is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`BooleanProperty`","description":"Whether the line item is a giftcard.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item's price is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_custom_price","type":"`BooleanProperty`","description":"Whether the line item's price is custom.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"unit_price","type":"`BigNumberProperty`","description":"The unit price of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustments","type":"HasMany&#60;[LineItemAdjustment](../cart_models.LineItemAdjustment/page.mdx)&#62;","description":"The associated adjustments.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"tax_lines","type":"HasMany&#60;[LineItemTaxLine](../cart_models.LineItemTaxLine/page.mdx)&#62;","description":"The associated tax\\_lines.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"cart","type":"BelongsTo&#60;[Cart](../cart_models.Cart/page.mdx)&#62;","description":"The associated cart.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"subtitle","type":"`TextProperty`","description":"The subtitle of the line item","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`TextProperty`","description":"The thumbnail URL of the line item","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_id","type":"`TextProperty`","description":"The ID of the variant added to the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`TextProperty`","description":"The ID of the product added to the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_title","type":"`TextProperty`","description":"The title of the line item's product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_description","type":"`TextProperty`","description":"The description of the line item's product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_subtitle","type":"`TextProperty`","description":"The subtitle of the line item's product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_type","type":"`TextProperty`","description":"The type of the line item's product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_type_id","type":"`TextProLine truncated
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
This documentation provides a reference to the ShippingMethodAdjustment data model. It belongs to the Cart Module.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/modules/cart/src/models/shipping-method-adjustment.ts#L4" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/modules/cart/src/models/shipping-method-adjustment.ts#L4" />
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the shipping method adjustment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`BigNumberProperty`","description":"The shipping method adjustment's amount","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_method","type":"BelongsTo&#60;[ShippingMethod](../cart_models.ShippingMethod/page.mdx)&#62;","description":"The associated shipping\\_method.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`TextProperty`","description":"The name of the shipping method","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`BigNumberProperty`","description":"The amount of the shipping method","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the shipping method's amount is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"cart","type":"BelongsTo&#60;[Cart](../cart_models.Cart/page.mdx)&#62;","description":"The associated cart.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`TextProperty`","description":"The ISO 3 currency code of the cart, such as `usd`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"HasMany&#60;[LineItem](../cart_models.LineItem/page.mdx)&#62;","description":"The associated items.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"credit_lines","type":"HasMany&#60;[CreditLine](../cart_models.CreditLine/page.mdx)&#62;","description":"The associated credit\\_lines.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"shipping_methods","type":"HasMany&#60;[ShippingMethod](../cart_models.ShippingMethod/page.mdx)&#62;","description":"The associated shipping\\_methods.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"region_id","type":"`TextProperty`","description":"The ID of the cart's region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`TextProperty`","description":"The ID of the cart's customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`TextProperty`","description":"The ID of the cart's sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`TextProperty`","description":"The email of the cart's customer","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`JSONProperty`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"completed_at","type":"`DateTimeProperty`","description":"The date the cart was completed.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address","type":"HasOneWithForeignKey&#60;[Address](../cart_models.Address/page.mdx)&#62;","description":"The associated shipping\\_address.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"billing_address","type":"HasOneWithForeignKey&#60;[Address](../cart_models.Address/page.mdx)&#62;","description":"The associated billing\\_address.","optional":true,"defaultValue":"","expandable":true,"children":[]}]},{"name":"tax_lines","type":"HasMany&#60;[ShippingMethodTaxLine](../cart_models.ShippingMethodTaxLine/page.mdx)&#62;","description":"The associated tax\\_lines.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the shipping method tax line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`TextProperty`","description":"The code of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rate","type":"`FloatProperty`","description":"The rate of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_method","type":"BelongsTo&#60;[ShippingMethod](../cart_models.ShippingMethod/page.mdx)&#62;","description":"The associated shipping\\_method.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"description","type":"`TextProperty`","description":"The description of the shipping method tax line","optional":true,"defaultValue":"","Line truncated
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
This documentation provides a reference to the ShippingMethodTaxLine data model. It belongs to the Cart Module.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/modules/cart/src/models/shipping-method-tax-line.ts#L4" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/modules/cart/src/models/shipping-method-tax-line.ts#L4" />
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the shipping method tax line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`TextProperty`","description":"The code of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rate","type":"`FloatProperty`","description":"The rate of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_method","type":"BelongsTo&#60;[ShippingMethod](../cart_models.ShippingMethod/page.mdx)&#62;","description":"The associated shipping\\_method.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`TextProperty`","description":"The name of the shipping method","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`BigNumberProperty`","description":"The amount of the shipping method","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the shipping method's amount is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"cart","type":"BelongsTo&#60;[Cart](../cart_models.Cart/page.mdx)&#62;","description":"The associated cart.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`TextProperty`","description":"The ISO 3 currency code of the cart, such as `usd`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"HasMany&#60;[LineItem](../cart_models.LineItem/page.mdx)&#62;","description":"The associated items.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"credit_lines","type":"HasMany&#60;[CreditLine](../cart_models.CreditLine/page.mdx)&#62;","description":"The associated credit\\_lines.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"shipping_methods","type":"HasMany&#60;[ShippingMethod](../cart_models.ShippingMethod/page.mdx)&#62;","description":"The associated shipping\\_methods.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"region_id","type":"`TextProperty`","description":"The ID of the cart's region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`TextProperty`","description":"The ID of the cart's customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`TextProperty`","description":"The ID of the cart's sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`TextProperty`","description":"The email of the cart's customer","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`JSONProperty`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"completed_at","type":"`DateTimeProperty`","description":"The date the cart was completed.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address","type":"HasOneWithForeignKey&#60;[Address](../cart_models.Address/page.mdx)&#62;","description":"The associated shipping\\_address.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"billing_address","type":"HasOneWithForeignKey&#60;[Address](../cart_models.Address/page.mdx)&#62;","description":"The associated billing\\_address.","optional":true,"defaultValue":"","expandable":true,"children":[]}]},{"name":"tax_lines","type":"HasMany&#60;[ShippingMethodTaxLine](./page.mdx)&#62;","description":"The associated tax\\_lines.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier&#60;IdProperty&#62;","description":"The ID of the shipping method tax line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`TextProperty`","description":"The code of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rate","type":"`FloatProperty`","description":"The rate of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_method","type":"BelongsTo&#60;[ShippingMethod](../cart_models.ShippingMethod/page.mdx)&#62;","description":"The associated shipping\\_method.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"description","type":"`TextPLine truncated
@@ -19,7 +19,7 @@ This workflow creates one or more API keys, which can be secret or publishable.
You can use this workflow within your customizations or your own custom workflows, allowing you to
create API keys within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/api-key/workflows/create-api-keys.ts#L51" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/api-key/workflows/create-api-keys.ts#L51" />
## Examples
@@ -20,7 +20,7 @@ This workflow deletes one or more secret or publishable API keys. It's used by t
You can use this workflow within your customizations or your own custom workflows, allowing you to
delete API keys within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/api-key/workflows/delete-api-keys.ts#L36" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/api-key/workflows/delete-api-keys.ts#L36" />
## Examples
@@ -20,7 +20,7 @@ This workflow manages the sales channels of a publishable API key. It's used by
You can use this workflow within your customizations or your own custom workflows, allowing you to
manage the sales channels of a publishable API key within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/api-key/workflows/link-sales-channels-to-publishable-key.ts#L39" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/api-key/workflows/link-sales-channels-to-publishable-key.ts#L39" />
## Examples
@@ -21,7 +21,7 @@ This workflow is used by the [Revoke API Key API Route](https://docs.medusajs.co
You can use this workflow within your customizations or your own custom workflows, allowing you to
revoke API keys within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/api-key/workflows/revoke-api-keys.ts#L59" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/api-key/workflows/revoke-api-keys.ts#L59" />
## Examples
@@ -19,7 +19,7 @@ This workflow updates one or more secret or publishable API keys. It's used by t
You can use this workflow within your customizations or your own custom workflows, allowing you to
update API keys within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/api-key/workflows/update-api-keys.ts#L57" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/api-key/workflows/update-api-keys.ts#L57" />
## Examples
@@ -27,7 +27,7 @@ how to handle this event.
You can use this workflow within your customizations or your own custom workflows, allowing you to
generate reset password tokens within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/auth/workflows/generate-reset-password-token.ts#L43" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/auth/workflows/generate-reset-password-token.ts#L43" />
## Examples
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
"my-workflow",
() => {
const data = createCartsStep({
"currency_code": "bsd"
"currency_code": "lsl"
})
}
)
@@ -13,11 +13,11 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
This documentation provides a reference to the `getActionsToComputeFromPromotionsStep`. It belongs to the `@medusajs/medusa/core-flows` package.
This step retrieves the actions to compute based on the promotions
applied on a cart.
applied on items and shipping methods.
:::tip
You can use the [retrieveCartStep](../core_flows.Cart.Steps_Cart.retrieveCartStep/page.mdx) to retrieve a cart's details.
You can use the [retrieveCartStep](../core_flows.Cart.Steps_Cart.retrieveCartStep/page.mdx) to retrieve items and shipping methods' details.
:::
@@ -25,17 +25,17 @@ You can use the [retrieveCartStep](../core_flows.Cart.Steps_Cart.retrieveCartSte
```ts
const data = getActionsToComputeFromPromotionsStep({
// retrieve the details of the cart from another workflow
// retrieve the details of the items and shipping methods from another workflow
// or in another step using the Cart Module's service
cart,
computeActionContext,
promotionCodesToApply: ["10OFF"]
})
```
## Input
<TypeList types={[{"name":"GetActionsToComputeFromPromotionsStepInput","type":"[GetActionsToComputeFromPromotionsStepInput](../../../../interfaces/core_flows.GetActionsToComputeFromPromotionsStepInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the cart and its applied promotions.","expandable":false,"children":[{"name":"cart","type":"[CartDTO](../../../../../cart/interfaces/cart.CartDTO/page.mdx)","description":"The cart to compute the actions for.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the cart","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.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](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.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](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.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](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.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](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.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](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original total of the cart.","optional":false,"defLine truncated
<TypeList types={[{"name":"GetActionsToComputeFromPromotionsStepInput","type":"[GetActionsToComputeFromPromotionsStepInput](../../../../interfaces/core_flows.GetActionsToComputeFromPromotionsStepInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the items and shipping methods and its applied promotions.","expandable":false,"children":[{"name":"computeActionContext","type":"[ComputeActionContext](../../../../../promotion/interfaces/promotion.ComputeActionContext/page.mdx)","description":"The items and shipping methods to compute the actions for.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The cart's currency","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The cart's email","optional":true,"defaultValue":"","expandable":false,"children":[],"since":"2.11.0"},{"name":"items","type":"[ComputeActionItemLine](../../../../../promotion/interfaces/promotion.ComputeActionItemLine/page.mdx)[]","description":"The cart's line items.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"[BigNumberInput](../../../../../promotion/types/promotion.BigNumberInput/page.mdx)","description":"The quantity of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtotal","type":"[BigNumberInput](../../../../../promotion/types/promotion.BigNumberInput/page.mdx)","description":"The subtotal of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_total","type":"[BigNumberInput](../../../../../promotion/types/promotion.BigNumberInput/page.mdx)","description":"The total of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_discountable","type":"`boolean`","description":"Whether the line item is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustments","type":"[ComputeActionAdjustmentLine](../../../../../promotion/interfaces/promotion.ComputeActionAdjustmentLine/page.mdx)[]","description":"The adjustments applied before on the line item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`object`","description":"The product ID of the line item. Our default promotion rules rely on the product ID to apply the promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"shipping_methods","type":"[ComputeActionShippingLine](../../../../../promotion/interfaces/promotion.ComputeActionShippingLine/page.mdx)[]","description":"The cart's shipping methods.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtotal","type":"[BigNumberInput](../../../../../promotion/types/promotion.BigNumberInput/page.mdx)","description":"The subtotal of the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_total","type":"[BigNumberInput](../../../../../promotion/types/promotion.BigNumberInput/page.mdx)","description":"The total of the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustments","type":"[ComputeActionAdjustmentLine](../../../../../promotion/interfaces/promotion.ComputeActionAdjustmentLine/page.mdx)[]","description":"The adjustments applied before on the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"promotionCodesToApply","type":"`string`[]","description":"The promotion codes applied on the items and shipping methods.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`ComputeActionOptions`","description":"The options to configure how the actions are computed.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="getActionsToComputeFromPromotionsStep"/>
## Output
<TypeList types={[{"name":"(ComputeActions \\| object & AddItemAdjustmentAction & WorkflowDataProperties&#60;ComputeActions&#62; & object \\| never \\| never \\| never \\| never \\| never \\| object & RemoveItemAdjustmentAction & WorkflowDataProperties&#60;ComputeActions&#62; & object \\| never \\| never \\| never \\| never \\| never \\| object & AddShippingMethodAdjustment & WorkflowDataProperties&#60;ComputeActions&#62; & object \\| never \\| never \\| never \\| never \\| never \\| object & RemoveShippingMethodAdjustment & WorkflowDataProperties&#60;ComputeActions&#62; & object \\| never \\| never \\| never \\| never \\| never \\| object & CampaignBudgetExceededAction & WorkflowDataProperties&#60;ComputeActions&#62; & object)[]","type":"([ComputeActions](../../../../../promotion/types/promotion.ComputeActions/page.mdx) \\| `object` & [AddItemAdjustmentAction](../../../../../promotion/interfaces/promotion.AddItemAdjustmentAction/page.mdx) & [WorkflowDataProperties](../../../../../workflows/types/workflows.WorkflowDataProperties/page.mdx)&#60;[ComputeActions](../../../../../promotion/types/promotion.ComputeActions/page.mdx)&#62; & `object` \\| `never` \\| `never` \\| `never` \\| `never` \\| `never` \\| `object` & [RemoveItemAdjustmentAction](../../../../../promotion/interfaces/promotion.RemoveItemAdjustmentAction/page.mdx) & [WorkflowDataProperties](../../../../../workflows/types/workflows.WorkflowDataProperties/page.mdx)&#60;[ComputeActions](../../../../../promotion/types/promotion.ComputeActions/page.mdx)&#62; & `object` \\| `never` \\| `never` \\| `never` \\| `never` \\| `never` \\| `object` & [AddShippingMethodAdjustment](../../../../../promotion/interfaces/promotion.AddShippingMethodAdjustment/page.mdx) & [WorkflowDataProperties](../../../../../workflows/types/workflows.WorkflowDataProperties/page.mdx)&#60;[ComputeActions](../../../../../promotion/types/promotion.ComputeActions/page.mdx)&#62; & `object` \\| `never` \\| `never` \\| `never` \\| `never` \\| `never` \\| `object` & [RemoveShippingMethodAdjustment](../../../../../promotion/interfaces/promotion.RemoveShippingMethodAdjustment/page.mdx) & [WorkflowDataProperties](../../../../../workflows/types/workflows.WorkflowDataProperties/page.mdx)&#60;[ComputeActions](../../../../../promotion/types/promotion.ComputeActions/page.mdx)&#62; & `object` \\| `never` \\| `never` \\| `never` \\| `never` \\| `never` \\| `object` & [CampaignBudgetExceededAction](../../../../../promotion/interfaces/promotion.CampaignBudgetExceededAction/page.mdx) & [WorkflowDataProperties](../../../../../workflows/types/workflows.WorkflowDataProperties/page.mdx)&#60;[ComputeActions](../../../../../promotion/types/promotion.ComputeActions/page.mdx)&#62; & `object`)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ComputeActions \\| object & AddItemAdjustmentAction & WorkflowDataProperties&#60;ComputeActions&#62; & object \\| never \\| never \\| never \\| never \\| never \\| object & RemoveItemAdjustmentAction & WorkflowDataProperties&#60;ComputeActions&#62; & object \\| never \\| never \\| never \\| never \\| never \\| object & AddShippingMethodAdjustment & WorkflowDataProperties&#60;ComputeActions&#62; & object \\| never \\| never \\| never \\| never \\| never \\| object & RemoveShippingMethodAdjustment & WorkflowDataProperties&#60;ComputeActions&#62; & object \\| never \\| never \\| never \\| never \\| never \\| object & CampaignBudgetExceededAction & WorkflowDataProperties&#60;ComputeActions&#62; & object","type":"[ComputeActions](../../../../../promotion/types/promotion.ComputeActions/page.mdx) \\| `object` & [AddItemAdjustmentAction](../../../../../promotion/interfaces/promotion.AddItemAdjustmentAction/page.mdx) & [WorkflowDataProperties](../../../../../workflows/types/workflows.WorkflowDataProperties/page.mdx)&#60;[ComputeActions](../../../../../promotion/types/promotion.ComputeActions/page.mdx)&#62; & `object` \\| `never` \\| `never` \\| `never` \\| `never` \\| `never` \\| `object` & [RemoveItemAdjustmentAction](../../../../../promotion/interfaces/promotion.RemoveItemAdjustmentAction/page.mdx) & [WorkflowDataProperties](../../../../../workflows/types/workflows.WorkflowDataProperties/page.mdx)&#60;[ComputeActions](../../../../../promotion/types/promotion.ComputeActions/page.mdx)&#62; & `object` \\| `never` \\| `never` \\| `never` \\| `never` \\| `never` \\| `object` & [AddShippingMethodAdjustment](../../../../../promotion/interfaces/promotion.AddShippingMethodAdjustment/page.mdx) & [WorkflowDataProperties](../../../../../workflows/types/workflows.WorkflowDataProperties/page.mdx)&#60;[ComputeActions](../../../../../promotion/types/promotion.ComputeActions/page.mdx)&#62; & `object` \\| `never` \\| `never` \\| `never` \\| `never` \\| `never` \\| `object` & [RemoveShippingMethodAdjustment](../../../../../promotion/interfaces/promotion.RemoveShippingMethodAdjustment/page.mdx) & [WorkflowDataProperties](../../../../../workflows/types/workLine truncated
<TypeList types={[{"name":"(ComputeActions \\| object & AddItemAdjustmentAction & WorkflowDataProperties&#60;ComputeActions&#62; & object \\| never \\| never \\| never \\| never \\| never \\| never \\| object & RemoveItemAdjustmentAction & WorkflowDataProperties&#60;ComputeActions&#62; & object \\| never \\| never \\| never \\| never \\| never \\| never \\| object & AddShippingMethodAdjustment & WorkflowDataProperties&#60;ComputeActions&#62; & object \\| never \\| never \\| never \\| never \\| never \\| never \\| object & RemoveShippingMethodAdjustment & WorkflowDataProperties&#60;ComputeActions&#62; & object \\| never \\| never \\| never \\| never \\| never \\| never \\| object & CampaignBudgetExceededAction & WorkflowDataProperties&#60;ComputeActions&#62; & object \\| never \\| never \\| never \\| never \\| never \\| never \\| object & PromotionLimitExceededAction & WorkflowDataProperties&#60;ComputeActions&#62; & object)[]","type":"([ComputeActions](../../../../../promotion/types/promotion.ComputeActions/page.mdx) \\| `object` & [AddItemAdjustmentAction](../../../../../promotion/interfaces/promotion.AddItemAdjustmentAction/page.mdx) & [WorkflowDataProperties](../../../../../workflows/types/workflows.WorkflowDataProperties/page.mdx)&#60;[ComputeActions](../../../../../promotion/types/promotion.ComputeActions/page.mdx)&#62; & `object` \\| `never` \\| `never` \\| `never` \\| `never` \\| `never` \\| `never` \\| `object` & [RemoveItemAdjustmentAction](../../../../../promotion/interfaces/promotion.RemoveItemAdjustmentAction/page.mdx) & [WorkflowDataProperties](../../../../../workflows/types/workflows.WorkflowDataProperties/page.mdx)&#60;[ComputeActions](../../../../../promotion/types/promotion.ComputeActions/page.mdx)&#62; & `object` \\| `never` \\| `never` \\| `never` \\| `never` \\| `never` \\| `never` \\| `object` & [AddShippingMethodAdjustment](../../../../../promotion/interfaces/promotion.AddShippingMethodAdjustment/page.mdx) & [WorkflowDataProperties](../../../../../workflows/types/workflows.WorkflowDataProperties/page.mdx)&#60;[ComputeActions](../../../../../promotion/types/promotion.ComputeActions/page.mdx)&#62; & `object` \\| `never` \\| `never` \\| `never` \\| `never` \\| `never` \\| `never` \\| `object` & [RemoveShippingMethodAdjustment](../../../../../promotion/interfaces/promotion.RemoveShippingMethodAdjustment/page.mdx) & [WorkflowDataProperties](../../../../../workflows/types/workflows.WorkflowDataProperties/page.mdx)&#60;[ComputeActions](../../../../../promotion/types/promotion.ComputeActions/page.mdx)&#62; & `object` \\| `never` \\| `never` \\| `never` \\| `never` \\| `never` \\| `never` \\| `object` & [CampaignBudgetExceededAction](../../../../../promotion/interfaces/promotion.CampaignBudgetExceededAction/page.mdx) & [WorkflowDataProperties](../../../../../workflows/types/workflows.WorkflowDataProperties/page.mdx)&#60;[ComputeActions](../../../../../promotion/types/promotion.ComputeActions/page.mdx)&#62; & `object` \\| `never` \\| `never` \\| `never` \\| `never` \\| `never` \\| `never` \\| `object` & [PromotionLimitExceededAction](../../../../../promotion/interfaces/promotion.PromotionLimitExceededAction/page.mdx) & [WorkflowDataProperties](../../../../../workflows/types/workflows.WorkflowDataProperties/page.mdx)&#60;[ComputeActions](../../../../../promotion/types/promotion.ComputeActions/page.mdx)&#62; & `object`)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ComputeActions \\| object & AddItemAdjustmentAction & WorkflowDataProperties&#60;ComputeActions&#62; & object \\| never \\| never \\| never \\| never \\| never \\| never \\| object & RemoveItemAdjustmentAction & WorkflowDataProperties&#60;ComputeActions&#62; & object \\| never \\| never \\| never \\| never \\| never \\| never \\| object & AddShippingMethodAdjustment & WorkflowDataProperties&#60;ComputeActions&#62; & object \\| never \\| never \\| never \\| never \\| never \\| never \\| object & RemoveShippingMethodAdjustment & WorkflowDataProperties&#60;ComputeActions&#62; & object \\| never \\| never \\| never \\| never \\| never \\| never \\| object & CampaignBudgetExceededAction & WorkflowDataProperties&#60;ComputeActions&#62; & object \\| never \\| never \\| never \\| never \\| never \\| never \\| object & PromotionLimitExceededAction & WorkflowDataProperties&#60;ComputeActions&#62; & object","type":"[ComputeActions](../../../../../promotion/types/promotion.ComputeActions/page.mdx) \\| `object` & [AddItemAdjustmentAction](../../../../../promotion/interfaces/promotion.AddItemAdjustmentAction/page.mdx) & [WorkflowDataProperties](../../../../../workflows/types/workflows.WorkflowDataProperties/page.mdx)&#60;[ComputeActions](../../../../../promotion/types/promotion.ComputeActions/page.mdx)&#62; & `object` \\| `never` \\| `never` \\| `never` \\| `never` \\| `never` \\| `never` \\| `object` & [RemoveItemAdjustmentAction](../../../../../promotion/interfaces/promotion.RemoveItemAdjustmentActiLine truncated
@@ -19,7 +19,7 @@ const myWorkflow = createWorkflow(
"my-workflow",
() => {
const data = retrieveCartStep({
"id": "id_vqxFXLlF21ft"
"id": "id_DmHeD3JBBcaDaAdYyEj"
})
}
)
@@ -23,7 +23,7 @@ const myWorkflow = createWorkflow(
"my-workflow",
() => {
const data = updateCartPromotionsStep({
"id": "id_xCs4eq5YhmB7"
"id": "id_fBIJXeVKTMHS"
})
}
)
@@ -34,7 +34,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/cart/workflows/add-shipping-method-to-cart.ts#L83" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/cart/workflows/add-shipping-method-to-cart.ts#L83" />
## Examples
@@ -36,7 +36,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/cart/workflows/add-to-cart.ts#L114" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/cart/workflows/add-to-cart.ts#L114" />
## Examples
@@ -28,13 +28,219 @@ You can use this workflow within your own customizations or custom workflows, al
For example, in the [Subscriptions recipe](https://docs.medusajs.com/resources/recipes/subscriptions/examples/standard#create-workflow),
this workflow is used within another workflow that creates a subscription order.
## Cart Completion Idempotency
This workflow's logic is idempotent, meaning that if it is executed multiple times with the same input, it will not create duplicate orders. The
same order will be returned for subsequent executions with the same cart ID. This is necessary to avoid rolling back payments or causing
other side effects if the workflow is retried or fails due to transient errors.
So, if you use this workflow within your own, make sure your workflow's steps are idempotent as well to avoid unintended side effects.
Your workflow must also acquire and release locks around this workflow to prevent concurrent executions for the same cart.
The following sections cover some common scenarios and how to handle them.
### Creating Links and Linked Records
In some cases, you might want to create custom links or linked records to the order. For example, you might want to create a link from the order to a
digital order.
In such cases, ensure that your workflow's logic checks for existing links or records before creating new ones. You can query the
[entry point of the link](https://docs.medusajs.com/learn/fundamentals/module-links/custom-columns#method-2-using-entry-point)
to check for existing links before creating new ones.
For example:
```ts
import {
createWorkflow,
when,
WorkflowResponse
} from "@medusajs/framework/workflows-sdk"
import {
useQueryGraphStep,
completeCartWorkflow,
acquireLockStep,
releaseLockStep
} from "@medusajs/framework/workflows-sdk"
import digitalProductOrderOrderLink from "../../links/digital-product-order"
type WorkflowInput = {
cart_id: string
}
const createDigitalProductOrderWorkflow = createWorkflow(
"create-digital-product-order",
(input: WorkflowInput) => {
acquireLockStep({
key: input.cart_id,
timeout: 30,
ttl: 120,
});
const { id } = completeCartWorkflow.runAsStep({
input: {
id: input.cart_id
}
})
const { data: existingLinks } = useQueryGraphStep({
entity: digitalProductOrderOrderLink.entryPoint,
fields: ["digital_product_order.id"],
filters: { order_id: id },
}).config({ name: "retrieve-existing-links" });
const digital_product_order = when(
"create-digital-product-order-condition",
{ existingLinks },
(data) => {
return (
data.existingLinks.length === 0
);
}
)
.then(() => {
// create digital product order logic...
})
// other workflow logic...
releaseLockStep({
key: input.cart_id,
})
return new WorkflowResponse({
// workflow output...
})
}
)
```
### Custom Validation with Conflicts
Some use cases require custom validation that may cause conflicts on subsequent executions of the workflow.
For example, if you're selling tickets to an event, you might want to validate that the tickets are available
on selected dates.
In this scenario, if the workflow is retried after the first execution, the validation
will fail since the tickets would have already been reserved in the first execution. This makes the cart
completion non-idempotent.
To handle these cases, you can create a step that throws an error if the validation fails. Then, in the compensation function,
you can cancel the order if the validation fails. For example:
```ts
import { createStep, StepResponse } from "@medusajs/framework/workflows-sdk"
import { MedusaError } from "@medusajs/framework/utils"
import { cancelOrderWorkflow } from "@medusajs/medusa/core-flows"
type StepInput = {
order_id: string
// other input fields...
}
export const customCartValidationStep = createStep(
"custom-cart-validation",
async (input, { container }) => {
const isValid = true // replace with actual validation logic
if (!isValid) {
throw new MedusaError(
MedusaError.Types.INVALID_DATA,
"Custom cart validation failed"
)
}
return new StepResponse(void 0, input.order_id)
},
async (order_id, { container, context }) => {
if (!order_id) return
cancelOrderWorkflow(container).run({
input: {
id: order_id,
},
context,
container
})
}
)
```
Then, in your custom workflow, only run the validation step if the order is being created for the first time. For example,
only run the validation if the link from the order to your custom data does not exist yet:
```ts
import {
createWorkflow,
when,
WorkflowResponse
} from "@medusajs/framework/workflows-sdk"
import { useQueryGraphStep } from "@medusajs/framework/workflows-sdk"
import ticketOrderLink from "../../links/ticket-order"
type WorkflowInput = {
cart_id: string
}
const createTicketOrderWorkflow = createWorkflow(
"create-ticket-order",
(input: WorkflowInput) => {
acquireLockStep({
key: input.cart_id,
timeout: 30,
ttl: 120,
});
const { id } = completeCartWorkflow.runAsStep({
input: {
id: input.cart_id
}
})
const { data: existingLinks } = useQueryGraphStep({
entity: ticketOrderLink.entryPoint,
fields: ["ticket.id"],
filters: { order_id: id },
}).config({ name: "retrieve-existing-links" });
const ticket_order = when(
"create-ticket-order-condition",
{ existingLinks },
(data) => {
return (
data.existingLinks.length === 0
);
}
)
.then(() => {
customCartValidationStep({ order_id: id })
// create ticket order logic...
})
// other workflow logic...
releaseLockStep({
key: input.cart_id,
})
return new WorkflowResponse({
// workflow output...
})
}
)
```
The first time this workflow is executed for a cart, the validation step will run and validate the cart. If the validation fails,
the order will be canceled in the compensation function.
If the validation is successful and the workflow is retried, the validation step will be skipped since the link from the order to the
ticket order already exists. This ensures that the workflow remains idempotent.
:::note
If you use this workflow in another, you must acquire a lock before running it and release the lock after. Learn more in the [Locking Operations in Workflows](https://docs.medusajs.com/learn/fundamentals/workflows/locks#locks-in-nested-workflows) guide.
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/cart/workflows/complete-cart.ts#L93" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/cart/workflows/complete-cart.ts#L301" />
## Examples
@@ -27,7 +27,7 @@ Learn more about the links between the product variant and sales channels and in
You can use this workflow within your own customizations or custom workflows, allowing you to check whether a product variant has enough inventory quantity before adding them to the cart.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/cart/workflows/confirm-variant-inventory.ts#L147" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/cart/workflows/confirm-variant-inventory.ts#L147" />
## Examples
@@ -14,7 +14,7 @@ This documentation provides a reference to the `createCartCreditLinesWorkflow`.
This workflow creates one or more credit lines for a cart.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/cart/workflows/create-cart-credit-lines.ts#L31" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/cart/workflows/create-cart-credit-lines.ts#L31" />
## Examples
@@ -37,7 +37,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/cart/workflows/create-carts.ts#L111" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/cart/workflows/create-carts.ts#L111" />
## Examples
@@ -26,7 +26,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/cart/workflows/create-payment-collection-for-cart.ts#L84" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/cart/workflows/create-payment-collection-for-cart.ts#L84" />
## Examples
@@ -14,7 +14,7 @@ This documentation provides a reference to the `deleteCartCreditLinesWorkflow`.
This workflow deletes one or more credit lines from a cart.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/cart/workflows/delete-cart-credit-lines.ts#L13" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/cart/workflows/delete-cart-credit-lines.ts#L13" />
## Examples
@@ -36,7 +36,7 @@ export async function POST(
.run({
input: {
"id": [
"id_YFpjfEkPM2UM"
"id_r2S6rN9u50t8"
]
}
})
@@ -63,7 +63,7 @@ export default async function handleOrderPlaced({
.run({
input: {
"id": [
"id_YFpjfEkPM2UM"
"id_r2S6rN9u50t8"
]
}
})
@@ -90,7 +90,7 @@ export default async function myCustomJob(
.run({
input: {
"id": [
"id_YFpjfEkPM2UM"
"id_r2S6rN9u50t8"
]
}
})
@@ -118,7 +118,7 @@ const myWorkflow = createWorkflow(
.runAsStep({
input: {
"id": [
"id_YFpjfEkPM2UM"
"id_r2S6rN9u50t8"
]
}
})
@@ -22,7 +22,7 @@ price of the shipping method being added to the cart.
You can use this workflow within your own customizations or custom workflows, allowing you to retrieve the shipping options of a cart and their prices
in your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/cart/workflows/list-shipping-options-for-cart-with-pricing.ts#L126" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/cart/workflows/list-shipping-options-for-cart-with-pricing.ts#L126" />
## Examples
@@ -25,7 +25,7 @@ use the [listShippingOptionsForCartWithPricingWorkflow](../core_flows.Cart.Workf
You can use this workflow within your own customizations or custom workflows, allowing you to wrap custom logic around to retrieve the shipping options of a cart
in your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/cart/workflows/list-shipping-options-for-cart.ts#L134" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/cart/workflows/list-shipping-options-for-cart.ts#L134" />
## Examples
@@ -37,7 +37,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/cart/workflows/refresh-cart-items.ts#L118" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/cart/workflows/refresh-cart-items.ts#L118" />
## Examples
@@ -26,7 +26,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/cart/workflows/refresh-cart-shipping-methods.ts#L54" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/cart/workflows/refresh-cart-shipping-methods.ts#L54" />
## Examples
@@ -31,7 +31,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/cart/workflows/refresh-payment-collection.ts#L58" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/cart/workflows/refresh-payment-collection.ts#L58" />
## Examples
@@ -18,7 +18,7 @@ This documentation provides a reference to the `refundPaymentAndRecreatePaymentS
This workflow refunds a payment and creates a new payment session.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/cart/workflows/refund-payment-recreate-payment-session.ts#L67" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/cart/workflows/refund-payment-recreate-payment-session.ts#L67" />
## Examples
@@ -43,7 +43,7 @@ export async function POST(
"payment_collection_id": "{value}",
"provider_id": "{value}",
"payment_id": "{value}",
"amount": 19
"amount": 4
}
})
@@ -72,7 +72,7 @@ export default async function handleOrderPlaced({
"payment_collection_id": "{value}",
"provider_id": "{value}",
"payment_id": "{value}",
"amount": 19
"amount": 4
}
})
@@ -101,7 +101,7 @@ export default async function myCustomJob(
"payment_collection_id": "{value}",
"provider_id": "{value}",
"payment_id": "{value}",
"amount": 19
"amount": 4
}
})
@@ -130,7 +130,7 @@ const myWorkflow = createWorkflow(
"payment_collection_id": "{value}",
"provider_id": "{value}",
"payment_id": "{value}",
"amount": 19
"amount": 4
}
})
}
@@ -35,7 +35,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/cart/workflows/transfer-cart-customer.ts#L54" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/cart/workflows/transfer-cart-customer.ts#L54" />
## Examples
@@ -30,7 +30,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/cart/workflows/update-cart-promotions.ts#L77" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/cart/workflows/update-cart-promotions.ts#L77" />
## Examples
@@ -153,7 +153,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"updateCartPromotionsWorkflow","steps":[{"type":"step","name":"validateCartStep","description":"This step validates a cart to ensure it exists and is not completed.\nIf not valid, the step throws an error.\n\n:::tip\n\nYou can use the [retrieveCartStep](../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.retrieveCartStep/page.mdx) to retrieve a cart's details.\n\n:::","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateCartStep/page.mdx","depth":2},{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":3},{"type":"hook","name":"validate","description":"This hook is executed before all operations. You can consume this hook to perform any custom validation. If validation fails, you can throw an error to stop the workflow execution.","link":"#validate","depth":4},{"type":"step","name":"getPromotionCodesToApply","description":"This step retrieves the promotion codes to apply on a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.getPromotionCodesToApply/page.mdx","depth":5},{"type":"step","name":"getActionsToComputeFromPromotionsStep","description":"This step retrieves the actions to compute based on the promotions\napplied on a cart.\n\n:::tip\n\nYou can use the [retrieveCartStep](../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.retrieveCartStep/page.mdx) to retrieve a cart's details.\n\n:::","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.getActionsToComputeFromPromotionsStep/page.mdx","depth":6},{"type":"step","name":"prepareAdjustmentsFromPromotionActionsStep","description":"This step prepares the line item or shipping method adjustments using\nactions computed by the Promotion Module.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.prepareAdjustmentsFromPromotionActionsStep/page.mdx","depth":7},{"type":"step","name":"removeLineItemAdjustmentsStep","description":"This step removes line item adjustments from a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.removeLineItemAdjustmentsStep/page.mdx","depth":8},{"type":"step","name":"removeShippingMethodAdjustmentsStep","description":"This step removes shipping method adjustments from a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.removeShippingMethodAdjustmentsStep/page.mdx","depth":8},{"type":"step","name":"createLineItemAdjustmentsStep","description":"This step creates line item adjustments in a cart, such as when a promotion is applied.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.createLineItemAdjustmentsStep/page.mdx","depth":8},{"type":"step","name":"createShippingMethodAdjustmentsStep","description":"This step creates shipping method adjustments for a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.createShippingMethodAdjustmentsStep/page.mdx","depth":8},{"type":"step","name":"updateCartPromotionsStep","description":"This step updates the promotions applied on a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateCartPromotionsStep/page.mdx","depth":8},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/page.mdx","depth":9}]}} />
<WorkflowDiagram workflow={{"name":"updateCartPromotionsWorkflow","steps":[{"type":"step","name":"validateCartStep","description":"This step validates a cart to ensure it exists and is not completed.\nIf not valid, the step throws an error.\n\n:::tip\n\nYou can use the [retrieveCartStep](../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.retrieveCartStep/page.mdx) to retrieve a cart's details.\n\n:::","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateCartStep/page.mdx","depth":2},{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":3},{"type":"hook","name":"validate","description":"This hook is executed before all operations. You can consume this hook to perform any custom validation. If validation fails, you can throw an error to stop the workflow execution.","link":"#validate","depth":4},{"type":"step","name":"getPromotionCodesToApply","description":"This step retrieves the promotion codes to apply on a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.getPromotionCodesToApply/page.mdx","depth":5},{"type":"step","name":"getActionsToComputeFromPromotionsStep","description":"This step retrieves the actions to compute based on the promotions\napplied on items and shipping methods.\n\n:::tip\n\nYou can use the [retrieveCartStep](../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.retrieveCartStep/page.mdx) to retrieve items and shipping methods' details.\n\n:::","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.getActionsToComputeFromPromotionsStep/page.mdx","depth":6},{"type":"step","name":"prepareAdjustmentsFromPromotionActionsStep","description":"This step prepares the line item or shipping method adjustments using\nactions computed by the Promotion Module.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.prepareAdjustmentsFromPromotionActionsStep/page.mdx","depth":7},{"type":"step","name":"removeLineItemAdjustmentsStep","description":"This step removes line item adjustments from a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.removeLineItemAdjustmentsStep/page.mdx","depth":8},{"type":"step","name":"removeShippingMethodAdjustmentsStep","description":"This step removes shipping method adjustments from a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.removeShippingMethodAdjustmentsStep/page.mdx","depth":8},{"type":"step","name":"createLineItemAdjustmentsStep","description":"This step creates line item adjustments in a cart, such as when a promotion is applied.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.createLineItemAdjustmentsStep/page.mdx","depth":8},{"type":"step","name":"createShippingMethodAdjustmentsStep","description":"This step creates shipping method adjustments for a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.createShippingMethodAdjustmentsStep/page.mdx","depth":8},{"type":"step","name":"updateCartPromotionsStep","description":"This step updates the promotions applied on a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateCartPromotionsStep/page.mdx","depth":8},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/page.mdx","depth":9}]}} />
## Input
@@ -44,7 +44,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/cart/workflows/update-cart.ts#L82" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/cart/workflows/update-cart.ts#L82" />
## Examples
@@ -36,7 +36,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/cart/workflows/update-line-item-in-cart.ts#L111" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/cart/workflows/update-line-item-in-cart.ts#L111" />
## Examples
@@ -26,7 +26,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/cart/workflows/update-tax-lines.ts#L124" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/cart/workflows/update-tax-lines.ts#L124" />
## Examples
@@ -20,7 +20,7 @@ manage links within your custom flows.
Learn more about links in [this documentation](https://docs.medusajs.com/learn/fundamentals/module-links/link).
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/common/workflows/batch-links.ts#L70" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/common/workflows/batch-links.ts#L70" />
## Examples
@@ -20,7 +20,7 @@ create links within your custom flows.
Learn more about links in [this documentation](https://docs.medusajs.com/learn/fundamentals/module-links/link).
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/common/workflows/create-links.ts#L38" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/common/workflows/create-links.ts#L38" />
## Examples
@@ -20,7 +20,7 @@ dismiss links within your custom flows.
Learn more about links in [this documentation](https://docs.medusajs.com/learn/fundamentals/module-links/link).
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/common/workflows/dismiss-links.ts#L38" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/common/workflows/dismiss-links.ts#L38" />
## Examples
@@ -20,7 +20,7 @@ update links within your custom flows.
Learn more about links in [this documentation](https://docs.medusajs.com/learn/fundamentals/module-links/link).
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/common/workflows/update-links.ts#L43" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/common/workflows/update-links.ts#L43" />
## Examples
@@ -24,7 +24,7 @@ Learn more about basic authentication flows in [this documentation](https://docs
You can use this workflow within your customizations or your own custom workflows, allowing you to
register or create customer accounts within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/customer/workflows/create-customer-account.ts#L54" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/customer/workflows/create-customer-account.ts#L54" />
## Examples
@@ -21,7 +21,7 @@ allows you to create custom data models linked to the addresses.
You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around creating customer addresses.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/customer/workflows/create-addresses.ts#L75" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/customer/workflows/create-addresses.ts#L75" />
## Examples
@@ -20,7 +20,7 @@ This workflow has a hook that allows you to perform custom actions on the create
You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around creating customers.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/customer/workflows/create-customers.ts#L57" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/customer/workflows/create-customers.ts#L57" />
## Examples
@@ -28,7 +28,7 @@ relevant to that module.
You can use this workflow within your customizations or your own custom workflows, allowing you to
delete customer addresses in your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/customer/workflows/delete-addresses.ts#L52" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/customer/workflows/delete-addresses.ts#L52" />
## Examples
@@ -20,7 +20,7 @@ This workflow deletes one or more customers. It's used by the
You can use this workflow within your customizations or your own custom workflows, allowing you to
delete customers in your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/customer/workflows/delete-customers.ts#L46" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/customer/workflows/delete-customers.ts#L46" />
## Examples
@@ -29,7 +29,7 @@ custom actions after the customers are deleted.
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/customer/workflows/remove-customer-account.ts#L43" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/customer/workflows/remove-customer-account.ts#L43" />
## Examples
@@ -21,7 +21,7 @@ allows you to update custom data models linked to the addresses.
You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around updating customer addresses.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/customer/workflows/update-addresses.ts#L66" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/customer/workflows/update-addresses.ts#L66" />
## Examples
@@ -22,7 +22,7 @@ custom data models linked to the customers.
You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around updating customers.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/customer/workflows/update-customers.ts#L60" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/customer/workflows/update-customers.ts#L60" />
## Examples
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
"my-workflow",
() => {
const data = createCustomerGroupsStep({
"name": "Gladys"
"name": "Anabelle"
})
}
)
@@ -20,7 +20,7 @@ You can use this workflow within your customizations or your own custom workflow
create customer groups within your custom flows. For example, you can create customer groups to segregate
customers by age group or purchase habits.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/customer-group/workflows/create-customer-groups.ts#L52" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/customer-group/workflows/create-customer-groups.ts#L52" />
## Examples
@@ -19,7 +19,7 @@ This workflow deletes one or more customer groups. It's used by the
You can use this workflow within your customizations or your own custom workflows, allowing you to
delete customer groups within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/customer-group/workflows/delete-customer-groups.ts#L34" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/customer-group/workflows/delete-customer-groups.ts#L34" />
## Examples
@@ -19,7 +19,7 @@ This workflow manages the customer groups a customer is in. It's used by the
You can use this workflow within your customizations or your own custom workflows, allowing you to
manage the customer groups of a customer in your custom flow.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/customer-group/workflows/link-customer-groups-customer.ts#L37" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/customer-group/workflows/link-customer-groups-customer.ts#L37" />
## Examples
@@ -19,7 +19,7 @@ This workflow manages the customers of a customer group. It's used by the
You can use this workflow within your customizations or your own custom workflows, allowing you to
manage the customers of a customer group within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/customer-group/workflows/link-customers-customer-group.ts#L37" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/customer-group/workflows/link-customers-customer-group.ts#L37" />
## Examples
@@ -19,7 +19,7 @@ This workflow updates one or more customer groups. It's used by the
You can use this workflow within your customizations or your own custom workflows, allowing you to
update customer groups within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/customer-group/workflows/update-customer-groups.ts#L57" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/customer-group/workflows/update-customer-groups.ts#L57" />
## Examples
@@ -21,7 +21,7 @@ to create the default data, if not existing, when the application is first start
You can use this workflow within your customizations or your own custom workflows, allowing you to
create default data within your custom flows, such as seed scripts.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/defaults/workflows/create-defaults.ts#L25" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/defaults/workflows/create-defaults.ts#L25" />
## Examples
@@ -33,4 +33,4 @@ const data = validateDraftOrderStep({
## Input
<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":"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":"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":"item_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item total of the order.","optional":false,"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":"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":"item_discount_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item discount total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_tax_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The subtotal of the order. (Excluding taxes)","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tax_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discount_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The discount subtotal of the order.","optional":false,"defaultValue":"","expandaLine truncated
<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":"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":"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":"item_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item total of the order.","optional":false,"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":"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":"item_discount_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item discount total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_tax_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The subtotal of the order. (Excluding taxes)","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tax_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discount_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The discount subtotal of the order.","optional":false,"defaultValue":"","expandaLine truncated
@@ -9,6 +9,8 @@ tags:
- customer
- inventory
- tax
- promotion
- query
---
import { TypeList, WorkflowDiagram } from "docs-ui"
@@ -29,7 +31,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/draft-order/workflows/add-draft-order-items.ts#L55" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/draft-order/workflows/add-draft-order-items.ts#L51" />
## Examples
@@ -156,7 +158,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"addDraftOrderItemsWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"workflow","name":"addOrderLineItemsWorkflow","description":"Add line items to an order.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.addOrderLineItemsWorkflow/page.mdx","depth":2},{"type":"workflow","name":"updateOrderTaxLinesWorkflow","description":"Update the tax lines of items and shipping methods in an order.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateOrderTaxLinesWorkflow/page.mdx","depth":3},{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":5},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/page.mdx","depth":6},{"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":7}]}} />
<WorkflowDiagram workflow={{"name":"addDraftOrderItemsWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"workflow","name":"addOrderLineItemsWorkflow","description":"Add line items to an order.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.addOrderLineItemsWorkflow/page.mdx","depth":2},{"type":"workflow","name":"updateOrderTaxLinesWorkflow","description":"Update the tax lines of items and shipping methods in an order.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateOrderTaxLinesWorkflow/page.mdx","depth":3},{"type":"when","condition":"appliedPromoCodes.length > 0","depth":"4","steps":[{"type":"workflow","name":"computeDraftOrderAdjustmentsWorkflow","description":"Refresh the promotions in a draft order.","link":"../core_flows.Draft_Order.Workflows_Draft_Order.computeDraftOrderAdjustmentsWorkflow/page.mdx","depth":4}]},{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":5},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/page.mdx","depth":6},{"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":7}]}} />
## Input
@@ -164,4 +166,4 @@ const myWorkflow = createWorkflow(
## Output
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
@@ -6,6 +6,8 @@ tags:
- locking
- order
- workflow
- promotion
- query
---
import { TypeList, WorkflowDiagram } from "docs-ui"
@@ -26,7 +28,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/draft-order/workflows/add-draft-order-promotions.ts#L64" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/draft-order/workflows/add-draft-order-promotions.ts#L65" />
## Examples
@@ -141,7 +143,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"addDraftOrderPromotionWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":2},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/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":"addDraftOrderPromotionWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"workflow","name":"computeDraftOrderAdjustmentsWorkflow","description":"Refresh the promotions in a draft order.","link":"../core_flows.Draft_Order.Workflows_Draft_Order.computeDraftOrderAdjustmentsWorkflow/page.mdx","depth":2},{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":3},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/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}]}} />
## Input
@@ -149,4 +151,4 @@ const myWorkflow = createWorkflow(
## Output
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
@@ -7,6 +7,8 @@ tags:
- order
- workflow
- tax
- promotion
- query
---
import { TypeList, WorkflowDiagram } from "docs-ui"
@@ -27,7 +29,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/draft-order/workflows/add-draft-order-shipping-methods.ts#L100" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/draft-order/workflows/add-draft-order-shipping-methods.ts#L99" />
## Examples
@@ -146,7 +148,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"addDraftOrderShippingMethodsWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"workflow","name":"updateOrderTaxLinesWorkflow","description":"Update the tax lines of items and shipping methods in an order.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateOrderTaxLinesWorkflow/page.mdx","depth":2},{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":4},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/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}]}} />
<WorkflowDiagram workflow={{"name":"addDraftOrderShippingMethodsWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"workflow","name":"updateOrderTaxLinesWorkflow","description":"Update the tax lines of items and shipping methods in an order.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateOrderTaxLinesWorkflow/page.mdx","depth":2},{"type":"when","condition":"appliedPromoCodes.length > 0","depth":"3","steps":[{"type":"workflow","name":"computeDraftOrderAdjustmentsWorkflow","description":"Refresh the promotions in a draft order.","link":"../core_flows.Draft_Order.Workflows_Draft_Order.computeDraftOrderAdjustmentsWorkflow/page.mdx","depth":3}]},{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":4},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/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
@@ -154,4 +156,4 @@ const myWorkflow = createWorkflow(
## Output
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
@@ -28,7 +28,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/draft-order/workflows/begin-draft-order-edit.ts#L36" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/draft-order/workflows/begin-draft-order-edit.ts#L36" />
## Examples
@@ -147,4 +147,4 @@ const myWorkflow = createWorkflow(
## Output
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
@@ -26,7 +26,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/draft-order/workflows/cancel-draft-order-edit.ts#L53" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/draft-order/workflows/cancel-draft-order-edit.ts#L53" />
## Examples
@@ -0,0 +1,148 @@
---
slug: /references/medusa-workflows/computeDraftOrderAdjustmentsWorkflow
sidebar_label: computeDraftOrderAdjustmentsWorkflow
sidebar_description: Refresh the promotions in a draft order.
tags:
- locking
- order
- promotion
- query
- workflow
---
import { TypeList, WorkflowDiagram } from "docs-ui"
# computeDraftOrderAdjustmentsWorkflow - Medusa Core Workflows Reference
This documentation provides a reference to the `computeDraftOrderAdjustmentsWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
This workflow computes the adjustments or promotions for a draft order. It's used by other workflows
to compute new adjustments for the promotions whenever changes are made to the draft order.
Created adjustments are "virtual" meaning they live on the action and no line item adjustments records are created
in the database until the edit is confirmed.
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
computing the adjustments for a draft order.
:::note
If you use this workflow in another, you must acquire a lock before running it and release the lock after. Learn more in the [Locking Operations in Workflows](https://docs.medusajs.com/learn/fundamentals/workflows/locks#locks-in-nested-workflows) guide.
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/draft-order/workflows/compute-draft-order-adjustments.ts#L61" />
## Examples
<CodeTabs group="workflow-exection">
<CodeTab label="API Route" value="api-route">
```ts title="src/api/workflow/route.ts"
import type {
MedusaRequest,
MedusaResponse,
} from "@medusajs/framework/http"
import { computeDraftOrderAdjustmentsWorkflow } from "@medusajs/medusa/core-flows"
export async function POST(
req: MedusaRequest,
res: MedusaResponse
) {
const { result } = await computeDraftOrderAdjustmentsWorkflow(req.scope)
.run({
input: {
order_id: "order_123",
}
})
res.send(result)
}
```
</CodeTab>
<CodeTab label="Subscriber" value="subscriber">
```ts title="src/subscribers/order-placed.ts"
import {
type SubscriberConfig,
type SubscriberArgs,
} from "@medusajs/framework"
import { computeDraftOrderAdjustmentsWorkflow } from "@medusajs/medusa/core-flows"
export default async function handleOrderPlaced({
event: { data },
container,
}: SubscriberArgs < { id: string } > ) {
const { result } = await computeDraftOrderAdjustmentsWorkflow(container)
.run({
input: {
order_id: "order_123",
}
})
console.log(result)
}
export const config: SubscriberConfig = {
event: "order.placed",
}
```
</CodeTab>
<CodeTab label="Scheduled Job" value="scheduled-job">
```ts title="src/jobs/message-daily.ts"
import { MedusaContainer } from "@medusajs/framework/types"
import { computeDraftOrderAdjustmentsWorkflow } from "@medusajs/medusa/core-flows"
export default async function myCustomJob(
container: MedusaContainer
) {
const { result } = await computeDraftOrderAdjustmentsWorkflow(container)
.run({
input: {
order_id: "order_123",
}
})
console.log(result)
}
export const config = {
name: "run-once-a-day",
schedule: "0 0 * * *",
}
```
</CodeTab>
<CodeTab label="Another Workflow" value="another-workflow">
```ts title="src/workflows/my-workflow.ts"
import { createWorkflow } from "@medusajs/framework/workflows-sdk"
import { computeDraftOrderAdjustmentsWorkflow } from "@medusajs/medusa/core-flows"
const myWorkflow = createWorkflow(
"my-workflow",
() => {
// Acquire lock from nested workflow here
const result = computeDraftOrderAdjustmentsWorkflow
.runAsStep({
input: {
order_id: "order_123",
}
})
// Release lock here
}
)
```
</CodeTab>
</CodeTabs>
## Steps
<WorkflowDiagram workflow={{"name":"computeDraftOrderAdjustmentsWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"when","condition":"toDeleteActions.length > 0","depth":"2","steps":[{"type":"step","name":"deleteOrderChangeActionsStep","description":"This step deletes order change actions.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.deleteOrderChangeActionsStep/page.mdx","depth":2}]},{"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":3},{"type":"when","condition":"!!order.promotions?.length","depth":"5","steps":[{"type":"step","name":"getActionsToComputeFromPromotionsStep","description":"This step retrieves the actions to compute based on the promotions\napplied on items and shipping methods.\n\n:::tip\n\nYou can use the [retrieveCartStep](../../../../Cart/Steps_Cart/functions/core_flows.Cart.Steps_Cart.retrieveCartStep/page.mdx) to retrieve items and shipping methods' details.\n\n:::","link":"../../../../Cart/Steps_Cart/functions/core_flows.Cart.Steps_Cart.getActionsToComputeFromPromotionsStep/page.mdx","depth":5},{"type":"step","name":"prepareAdjustmentsFromPromotionActionsStep","description":"This step prepares the line item or shipping method adjustments using\nactions computed by the Promotion Module.","link":"../../../../Cart/Steps_Cart/functions/core_flows.Cart.Steps_Cart.prepareAdjustmentsFromPromotionActionsStep/page.mdx","depth":5}]},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/page.mdx","depth":6}]}} />
## Input
<TypeList types={[{"name":"ComputeDraftOrderAdjustmentsWorkflowInput","type":"[ComputeDraftOrderAdjustmentsWorkflowInput](../../../../interfaces/core_flows.ComputeDraftOrderAdjustmentsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the draft order to refresh the adjustments for.","expandable":false,"children":[{"name":"order_id","type":"`string`","description":"The ID of the draft order to refresh the adjustments 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="computeDraftOrderAdjustmentsWorkflow"/>
@@ -5,7 +5,6 @@ sidebar_description: Confirm a draft order edit.
tags:
- locking
- order
- inventory
- workflow
- query
- payment
@@ -29,7 +28,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/draft-order/workflows/confirm-draft-order-edit.ts#L49" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/draft-order/workflows/confirm-draft-order-edit.ts#L43" />
## Examples
@@ -144,7 +143,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"confirmDraftOrderEditWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"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":2},{"type":"step","name":"deleteReservationsByLineItemsStep","description":"This step deletes reservations by their associated line items.","link":"../../../../Reservation/Steps_Reservation/functions/core_flows.Reservation.Steps_Reservation.deleteReservationsByLineItemsStep/page.mdx","depth":3},{"type":"step","name":"reserveInventoryStep","description":"This step reserves the quantity of line items from the associated\nvariant's inventory.","link":"../../../../Cart/Steps_Cart/functions/core_flows.Cart.Steps_Cart.reserveInventoryStep/page.mdx","depth":4},{"type":"workflow","name":"createOrUpdateOrderPaymentCollectionWorkflow","description":"Create or update payment collection for an order.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrUpdateOrderPaymentCollectionWorkflow/page.mdx","depth":5},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/page.mdx","depth":6}]}} />
<WorkflowDiagram workflow={{"name":"confirmDraftOrderEditWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"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":2},{"type":"workflow","name":"createOrUpdateOrderPaymentCollectionWorkflow","description":"Create or update payment collection for an order.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrUpdateOrderPaymentCollectionWorkflow/page.mdx","depth":3},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/page.mdx","depth":4}]}} />
## Input
@@ -152,4 +151,4 @@ const myWorkflow = createWorkflow(
## Output
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
"my-workflow",
() => {
const data = convertDraftOrderStep({
"id": "id_qFJrgEOwuVjcnZ90"
"id": "id_tcAihCy6D6NAONM"
})
}
)
@@ -35,4 +35,4 @@ const myWorkflow = createWorkflow(
## 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":"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.","optiLine truncated
<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":"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.","optiLine truncated
@@ -4,6 +4,7 @@ sidebar_label: convertDraftOrderWorkflow
sidebar_description: Convert a draft order to a pending order.
tags:
- locking
- inventory
- event bus
- workflow
---
@@ -26,7 +27,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/draft-order/workflows/convert-draft-order.ts#L99" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/draft-order/workflows/convert-draft-order.ts#L109" />
## Examples
@@ -137,7 +138,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"convertDraftOrderWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/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":"convertDraftOrderStep","description":"This step converts a draft order to a pending order.","link":"../core_flows.Draft_Order.Workflows_Draft_Order.convertDraftOrderStep/page.mdx","depth":3},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/page.mdx","depth":4},{"type":"step","name":"emitEventStep","description":"This step emits an event, which you can listen to in a [subscriber](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers). You can pass data to the\nsubscriber by including it in the `data` property.\n\nThe event is only emitted after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. \nIf the workflow fails, it won't emit the event at all.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":4}]}} />
<WorkflowDiagram workflow={{"name":"convertDraftOrderWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/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":"reserveInventoryStep","description":"This step reserves the quantity of line items from the associated\nvariant's inventory.","link":"../../../../Cart/Steps_Cart/functions/core_flows.Cart.Steps_Cart.reserveInventoryStep/page.mdx","depth":3},{"type":"step","name":"convertDraftOrderStep","description":"This step converts a draft order to a pending order.","link":"../core_flows.Draft_Order.Workflows_Draft_Order.convertDraftOrderStep/page.mdx","depth":4},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/page.mdx","depth":5},{"type":"step","name":"emitEventStep","description":"This step emits an event, which you can listen to in a [subscriber](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers). You can pass data to the\nsubscriber by including it in the `data` property.\n\nThe event is only emitted after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. \nIf the workflow fails, it won't emit the event at all.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":5}]}} />
## Input
@@ -145,7 +146,7 @@ const myWorkflow = createWorkflow(
## 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":"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.","optiLine truncated
<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":"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.","optiLine truncated
## Emitted Events
@@ -18,7 +18,7 @@ This workflow deletes draft orders. It's used by the [Delete Draft Order API rou
You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around deleting a draft order.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/draft-order/workflows/delete-draft-order.ts#L59" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/draft-order/workflows/delete-draft-order.ts#L59" />
## Examples
@@ -6,6 +6,8 @@ tags:
- locking
- order
- workflow
- promotion
- query
---
import { TypeList, WorkflowDiagram } from "docs-ui"
@@ -26,7 +28,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-item.ts#L49" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-item.ts#L49" />
## Examples
@@ -141,7 +143,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"removeDraftOrderActionItemWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"step","name":"deleteOrderChangeActionsStep","description":"This step deletes order change actions.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.deleteOrderChangeActionsStep/page.mdx","depth":2},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/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":"removeDraftOrderActionItemWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"step","name":"deleteOrderChangeActionsStep","description":"This step deletes order change actions.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.deleteOrderChangeActionsStep/page.mdx","depth":2},{"type":"when","condition":"appliedPromoCodes.length > 0","depth":"3","steps":[{"type":"workflow","name":"computeDraftOrderAdjustmentsWorkflow","description":"Refresh the promotions in a draft order.","link":"../core_flows.Draft_Order.Workflows_Draft_Order.computeDraftOrderAdjustmentsWorkflow/page.mdx","depth":3}]},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/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}]}} />
## Input
@@ -149,4 +151,4 @@ const myWorkflow = createWorkflow(
## Output
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
@@ -6,6 +6,8 @@ tags:
- locking
- order
- workflow
- promotion
- query
---
import { TypeList, WorkflowDiagram } from "docs-ui"
@@ -26,7 +28,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-shipping-method.ts#L53" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-shipping-method.ts#L53" />
## Examples
@@ -144,7 +146,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"removeDraftOrderActionShippingMethodWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"step","name":"deleteOrderChangeActionsStep","description":"This step deletes order change actions.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.deleteOrderChangeActionsStep/page.mdx","depth":2},{"type":"step","name":"deleteOrderShippingMethods","description":"This step deletes order shipping methods.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.deleteOrderShippingMethods/page.mdx","depth":2},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/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":"removeDraftOrderActionShippingMethodWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"step","name":"deleteOrderChangeActionsStep","description":"This step deletes order change actions.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.deleteOrderChangeActionsStep/page.mdx","depth":2},{"type":"step","name":"deleteOrderShippingMethods","description":"This step deletes order shipping methods.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.deleteOrderShippingMethods/page.mdx","depth":2},{"type":"when","condition":"appliedPromoCodes.length > 0","depth":"3","steps":[{"type":"workflow","name":"computeDraftOrderAdjustmentsWorkflow","description":"Refresh the promotions in a draft order.","link":"../core_flows.Draft_Order.Workflows_Draft_Order.computeDraftOrderAdjustmentsWorkflow/page.mdx","depth":3}]},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/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}]}} />
## Input
@@ -152,4 +154,4 @@ const myWorkflow = createWorkflow(
## Output
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
@@ -6,6 +6,8 @@ tags:
- locking
- order
- workflow
- promotion
- query
---
import { TypeList, WorkflowDiagram } from "docs-ui"
@@ -26,7 +28,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-promotions.ts#L65" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-promotions.ts#L66" />
## Examples
@@ -141,7 +143,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"removeDraftOrderPromotionsWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":2},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/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":"removeDraftOrderPromotionsWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"workflow","name":"computeDraftOrderAdjustmentsWorkflow","description":"Refresh the promotions in a draft order.","link":"../core_flows.Draft_Order.Workflows_Draft_Order.computeDraftOrderAdjustmentsWorkflow/page.mdx","depth":2},{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":3},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/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}]}} />
## Input
@@ -149,4 +151,4 @@ const myWorkflow = createWorkflow(
## Output
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
@@ -6,6 +6,8 @@ tags:
- locking
- order
- workflow
- promotion
- query
---
import { TypeList, WorkflowDiagram } from "docs-ui"
@@ -26,7 +28,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-shipping-method.ts#L61" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-shipping-method.ts#L57" />
## Examples
@@ -141,7 +143,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"removeDraftOrderShippingMethodWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":3},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/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":"removeDraftOrderShippingMethodWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"when","condition":"appliedPromoCodes.length > 0","depth":"2","steps":[{"type":"workflow","name":"computeDraftOrderAdjustmentsWorkflow","description":"Refresh the promotions in a draft order.","link":"../core_flows.Draft_Order.Workflows_Draft_Order.computeDraftOrderAdjustmentsWorkflow/page.mdx","depth":2}]},{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":3},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/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}]}} />
## Input
@@ -149,4 +151,4 @@ const myWorkflow = createWorkflow(
## Output
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
@@ -28,7 +28,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/draft-order/workflows/request-draft-order-edit.ts#L72" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/draft-order/workflows/request-draft-order-edit.ts#L72" />
## Examples
@@ -151,4 +151,4 @@ const myWorkflow = createWorkflow(
## Output
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
@@ -6,6 +6,8 @@ tags:
- locking
- order
- workflow
- promotion
- query
---
import { TypeList, WorkflowDiagram } from "docs-ui"
@@ -26,7 +28,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-item.ts#L52" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-item.ts#L52" />
## Examples
@@ -153,7 +155,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"updateDraftOrderActionItemWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"step","name":"updateOrderChangeActionsStep","description":"This step updates order change actions.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.updateOrderChangeActionsStep/page.mdx","depth":2},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/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":"updateDraftOrderActionItemWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"step","name":"updateOrderChangeActionsStep","description":"This step updates order change actions.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.updateOrderChangeActionsStep/page.mdx","depth":2},{"type":"when","condition":"appliedPromoCodes.length > 0","depth":"3","steps":[{"type":"workflow","name":"computeDraftOrderAdjustmentsWorkflow","description":"Refresh the promotions in a draft order.","link":"../core_flows.Draft_Order.Workflows_Draft_Order.computeDraftOrderAdjustmentsWorkflow/page.mdx","depth":3}]},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/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}]}} />
## Input
@@ -161,4 +163,4 @@ const myWorkflow = createWorkflow(
## Output
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
@@ -6,6 +6,8 @@ tags:
- locking
- order
- workflow
- promotion
- query
---
import { TypeList, WorkflowDiagram } from "docs-ui"
@@ -26,7 +28,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-shipping-method.ts#L57" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-shipping-method.ts#L57" />
## Examples
@@ -156,7 +158,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"updateDraftOrderActionShippingMethodWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"step","name":"updateOrderChangeActionsStep","description":"This step updates order change actions.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.updateOrderChangeActionsStep/page.mdx","depth":3},{"type":"step","name":"updateOrderShippingMethodsStep","description":"This step updates order shipping methods.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.updateOrderShippingMethodsStep/page.mdx","depth":3},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/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}]}} />
<WorkflowDiagram workflow={{"name":"updateDraftOrderActionShippingMethodWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"step","name":"updateOrderChangeActionsStep","description":"This step updates order change actions.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.updateOrderChangeActionsStep/page.mdx","depth":3},{"type":"step","name":"updateOrderShippingMethodsStep","description":"This step updates order shipping methods.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.updateOrderShippingMethodsStep/page.mdx","depth":3},{"type":"when","condition":"appliedPromoCodes.length > 0","depth":"4","steps":[{"type":"workflow","name":"computeDraftOrderAdjustmentsWorkflow","description":"Refresh the promotions in a draft order.","link":"../core_flows.Draft_Order.Workflows_Draft_Order.computeDraftOrderAdjustmentsWorkflow/page.mdx","depth":4}]},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/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
@@ -164,4 +166,4 @@ const myWorkflow = createWorkflow(
## Output
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
@@ -6,6 +6,8 @@ tags:
- locking
- order
- workflow
- promotion
- query
---
import { TypeList, WorkflowDiagram } from "docs-ui"
@@ -26,7 +28,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/draft-order/workflows/update-draft-order-item.ts#L54" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/draft-order/workflows/update-draft-order-item.ts#L53" />
## Examples
@@ -141,7 +143,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"updateDraftOrderItemWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":2},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/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":"updateDraftOrderItemWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":2},{"type":"when","condition":"appliedPromoCodes.length > 0","depth":"3","steps":[{"type":"workflow","name":"computeDraftOrderAdjustmentsWorkflow","description":"Refresh the promotions in a draft order.","link":"../core_flows.Draft_Order.Workflows_Draft_Order.computeDraftOrderAdjustmentsWorkflow/page.mdx","depth":3}]},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/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}]}} />
## Input
@@ -149,4 +151,4 @@ const myWorkflow = createWorkflow(
## Output
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
@@ -7,6 +7,8 @@ tags:
- order
- workflow
- tax
- promotion
- query
---
import { TypeList, WorkflowDiagram } from "docs-ui"
@@ -27,7 +29,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/draft-order/workflows/update-draft-order-shipping-method.ts#L84" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/draft-order/workflows/update-draft-order-shipping-method.ts#L80" />
## Examples
@@ -154,7 +156,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"updateDraftOrderShippingMethodWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"workflow","name":"updateOrderTaxLinesWorkflow","description":"Update the tax lines of items and shipping methods in an order.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateOrderTaxLinesWorkflow/page.mdx","depth":2},{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":4},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/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}]}} />
<WorkflowDiagram workflow={{"name":"updateDraftOrderShippingMethodWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"workflow","name":"updateOrderTaxLinesWorkflow","description":"Update the tax lines of items and shipping methods in an order.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateOrderTaxLinesWorkflow/page.mdx","depth":2},{"type":"when","condition":"appliedPromoCodes.length > 0","depth":"3","steps":[{"type":"workflow","name":"computeDraftOrderAdjustmentsWorkflow","description":"Refresh the promotions in a draft order.","link":"../core_flows.Draft_Order.Workflows_Draft_Order.computeDraftOrderAdjustmentsWorkflow/page.mdx","depth":3}]},{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":4},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/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
@@ -162,4 +164,4 @@ const myWorkflow = createWorkflow(
## Output
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
@@ -38,8 +38,8 @@ const data = updateDraftOrderStep({
## 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":"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":"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":"item_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item total of the order.","optional":false,"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":"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":"item_discount_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item discount total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_tax_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The subtotal of the order. (Excluding taxes)","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tax_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discount_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The discount subtotal of the order.","optional":false,"defaultValue":"","expandable":falsLine truncated
<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":"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":"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":"item_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item total of the order.","optional":false,"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":"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":"item_discount_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item discount total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_tax_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The subtotal of the order. (Excluding taxes)","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tax_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discount_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The discount subtotal of the order.","optional":false,"defaultValue":"","expandable":falsLine 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":"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.","optiLine truncated
<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":"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.","optiLine truncated
@@ -32,7 +32,7 @@ If you use this workflow in another, you must acquire a lock before running it a
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/draft-order/workflows/update-draft-order.ts#L150" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/draft-order/workflows/update-draft-order.ts#L150" />
## Examples
@@ -159,7 +159,7 @@ const myWorkflow = createWorkflow(
## Output
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
<TypeList types={[{"name":"OrderPreviewDTO","type":"[OrderPreviewDTO](../../../../../order/interfaces/order.OrderPreviewDTO/page.mdx)","optional":false,"defaultValue":"","description":"The details of an order after a change is applied on it.","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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.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](../../../../../order/types/order.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`",Line truncated
## Emitted Events
@@ -0,0 +1,5 @@
import { TypeList, WorkflowDiagram } from "docs-ui"
# computeDraftOrderAdjustmentsWorkflowId
`Const` **computeDraftOrderAdjustmentsWorkflowId**: `"compute-draft-order-adjustments"`
@@ -7,6 +7,7 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
- [addDraftOrderShippingMethodsWorkflow](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.addDraftOrderShippingMethodsWorkflow/page.mdx)
- [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)
- [computeDraftOrderAdjustmentsWorkflow](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.computeDraftOrderAdjustmentsWorkflow/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)
@@ -23,7 +23,7 @@ const data = uploadFilesStep({
{
filename: "test.jpg",
mimeType: "img/jpg",
content: "binary-string",
content: "base64-string",
access: "public"
}
]
@@ -32,7 +32,7 @@ const data = uploadFilesStep({
## Input
<TypeList types={[{"name":"UploadFilesStepInput","type":"[UploadFilesStepInput](../../../../types/core_flows.UploadFilesStepInput/page.mdx)","optional":false,"defaultValue":"","description":"The data to upload files.","expandable":false,"children":[{"name":"files","type":"`object`[]","description":"The files to upload.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"filename","type":"`string`","description":"The name of the file.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mimeType","type":"`string`","description":"The MIME type of the file.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"content","type":"`string`","description":"The content of the file. For images, for example,\nuse binary string. For CSV files, use the CSV content.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"access","type":"`\"public\"` \\| `\"private\"`","description":"The access level of the file. Use `public` for the file that\ncan be accessed by anyone. For example, for images that are displayed\non the storefront. Use `private` for files that are only accessible\nby authenticated users. For example, for CSV files used to\nimport data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="uploadFilesStep"/>
<TypeList types={[{"name":"UploadFilesStepInput","type":"[UploadFilesStepInput](../../../../types/core_flows.UploadFilesStepInput/page.mdx)","optional":false,"defaultValue":"","description":"The data to upload files.","expandable":false,"children":[{"name":"files","type":"`object`[]","description":"The files to upload.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"filename","type":"`string`","description":"The name of the file.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mimeType","type":"`string`","description":"The MIME type of the file.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"content","type":"`string`","description":"The content of the file. For images, for example,\nuse base64 string. For CSV files, use the CSV content.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"access","type":"`\"public\"` \\| `\"private\"`","description":"The access level of the file. Use `public` for the file that\ncan be accessed by anyone. For example, for images that are displayed\non the storefront. Use `private` for files that are only accessible\nby authenticated users. For example, for CSV files used to\nimport data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="uploadFilesStep"/>
## Output
@@ -22,7 +22,7 @@ in your application will be used to delete the file from storage.
You can use this workflow within your customizations or your own custom workflows, allowing you to
delete files within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/file/workflows/delete-files.ts#L29" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/file/workflows/delete-files.ts#L29" />
## Examples
@@ -20,7 +20,7 @@ This workflow uploads one or more files using the installed
You can use this workflow within your customizations or your own custom workflows, allowing you to
upload files within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/147ce2fdc35366e591f552404ec949f6a5b92a11/packages/core/core-flows/src/file/workflows/upload-files.ts#L72" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e4513fab88f5ba7d5c078d3e251e04b104268a56/packages/core/core-flows/src/file/workflows/upload-files.ts#L72" />
## Examples
@@ -44,7 +44,7 @@ export async function POST(
files: [{
filename: "test.jpg",
mimeType: "img/jpg",
content: "binary-string",
content: "base64-string",
access: "public"
}]
}
@@ -74,7 +74,7 @@ export default async function handleOrderPlaced({
files: [{
filename: "test.jpg",
mimeType: "img/jpg",
content: "binary-string",
content: "base64-string",
access: "public"
}]
}
@@ -104,7 +104,7 @@ export default async function myCustomJob(
files: [{
filename: "test.jpg",
mimeType: "img/jpg",
content: "binary-string",
content: "base64-string",
access: "public"
}]
}
@@ -135,7 +135,7 @@ const myWorkflow = createWorkflow(
files: [{
filename: "test.jpg",
mimeType: "img/jpg",
content: "binary-string",
content: "base64-string",
access: "public"
}]
}
@@ -153,7 +153,7 @@ const myWorkflow = createWorkflow(
## Input
<TypeList types={[{"name":"UploadFilesWorkflowInput","type":"[UploadFilesWorkflowInput](../../../../types/core_flows.UploadFilesWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The data to upload files.","expandable":false,"children":[{"name":"files","type":"`object`[]","description":"The files to upload.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"filename","type":"`string`","description":"The name of the file.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mimeType","type":"`string`","description":"The MIME type of the file.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"content","type":"`string`","description":"The content of the file. For images, for example,\nuse binary string. For CSV files, use the CSV content.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"access","type":"`\"public\"` \\| `\"private\"`","description":"The access level of the file. Use `public` for the file that\ncan be accessed by anyone. For example, for images that are displayed\non the storefront. Use `private` for files that are only accessible\nby authenticated users. For example, for CSV files used to\nimport data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="uploadFilesWorkflow"/>
<TypeList types={[{"name":"UploadFilesWorkflowInput","type":"[UploadFilesWorkflowInput](../../../../types/core_flows.UploadFilesWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The data to upload files.","expandable":false,"children":[{"name":"files","type":"`object`[]","description":"The files to upload.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"filename","type":"`string`","description":"The name of the file.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mimeType","type":"`string`","description":"The MIME type of the file.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"content","type":"`string`","description":"The content of the file. For images, for example,\nuse base64 string. For CSV files, use the CSV content.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"access","type":"`\"public\"` \\| `\"private\"`","description":"The access level of the file. Use `public` for the file that\ncan be accessed by anyone. For example, for images that are displayed\non the storefront. Use `private` for files that are only accessible\nby authenticated users. For example, for CSV files used to\nimport data.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="uploadFilesWorkflow"/>
## Output
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
"my-workflow",
() => {
const data = createFulfillmentSets({
"name": "Brycen",
"name": "Kelsi",
"type": "{value}"
})
}
@@ -42,7 +42,7 @@ const data = createFulfillmentStep({
## Input
<TypeList types={[{"name":"CreateFulfillmentDTO","type":"[CreateFulfillmentDTO](../../../../../fulfillment/interfaces/fulfillment.CreateFulfillmentDTO/page.mdx)","optional":false,"defaultValue":"","description":"The fulfillment to be created.","expandable":false,"children":[{"name":"location_id","type":"`string`","description":"The associated location's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The associated fulfillment provider's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"delivery_address","type":"Omit&#60;[CreateFulfillmentAddressDTO](../../../../../fulfillment/interfaces/fulfillment.CreateFulfillmentAddressDTO/page.mdx), \"fulfillment_id\"&#62;","description":"The address associated with the fulfillment. It's used for delivery.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"company","type":"`null` \\| `string`","description":"The company of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`null` \\| `string`","description":"The first line of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`null` \\| `string`","description":"The second line of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`null` \\| `string`","description":"The city of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`null` \\| `string`","description":"The ISO 2 character country code of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`null` \\| `string`","description":"The lower-case [ISO 3166-2](https://en.wikipedia.org/wiki/ISO\\_3166-2) province of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`null` \\| `string`","description":"The postal code of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`null` \\| `string`","description":"The phone of the fulfillment 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":"items","type":"Omit&#60;[CreateFulfillmentItemDTO](../../../../../fulfillment/interfaces/fulfillment.CreateFulfillmentItemDTO/page.mdx), \"fulfillment_id\"&#62;[]","description":"The items associated with the fulfillment.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The title of the fulfillment item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The SKU of the fulfillment item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`number`","description":"The quantity of the fulfillment item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The barcode of the fulfillment item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`null` \\| `string`","description":"The associated line item's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`null` \\| `string`","description":"The associated inventory item's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"location","type":"[StockLocationDTO](../../../../../fulfillment/types/fulfillment.StockLocationDTO/page.mdx)","description":"The associated location's data.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the stock location.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the stock location.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>` \\| `null`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"address_id","type":"`string`","description":"The associateLine truncated
<TypeList types={[{"name":"CreateFulfillmentDTO","type":"[CreateFulfillmentDTO](../../../../../fulfillment/interfaces/fulfillment.CreateFulfillmentDTO/page.mdx)","optional":false,"defaultValue":"","description":"The fulfillment to be created.","expandable":false,"children":[{"name":"location_id","type":"`string`","description":"The associated location's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The associated fulfillment provider's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"delivery_address","type":"Omit&#60;[CreateFulfillmentAddressDTO](../../../../../fulfillment/interfaces/fulfillment.CreateFulfillmentAddressDTO/page.mdx), \"fulfillment_id\"&#62;","description":"The address associated with the fulfillment. It's used for delivery.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"company","type":"`null` \\| `string`","description":"The company of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`null` \\| `string`","description":"The first line of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`null` \\| `string`","description":"The second line of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`null` \\| `string`","description":"The city of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`null` \\| `string`","description":"The ISO 2 character country code of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`null` \\| `string`","description":"The lower-case [ISO 3166-2](https://en.wikipedia.org/wiki/ISO\\_3166-2) province of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`null` \\| `string`","description":"The postal code of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`null` \\| `string`","description":"The phone of the fulfillment 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":"items","type":"Omit&#60;[CreateFulfillmentItemDTO](../../../../../fulfillment/interfaces/fulfillment.CreateFulfillmentItemDTO/page.mdx), \"fulfillment_id\"&#62;[]","description":"The items associated with the fulfillment.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The title of the fulfillment item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The SKU of the fulfillment item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`number`","description":"The quantity of the fulfillment item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The barcode of the fulfillment item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`null` \\| `string`","description":"The associated line item's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`null` \\| `string`","description":"The associated inventory item's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"location","type":"[StockLocationDTO](../../../../../fulfillment/types/fulfillment.StockLocationDTO/page.mdx)","description":"The associated location's data.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the stock location.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the stock location.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>` \\| `null`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"address_id","type":"`string`","description":"The associateLine truncated
## Output
@@ -42,7 +42,7 @@ const data = createReturnFulfillmentStep({
## Input
<TypeList types={[{"name":"CreateFulfillmentDTO","type":"[CreateFulfillmentDTO](../../../../../fulfillment/interfaces/fulfillment.CreateFulfillmentDTO/page.mdx)","optional":false,"defaultValue":"","description":"The fulfillment to be created.","expandable":false,"children":[{"name":"location_id","type":"`string`","description":"The associated location's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The associated fulfillment provider's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"delivery_address","type":"Omit&#60;[CreateFulfillmentAddressDTO](../../../../../fulfillment/interfaces/fulfillment.CreateFulfillmentAddressDTO/page.mdx), \"fulfillment_id\"&#62;","description":"The address associated with the fulfillment. It's used for delivery.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"company","type":"`null` \\| `string`","description":"The company of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`null` \\| `string`","description":"The first line of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`null` \\| `string`","description":"The second line of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`null` \\| `string`","description":"The city of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`null` \\| `string`","description":"The ISO 2 character country code of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`null` \\| `string`","description":"The lower-case [ISO 3166-2](https://en.wikipedia.org/wiki/ISO\\_3166-2) province of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`null` \\| `string`","description":"The postal code of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`null` \\| `string`","description":"The phone of the fulfillment 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":"items","type":"Omit&#60;[CreateFulfillmentItemDTO](../../../../../fulfillment/interfaces/fulfillment.CreateFulfillmentItemDTO/page.mdx), \"fulfillment_id\"&#62;[]","description":"The items associated with the fulfillment.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The title of the fulfillment item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The SKU of the fulfillment item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`number`","description":"The quantity of the fulfillment item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The barcode of the fulfillment item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`null` \\| `string`","description":"The associated line item's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`null` \\| `string`","description":"The associated inventory item's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"location","type":"[StockLocationDTO](../../../../../fulfillment/types/fulfillment.StockLocationDTO/page.mdx)","description":"The associated location's data.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the stock location.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the stock location.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>` \\| `null`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"address_id","type":"`string`","description":"The associateLine truncated
<TypeList types={[{"name":"CreateFulfillmentDTO","type":"[CreateFulfillmentDTO](../../../../../fulfillment/interfaces/fulfillment.CreateFulfillmentDTO/page.mdx)","optional":false,"defaultValue":"","description":"The fulfillment to be created.","expandable":false,"children":[{"name":"location_id","type":"`string`","description":"The associated location's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The associated fulfillment provider's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"delivery_address","type":"Omit&#60;[CreateFulfillmentAddressDTO](../../../../../fulfillment/interfaces/fulfillment.CreateFulfillmentAddressDTO/page.mdx), \"fulfillment_id\"&#62;","description":"The address associated with the fulfillment. It's used for delivery.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"company","type":"`null` \\| `string`","description":"The company of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`null` \\| `string`","description":"The first line of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`null` \\| `string`","description":"The second line of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`null` \\| `string`","description":"The city of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`null` \\| `string`","description":"The ISO 2 character country code of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`null` \\| `string`","description":"The lower-case [ISO 3166-2](https://en.wikipedia.org/wiki/ISO\\_3166-2) province of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`null` \\| `string`","description":"The postal code of the fulfillment address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`null` \\| `string`","description":"The phone of the fulfillment 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":"items","type":"Omit&#60;[CreateFulfillmentItemDTO](../../../../../fulfillment/interfaces/fulfillment.CreateFulfillmentItemDTO/page.mdx), \"fulfillment_id\"&#62;[]","description":"The items associated with the fulfillment.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The title of the fulfillment item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The SKU of the fulfillment item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`number`","description":"The quantity of the fulfillment item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The barcode of the fulfillment item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`null` \\| `string`","description":"The associated line item's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`null` \\| `string`","description":"The associated inventory item's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"location","type":"[StockLocationDTO](../../../../../fulfillment/types/fulfillment.StockLocationDTO/page.mdx)","description":"The associated location's data.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the stock location.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the stock location.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>` \\| `null`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"address_id","type":"`string`","description":"The associateLine truncated
## Output
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
"my-workflow",
() => {
const data = createServiceZonesStep({
"name": "Maurine",
"name": "Justine",
"fulfillment_set_id": "{value}"
})
}
@@ -24,7 +24,7 @@ const myWorkflow = createWorkflow(
const data = createShippingOptionRulesStep({
"data": [{
"attribute": "{value}",
"operator": "lt",
"operator": "gt",
"value": "{value}",
"shipping_option_id": "{value}"
}]
@@ -29,10 +29,10 @@ const myWorkflow = createWorkflow(
"my-workflow",
() => {
const data = createShippingOptionsPriceSetsStep({
"id": "id_WxVGsrn6QHbcGEo8",
"id": "id_xG4w3L3V1X5fCr4llAZ8",
"prices": [{
"currency_code": "ugx",
"amount": 3
"currency_code": "kes",
"amount": 50
}]
})
}
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
"my-workflow",
() => {
const data = createShippingProfilesStep({
"name": "Torrance",
"name": "Gina",
"type": "{value}"
})
}
@@ -23,7 +23,7 @@ const myWorkflow = createWorkflow(
() => {
const data = deleteShippingOptionRulesStep({
"ids": [
"id_27FheOVU8Am6b"
"id_ERUiUK4o8G"
]
})
}
Loaded 100 of 983 files, more files were not shown because too many files have changed in this diff. Show more