docs: regenerate core-flows reference to pick up locking steps (#13502)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2025-09-15 13:29:03 +03:00
1 parent e90dcedcd7
commit 55cf7a7b97
344 files changed
+967201 -967241

No files matched your search

File diff suppressed because it is too large. Load diff
+12 -12
View File
@@ -4260,20 +4260,24 @@ export const filesMap = [
"pathname": "/references/core_flows/Line_Item/core_flows.Line_Item.Workflows_Line_Item"
},
{
"filePath": "/www/apps/resources/references/core_flows/Locking/functions/core_flows.Locking.acquireLockStep/page.mdx",
"pathname": "/references/core_flows/Locking/functions/core_flows.Locking.acquireLockStep"
"filePath": "/www/apps/resources/references/core_flows/Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx",
"pathname": "/references/core_flows/Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep"
},
{
"filePath": "/www/apps/resources/references/core_flows/Locking/functions/core_flows.Locking.releaseLockStep/page.mdx",
"pathname": "/references/core_flows/Locking/functions/core_flows.Locking.releaseLockStep"
"filePath": "/www/apps/resources/references/core_flows/Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/page.mdx",
"pathname": "/references/core_flows/Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep"
},
{
"filePath": "/www/apps/resources/references/core_flows/Locking/variables/core_flows.Locking.acquireLockStepId/page.mdx",
"pathname": "/references/core_flows/Locking/variables/core_flows.Locking.acquireLockStepId"
"filePath": "/www/apps/resources/references/core_flows/Locking/Steps_Locking/variables/core_flows.Locking.Steps_Locking.acquireLockStepId/page.mdx",
"pathname": "/references/core_flows/Locking/Steps_Locking/variables/core_flows.Locking.Steps_Locking.acquireLockStepId"
},
{
"filePath": "/www/apps/resources/references/core_flows/Locking/variables/core_flows.Locking.releaseLockStepId/page.mdx",
"pathname": "/references/core_flows/Locking/variables/core_flows.Locking.releaseLockStepId"
"filePath": "/www/apps/resources/references/core_flows/Locking/Steps_Locking/variables/core_flows.Locking.Steps_Locking.releaseLockStepId/page.mdx",
"pathname": "/references/core_flows/Locking/Steps_Locking/variables/core_flows.Locking.Steps_Locking.releaseLockStepId"
},
{
"filePath": "/www/apps/resources/references/core_flows/Locking/core_flows.Locking.Steps_Locking/page.mdx",
"pathname": "/references/core_flows/Locking/core_flows.Locking.Steps_Locking"
},
{
"filePath": "/www/apps/resources/references/core_flows/Notification/Steps_Notification/functions/core_flows.Notification.Steps_Notification.notifyOnFailureStep/page.mdx",
@@ -12051,10 +12055,6 @@ export const filesMap = [
"filePath": "/www/apps/resources/references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.user/page.mdx",
"pathname": "/references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.user"
},
{
"filePath": "/www/apps/resources/references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.views/page.mdx",
"pathname": "/references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.views"
},
{
"filePath": "/www/apps/resources/references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.workflowExecution/page.mdx",
"pathname": "/references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.workflowExecution"
@@ -2235,6 +2235,40 @@ const generatedgeneratedReferencesSidebarSidebar = {
}
]
},
{
"loaded": true,
"isPathHref": true,
"type": "category",
"title": "Locking",
"children": [
{
"loaded": true,
"isPathHref": true,
"type": "sub-category",
"title": "Steps",
"children": [
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/references/medusa-workflows/steps/acquireLockStep",
"title": "acquireLockStep",
"description": "",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/references/medusa-workflows/steps/releaseLockStep",
"title": "releaseLockStep",
"description": "",
"children": []
}
]
}
]
},
{
"loaded": true,
"isPathHref": true,
@@ -740,15 +740,6 @@ const generatedgeneratedToolsSidebarSidebar = {
"description": "",
"children": []
},
{
"loaded": true,
"isPathHref": true,
"type": "link",
"path": "/references/js-sdk/admin/views",
"title": "views",
"description": "",
"children": []
},
{
"loaded": true,
"isPathHref": true,
+10 -5
View File
@@ -1529,6 +1529,16 @@ export const slugChanges = [
"newSlug": "/references/medusa-workflows/deleteLineItemsWorkflow",
"filePath": "/www/apps/resources/references/core_flows/Line_Item/Workflows_Line_Item/functions/core_flows.Line_Item.Workflows_Line_Item.deleteLineItemsWorkflow/page.mdx"
},
{
"origSlug": "/references/core_flows/Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep",
"newSlug": "/references/medusa-workflows/steps/acquireLockStep",
"filePath": "/www/apps/resources/references/core_flows/Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx"
},
{
"origSlug": "/references/core_flows/Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep",
"newSlug": "/references/medusa-workflows/steps/releaseLockStep",
"filePath": "/www/apps/resources/references/core_flows/Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/page.mdx"
},
{
"origSlug": "/references/core_flows/Notification/Steps_Notification/functions/core_flows.Notification.Steps_Notification.notifyOnFailureStep",
"newSlug": "/references/medusa-workflows/steps/notifyOnFailureStep",
@@ -4904,11 +4914,6 @@ export const slugChanges = [
"newSlug": "/references/js-sdk/admin/user",
"filePath": "/www/apps/resources/references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.user/page.mdx"
},
{
"origSlug": "/references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.views",
"newSlug": "/references/js-sdk/admin/views",
"filePath": "/www/apps/resources/references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.views/page.mdx"
},
{
"origSlug": "/references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.workflowExecution",
"newSlug": "/references/js-sdk/admin/workflowExecution",
@@ -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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/api-key/workflows/create-api-keys.ts#L51" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/api-key/workflows/delete-api-keys.ts#L36" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/api-key/workflows/link-sales-channels-to-publishable-key.ts#L39" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/api-key/workflows/revoke-api-keys.ts#L59" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/api-key/workflows/update-api-keys.ts#L57" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/auth/workflows/generate-reset-password-token.ts#L43" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/auth/workflows/generate-reset-password-token.ts#L43" />
## Examples
@@ -19,7 +19,7 @@ const myWorkflow = createWorkflow(
"my-workflow",
() => {
const data = retrieveCartStep({
"id": "id_cAbtyey7vC4I"
"id": "id_09O9ypq1i8"
})
}
)
@@ -24,7 +24,7 @@ const myWorkflow = createWorkflow(
"my-workflow",
() => {
const data = updateCartPromotionsStep({
"id": "id_dmGXIUDkzRPl0"
"id": "id_WiXLgsrkmb9"
})
}
)
@@ -29,7 +29,7 @@ This workflow adds a shipping method to a cart. It's executed by the
You can use this workflow within your own customizations or custom workflows, allowing you to wrap custom logic around adding a shipping method to the cart.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/cart/workflows/add-shipping-method-to-cart.ts#L81" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/add-shipping-method-to-cart.ts#L81" />
## Examples
@@ -31,7 +31,7 @@ This workflow adds a product variant to a cart as a line item. It's executed by
You can use this workflow within your own customizations or custom workflows, allowing you to wrap custom logic around adding an item to the cart.
For example, you can use this workflow to add a line item to the cart with a custom price.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/cart/workflows/add-to-cart.ts#L117" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/add-to-cart.ts#L117" />
## Examples
@@ -180,7 +180,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"addToCartWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key.","link":"../../../../Locking/functions/core_flows.Locking.acquireLockStep/page.mdx","depth":1},{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":2},{"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":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":"hook","name":"setPricingContext","description":"This hook is executed before the shipping options are retrieved. You can consume this hook to return any custom context useful for the prices retrieval of shipping options.\n\nFor example, assuming you have the following custom pricing rule:\n\n```json\n{\n \"attribute\": \"location_id\",\n \"operator\": \"eq\",\n \"value\": \"sloc_123\",\n}\n```\n\nYou can consume the `setPricingContext` hook to add the `location_id` context to the prices calculation:\n\n```ts\nimport { listShippingOptionsForCartWorkflow } from \"@medusajs/medusa/core-flows\";\nimport { StepResponse } from \"@medusajs/workflows-sdk\";\n\nlistShippingOptionsForCartWorkflow.hooks.setPricingContext((\n { cart, fulfillmentSetIds, additional_data }, { container }\n) => {\n return new StepResponse({\n location_id: \"sloc_123\", // Special price for in-store purchases\n });\n});\n```\n\nThe shipping options' prices will now be retrieved using the context you return.\n\n:::note\n\nLearn more about prices calculation context in the [Prices Calculation](https://docs.medusajs.com/resources/commerce-modules/pricing/price-calculation) documentation.\n\n:::","link":"#setPricingContext","depth":5},{"type":"when","condition":"{\n return !!variantIds.length\n }","depth":"6","steps":[{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":6},{"type":"step","name":"getVariantPriceSetsStep","description":"This step retrieves the calculated price sets of the specified variants.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.getVariantPriceSetsStep/page.mdx","depth":6},{"type":"step","name":"validateVariantPricesStep","description":"This step validates the specified variant objects to ensure they have prices.\nIf not valid, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateVariantPricesStep/page.mdx","depth":6}]},{"type":"step","name":"validateLineItemPricesStep","description":"This step validates the specified line item objects to ensure they have prices.\nIf an item doesn't have a price, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateLineItemPricesStep/page.mdx","depth":7},{"type":"step","name":"getLineItemActionsStep","description":"This step returns lists of cart line items to create or update based on the\nprovided input.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.getLineItemActionsStep/page.mdx","depth":8},{"type":"workflow","name":"confirmVariantInventoryWorkflow","description":"Validate that a variant is in-stock before adding to the cart.","link":"../core_flows.Cart.Workflows_Cart.confirmVariantInventoryWorkflow/page.mdx","depth":9},{"type":"step","name":"createLineItemsStep","description":"This step creates line item in a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.createLineItemsStep/page.mdx","depth":10},{"type":"step","name":"updateLineItemsStep","description":"This step updates a cart's line items.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateLineItemsStep/page.mdx","depth":10},{"type":"workflow","name":"refreshCartItemsWorkflow","description":"Refresh a cart's details after an update.","link":"../core_flows.Cart.Workflows_Cart.refreshCartItemsWorkflow/page.mdx","depth":11},{"type":"step","name":"emitEventStep","descriptionLine truncated
<WorkflowDiagram workflow={{"name":"addToCartWorkflow","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":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":2},{"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":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":"hook","name":"setPricingContext","description":"This hook is executed before the shipping options are retrieved. You can consume this hook to return any custom context useful for the prices retrieval of shipping options.\n\nFor example, assuming you have the following custom pricing rule:\n\n```json\n{\n \"attribute\": \"location_id\",\n \"operator\": \"eq\",\n \"value\": \"sloc_123\",\n}\n```\n\nYou can consume the `setPricingContext` hook to add the `location_id` context to the prices calculation:\n\n```ts\nimport { listShippingOptionsForCartWorkflow } from \"@medusajs/medusa/core-flows\";\nimport { StepResponse } from \"@medusajs/workflows-sdk\";\n\nlistShippingOptionsForCartWorkflow.hooks.setPricingContext((\n { cart, fulfillmentSetIds, additional_data }, { container }\n) => {\n return new StepResponse({\n location_id: \"sloc_123\", // Special price for in-store purchases\n });\n});\n```\n\nThe shipping options' prices will now be retrieved using the context you return.\n\n:::note\n\nLearn more about prices calculation context in the [Prices Calculation](https://docs.medusajs.com/resources/commerce-modules/pricing/price-calculation) documentation.\n\n:::","link":"#setPricingContext","depth":5},{"type":"when","condition":"{\n return !!variantIds.length\n }","depth":"6","steps":[{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":6},{"type":"step","name":"getVariantPriceSetsStep","description":"This step retrieves the calculated price sets of the specified variants.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.getVariantPriceSetsStep/page.mdx","depth":6},{"type":"step","name":"validateVariantPricesStep","description":"This step validates the specified variant objects to ensure they have prices.\nIf not valid, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateVariantPricesStep/page.mdx","depth":6}]},{"type":"step","name":"validateLineItemPricesStep","description":"This step validates the specified line item objects to ensure they have prices.\nIf an item doesn't have a price, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateLineItemPricesStep/page.mdx","depth":7},{"type":"step","name":"getLineItemActionsStep","description":"This step returns lists of cart line items to create or update based on the\nprovided input.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.getLineItemActionsStep/page.mdx","depth":8},{"type":"workflow","name":"confirmVariantInventoryWorkflow","description":"Validate that a variant is in-stock before adding to the cart.","link":"../core_flows.Cart.Workflows_Cart.confirmVariantInventoryWorkflow/page.mdx","depth":9},{"type":"step","name":"createLineItemsStep","description":"This step creates line item in a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.createLineItemsStep/page.mdx","depth":10},{"type":"step","name":"updateLineItemsStep","description":"This step updates a cart's line items.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateLineItemsStep/page.mdx","depth":10},{"type":"workflow","name":"refreshCartItemsWorkflow","description":"Refresh a cart's details after Line truncated
## Input
@@ -28,7 +28,7 @@ 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.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/cart/workflows/complete-cart.ts#L94" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/complete-cart.ts#L94" />
## Examples
@@ -137,7 +137,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"completeCartWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key.","link":"../../../../Locking/functions/core_flows.Locking.acquireLockStep/page.mdx","depth":1},{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":2},{"type":"step","name":"validateCartPaymentsStep","description":"This step validates a cart's payment sessions. Their status must\nbe `pending` or `requires_more`. If 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.validateCartPaymentsStep/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":"when","condition":"{\n return !orderId\n }","depth":"5","steps":[{"type":"step","name":"validateShippingStep","description":"This step validates shipping data when cart is completed.\n\nIt ensures that a shipping method is selected if there is an item in the cart that requires shipping.\nIt also ensures that product's shipping profile mathes the selected shipping options. If the\nconditions are not met, an error is thrown.\n\n:::note\n\nYou can retrieve cart or shipping option'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_Cart/functions/core_flows.Cart.Steps_Cart.validateShippingStep/page.mdx","depth":5},{"type":"step","name":"createOrdersStep","description":"This step creates one or more orders.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.createOrdersStep/page.mdx","depth":5},{"type":"step","name":"createRemoteLinkStep","description":"This step creates remote links between two records of linked data models.\n\nLearn more in the [Remote Link documentation.](https://docs.medusajs.com/learn/fundamentals/module-links/remote-link#create-link).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.createRemoteLinkStep/page.mdx","depth":5},{"type":"step","name":"updateCartsStep","description":"This step updates a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateCartsStep/page.mdx","depth":5},{"type":"step","name":"reserveInventoryStep","description":"This step reserves the quantity of line items from the associated\nvariant's inventory.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.reserveInventoryStep/page.mdx","depth":5},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":5},{"type":"step","name":"authorizePaymentSessionStep","description":"This step authorizes a payment session.","link":"../../../../Payment/Steps_Payment/functions/core_flows.Payment.Steps_Payment.authorizePaymentSessionStep/page.mdx","depth":5},{"type":"step","name":"addOrderTransactionStep","description":"This step creates order transactions.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.addOrderTransactionStep/page.mdx","depth":5}]},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key.","link":"../../../../Locking/functions/core_flows.Locking.releaseLockStep/page.mdx","depth":6}]}} />
<WorkflowDiagram workflow={{"name":"completeCartWorkflow","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":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":2},{"type":"step","name":"validateCartPaymentsStep","description":"This step validates a cart's payment sessions. Their status must\nbe `pending` or `requires_more`. If 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.validateCartPaymentsStep/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":"when","condition":"{\n return !orderId\n }","depth":"5","steps":[{"type":"step","name":"validateShippingStep","description":"This step validates shipping data when cart is completed.\n\nIt ensures that a shipping method is selected if there is an item in the cart that requires shipping.\nIt also ensures that product's shipping profile mathes the selected shipping options. If the\nconditions are not met, an error is thrown.\n\n:::note\n\nYou can retrieve cart or shipping option'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_Cart/functions/core_flows.Cart.Steps_Cart.validateShippingStep/page.mdx","depth":5},{"type":"step","name":"createOrdersStep","description":"This step creates one or more orders.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.createOrdersStep/page.mdx","depth":5},{"type":"step","name":"createRemoteLinkStep","description":"This step creates remote links between two records of linked data models.\n\nLearn more in the [Remote Link documentation.](https://docs.medusajs.com/learn/fundamentals/module-links/remote-link#create-link).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.createRemoteLinkStep/page.mdx","depth":5},{"type":"step","name":"updateCartsStep","description":"This step updates a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateCartsStep/page.mdx","depth":5},{"type":"step","name":"reserveInventoryStep","description":"This step reserves the quantity of line items from the associated\nvariant's inventory.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.reserveInventoryStep/page.mdx","depth":5},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":5},{"type":"step","name":"authorizePaymentSessionStep","description":"This step authorizes a payment session.","link":"../../../../Payment/Steps_Payment/functions/core_flows.Payment.Steps_Payment.authorizePaymentSessionStep/page.mdx","depth":5},{"type":"step","name":"addOrderTransactionStep","description":"This step creates order transactions.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.addOrderTransactionStep/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
@@ -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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/cart/workflows/confirm-variant-inventory.ts#L147" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/cart/workflows/create-cart-credit-lines.ts#L31" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/create-cart-credit-lines.ts#L31" />
## Examples
@@ -35,7 +35,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 cart creation.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/cart/workflows/create-carts.ts#L118" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/create-carts.ts#L118" />
## Examples
@@ -20,7 +20,7 @@ This workflow creates a payment collection for a cart. It's executed by the
You can use this workflow within your own customizations or custom workflows, allowing you to wrap custom logic around adding creating a payment collection for a cart.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/cart/workflows/create-payment-collection-for-cart.ts#L84" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/create-payment-collection-for-cart.ts#L84" />
## Examples
@@ -141,7 +141,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"createPaymentCollectionForCartWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key.","link":"../../../../Locking/functions/core_flows.Locking.acquireLockStep/page.mdx","depth":1},{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":2},{"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":3},{"type":"step","name":"validateExistingPaymentCollectionStep","description":"This step validates that a cart doesn't have a payment collection.\nIf the cart has a payment collection, the step throws an error.\n\n:::tip\n\nYou can use the retrieveCartStep to retrieve a cart's details.\n\n:::","link":"../core_flows.Cart.Workflows_Cart.validateExistingPaymentCollectionStep/page.mdx","depth":3},{"type":"step","name":"createPaymentCollectionsStep","description":"This step creates payment collections in a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.createPaymentCollectionsStep/page.mdx","depth":4},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key.","link":"../../../../Locking/functions/core_flows.Locking.releaseLockStep/page.mdx","depth":5}]}} />
<WorkflowDiagram workflow={{"name":"createPaymentCollectionForCartWorkflow","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":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":2},{"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":3},{"type":"step","name":"validateExistingPaymentCollectionStep","description":"This step validates that a cart doesn't have a payment collection.\nIf the cart has a payment collection, the step throws an error.\n\n:::tip\n\nYou can use the retrieveCartStep to retrieve a cart's details.\n\n:::","link":"../core_flows.Cart.Workflows_Cart.validateExistingPaymentCollectionStep/page.mdx","depth":3},{"type":"step","name":"createPaymentCollectionsStep","description":"This step creates payment collections in a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.createPaymentCollectionsStep/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}]}} />
## Input
@@ -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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/cart/workflows/delete-cart-credit-lines.ts#L13" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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_JmlVbiA938b3tjMAeG2F"
"id_TWz9HtBLfjp7hFQ"
]
}
})
@@ -63,7 +63,7 @@ export default async function handleOrderPlaced({
.run({
input: {
"id": [
"id_JmlVbiA938b3tjMAeG2F"
"id_TWz9HtBLfjp7hFQ"
]
}
})
@@ -90,7 +90,7 @@ export default async function myCustomJob(
.run({
input: {
"id": [
"id_JmlVbiA938b3tjMAeG2F"
"id_TWz9HtBLfjp7hFQ"
]
}
})
@@ -118,7 +118,7 @@ const myWorkflow = createWorkflow(
.runAsStep({
input: {
"id": [
"id_JmlVbiA938b3tjMAeG2F"
"id_TWz9HtBLfjp7hFQ"
]
}
})
@@ -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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/cart/workflows/list-shipping-options-for-cart-with-pricing.ts#L76" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/list-shipping-options-for-cart-with-pricing.ts#L76" />
## 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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/cart/workflows/list-shipping-options-for-cart.ts#L82" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/list-shipping-options-for-cart.ts#L82" />
## Examples
@@ -32,7 +32,7 @@ is added to the cart.
You can use this workflow within your own customizations or custom workflows, allowing you to refresh the cart after making updates to it in your
custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/cart/workflows/refresh-cart-items.ts#L131" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/refresh-cart-items.ts#L131" />
## Examples
@@ -141,7 +141,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"refreshCartItemsWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key.","link":"../../../../Locking/functions/core_flows.Locking.acquireLockStep/page.mdx","depth":1},{"type":"hook","name":"setPricingContext","description":"This hook is executed before the shipping options are retrieved. You can consume this hook to return any custom context useful for the prices retrieval of shipping options.\n\nFor example, assuming you have the following custom pricing rule:\n\n```json\n{\n \"attribute\": \"location_id\",\n \"operator\": \"eq\",\n \"value\": \"sloc_123\",\n}\n```\n\nYou can consume the `setPricingContext` hook to add the `location_id` context to the prices calculation:\n\n```ts\nimport { listShippingOptionsForCartWorkflow } from \"@medusajs/medusa/core-flows\";\nimport { StepResponse } from \"@medusajs/workflows-sdk\";\n\nlistShippingOptionsForCartWorkflow.hooks.setPricingContext((\n { cart, fulfillmentSetIds, additional_data }, { container }\n) => {\n return new StepResponse({\n location_id: \"sloc_123\", // Special price for in-store purchases\n });\n});\n```\n\nThe shipping options' prices will now be retrieved using the context you return.\n\n:::note\n\nLearn more about prices calculation context in the [Prices Calculation](https://docs.medusajs.com/resources/commerce-modules/pricing/price-calculation) documentation.\n\n:::","link":"#setPricingContext","depth":2},{"type":"when","condition":"{\n return !!input.force_refresh\n }","depth":"3","steps":[{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":3},{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":3},{"type":"step","name":"getVariantPriceSetsStep","description":"This step retrieves the calculated price sets of the specified variants.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.getVariantPriceSetsStep/page.mdx","depth":3},{"type":"step","name":"validateVariantPricesStep","description":"This step validates the specified variant objects to ensure they have prices.\nIf not valid, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateVariantPricesStep/page.mdx","depth":3},{"type":"step","name":"updateLineItemsStep","description":"This step updates a cart's line items.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateLineItemsStep/page.mdx","depth":3}]},{"type":"workflow","name":"refreshCartShippingMethodsWorkflow","description":"Refresh a cart's shipping methods after an update.","link":"../core_flows.Cart.Workflows_Cart.refreshCartShippingMethodsWorkflow/page.mdx","depth":4},{"type":"when","condition":"{\n return !!input.force_refresh\n }","depth":"5","steps":[{"type":"workflow","name":"updateTaxLinesWorkflow","description":"Update a cart's tax lines.","link":"../core_flows.Cart.Workflows_Cart.updateTaxLinesWorkflow/page.mdx","depth":5}]},{"type":"workflow","name":"updateCartPromotionsWorkflow","description":"Update a cart's applied promotions to add, replace, or remove them.","link":"../core_flows.Cart.Workflows_Cart.updateCartPromotionsWorkflow/page.mdx","depth":7},{"type":"hook","name":"beforeRefreshingPaymentCollection","description":"","link":"#beforeRefreshingPaymentCollection","depth":8},{"type":"workflow","name":"refreshPaymentCollectionForCartWorkflow","description":"Refresh a cart's payment collection details.","link":"../core_flows.Cart.Workflows_Cart.refreshPaymentCollectionForCartWorkflow/page.mdx","depth":9},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key.","link":"../../../../Locking/functions/core_flows.Locking.releaseLockStep/page.mdx","depth":10}]}} />
<WorkflowDiagram workflow={{"name":"refreshCartItemsWorkflow","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":"hook","name":"setPricingContext","description":"This hook is executed before the shipping options are retrieved. You can consume this hook to return any custom context useful for the prices retrieval of shipping options.\n\nFor example, assuming you have the following custom pricing rule:\n\n```json\n{\n \"attribute\": \"location_id\",\n \"operator\": \"eq\",\n \"value\": \"sloc_123\",\n}\n```\n\nYou can consume the `setPricingContext` hook to add the `location_id` context to the prices calculation:\n\n```ts\nimport { listShippingOptionsForCartWorkflow } from \"@medusajs/medusa/core-flows\";\nimport { StepResponse } from \"@medusajs/workflows-sdk\";\n\nlistShippingOptionsForCartWorkflow.hooks.setPricingContext((\n { cart, fulfillmentSetIds, additional_data }, { container }\n) => {\n return new StepResponse({\n location_id: \"sloc_123\", // Special price for in-store purchases\n });\n});\n```\n\nThe shipping options' prices will now be retrieved using the context you return.\n\n:::note\n\nLearn more about prices calculation context in the [Prices Calculation](https://docs.medusajs.com/resources/commerce-modules/pricing/price-calculation) documentation.\n\n:::","link":"#setPricingContext","depth":2},{"type":"when","condition":"{\n return !!input.force_refresh\n }","depth":"3","steps":[{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":3},{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":3},{"type":"step","name":"getVariantPriceSetsStep","description":"This step retrieves the calculated price sets of the specified variants.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.getVariantPriceSetsStep/page.mdx","depth":3},{"type":"step","name":"validateVariantPricesStep","description":"This step validates the specified variant objects to ensure they have prices.\nIf not valid, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateVariantPricesStep/page.mdx","depth":3},{"type":"step","name":"updateLineItemsStep","description":"This step updates a cart's line items.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateLineItemsStep/page.mdx","depth":3}]},{"type":"workflow","name":"refreshCartShippingMethodsWorkflow","description":"Refresh a cart's shipping methods after an update.","link":"../core_flows.Cart.Workflows_Cart.refreshCartShippingMethodsWorkflow/page.mdx","depth":4},{"type":"when","condition":"{\n return !!input.force_refresh\n }","depth":"5","steps":[{"type":"workflow","name":"updateTaxLinesWorkflow","description":"Update a cart's tax lines.","link":"../core_flows.Cart.Workflows_Cart.updateTaxLinesWorkflow/page.mdx","depth":5}]},{"type":"workflow","name":"updateCartPromotionsWorkflow","description":"Update a cart's applied promotions to add, replace, or remove them.","link":"../core_flows.Cart.Workflows_Cart.updateCartPromotionsWorkflow/page.mdx","depth":7},{"type":"hook","name":"beforeRefreshingPaymentCollection","description":"","link":"#beforeRefreshingPaymentCollection","depth":8},{"type":"workflow","name":"refreshPaymentCollectionForCartWorkflow","description":"Refresh a cart's payment collection details.","link":"../core_flows.Cart.Workflows_Cart.refreshPaymentCollectionForCartWorkflow/page.mdx","depth":9},{"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":10}]}} />
## Input
@@ -20,7 +20,7 @@ and retrieve their correct pricing after a cart update. This workflow is used by
You can use this workflow within your own customizations or custom workflows, allowing you to refresh the cart's shipping method after making updates to the cart.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/cart/workflows/refresh-cart-shipping-methods.ts#L53" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/refresh-cart-shipping-methods.ts#L53" />
## Examples
@@ -129,7 +129,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"refreshCartShippingMethodsWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key.","link":"../../../../Locking/functions/core_flows.Locking.acquireLockStep/page.mdx","depth":2},{"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":3},{"type":"when","condition":"{\n return !!listShippingOptionsInput?.length\n }","depth":"4","steps":[{"type":"workflow","name":"listShippingOptionsForCartWithPricingWorkflow","description":"List a cart's shipping options with prices.","link":"../core_flows.Cart.Workflows_Cart.listShippingOptionsForCartWithPricingWorkflow/page.mdx","depth":4},{"type":"step","name":"removeShippingMethodFromCartStep","description":"This step removes shipping methods from a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.removeShippingMethodFromCartStep/page.mdx","depth":4},{"type":"step","name":"updateShippingMethodsStep","description":"This step updates a cart's shipping methods.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateShippingMethodsStep/page.mdx","depth":4},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key.","link":"../../../../Locking/functions/core_flows.Locking.releaseLockStep/page.mdx","depth":4}]}]}} />
<WorkflowDiagram workflow={{"name":"refreshCartShippingMethodsWorkflow","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":2},{"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":3},{"type":"when","condition":"{\n return !!listShippingOptionsInput?.length\n }","depth":"4","steps":[{"type":"workflow","name":"listShippingOptionsForCartWithPricingWorkflow","description":"List a cart's shipping options with prices.","link":"../core_flows.Cart.Workflows_Cart.listShippingOptionsForCartWithPricingWorkflow/page.mdx","depth":4},{"type":"step","name":"removeShippingMethodFromCartStep","description":"This step removes shipping methods from a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.removeShippingMethodFromCartStep/page.mdx","depth":4},{"type":"step","name":"updateShippingMethodsStep","description":"This step updates a cart's shipping methods.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateShippingMethodsStep/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":4}]}]}} />
## Input
@@ -26,7 +26,7 @@ payment collection after an update.
You can use this workflow within your own customizations or custom workflows, allowing you to refresh the cart's payment collection after making updates to it in your
custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/cart/workflows/refresh-payment-collection.ts#L57" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/refresh-payment-collection.ts#L57" />
## Examples
@@ -135,7 +135,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"refreshPaymentCollectionForCartWorkflow","steps":[{"type":"when","condition":"{\n return shouldExecute\n }","depth":"1","steps":[{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":1}]},{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key.","link":"../../../../Locking/functions/core_flows.Locking.acquireLockStep/page.mdx","depth":2},{"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":3},{"type":"when","condition":"{\n const valueIsEqual = MathBN.eq(\n cart.payment_collection?.raw_amount ?? -1,\n cart.raw_total\n )\n\n if (valueIsEqual) {\n return cart.payment_collection.currency_code !== cart.currency_code\n }\n\n return shouldExecute\n }","depth":"4","steps":[{"type":"workflow","name":"deletePaymentSessionsWorkflow","description":"Delete payment sessions.","link":"../../../../Payment_Collection/Workflows_Payment_Collection/functions/core_flows.Payment_Collection.Workflows_Payment_Collection.deletePaymentSessionsWorkflow/page.mdx","depth":4},{"type":"step","name":"updatePaymentCollectionStep","description":"This step updates payment collections matching the specified filters.","link":"../../../../Payment_Collection/Steps_Payment_Collection/functions/core_flows.Payment_Collection.Steps_Payment_Collection.updatePaymentCollectionStep/page.mdx","depth":4}]},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key.","link":"../../../../Locking/functions/core_flows.Locking.releaseLockStep/page.mdx","depth":5}]}} />
<WorkflowDiagram workflow={{"name":"refreshPaymentCollectionForCartWorkflow","steps":[{"type":"when","condition":"{\n return shouldExecute\n }","depth":"1","steps":[{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":1}]},{"type":"step","name":"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":2},{"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":3},{"type":"when","condition":"{\n const valueIsEqual = MathBN.eq(\n cart.payment_collection?.raw_amount ?? -1,\n cart.raw_total\n )\n\n if (valueIsEqual) {\n return cart.payment_collection.currency_code !== cart.currency_code\n }\n\n return shouldExecute\n }","depth":"4","steps":[{"type":"workflow","name":"deletePaymentSessionsWorkflow","description":"Delete payment sessions.","link":"../../../../Payment_Collection/Workflows_Payment_Collection/functions/core_flows.Payment_Collection.Workflows_Payment_Collection.deletePaymentSessionsWorkflow/page.mdx","depth":4},{"type":"step","name":"updatePaymentCollectionStep","description":"This step updates payment collections matching the specified filters.","link":"../../../../Payment_Collection/Steps_Payment_Collection/functions/core_flows.Payment_Collection.Steps_Payment_Collection.updatePaymentCollectionStep/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}]}} />
## Input
@@ -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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/cart/workflows/refund-payment-recreate-payment-session.ts#L64" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/refund-payment-recreate-payment-session.ts#L64" />
## Examples
@@ -43,7 +43,7 @@ export async function POST(
"payment_collection_id": "{value}",
"provider_id": "{value}",
"payment_id": "{value}",
"amount": 8
"amount": 47
}
})
@@ -72,7 +72,7 @@ export default async function handleOrderPlaced({
"payment_collection_id": "{value}",
"provider_id": "{value}",
"payment_id": "{value}",
"amount": 8
"amount": 47
}
})
@@ -101,7 +101,7 @@ export default async function myCustomJob(
"payment_collection_id": "{value}",
"provider_id": "{value}",
"payment_id": "{value}",
"amount": 8
"amount": 47
}
})
@@ -130,7 +130,7 @@ const myWorkflow = createWorkflow(
"payment_collection_id": "{value}",
"provider_id": "{value}",
"payment_id": "{value}",
"amount": 8
"amount": 47
}
})
}
@@ -30,7 +30,7 @@ by the [Set Cart's Customer Store API Route](https://docs.medusajs.com/api/store
You can use this workflow within your own customizations or custom workflows, allowing you to set the cart's customer within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/cart/workflows/transfer-cart-customer.ts#L53" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/transfer-cart-customer.ts#L53" />
## Examples
@@ -143,7 +143,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"transferCartCustomerWorkflow","steps":[{"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":1},{"type":"when","condition":"shouldTransfer","depth":"2","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key.","link":"../../../../Locking/functions/core_flows.Locking.acquireLockStep/page.mdx","depth":2},{"type":"step","name":"updateCartsStep","description":"This step updates a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateCartsStep/page.mdx","depth":2},{"type":"workflow","name":"refreshCartItemsWorkflow","description":"Refresh a cart's details after an update.","link":"../core_flows.Cart.Workflows_Cart.refreshCartItemsWorkflow/page.mdx","depth":2},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":2},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key.","link":"../../../../Locking/functions/core_flows.Locking.releaseLockStep/page.mdx","depth":2}]}]}} />
<WorkflowDiagram workflow={{"name":"transferCartCustomerWorkflow","steps":[{"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":1},{"type":"when","condition":"shouldTransfer","depth":"2","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":2},{"type":"step","name":"updateCartsStep","description":"This step updates a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateCartsStep/page.mdx","depth":2},{"type":"workflow","name":"refreshCartItemsWorkflow","description":"Refresh a cart's details after an update.","link":"../core_flows.Cart.Workflows_Cart.refreshCartItemsWorkflow/page.mdx","depth":2},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/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":2}]}]}} />
## Input
@@ -23,7 +23,7 @@ that need to be applied to the cart's line items and shipping methods based on t
You can use this workflow within your own customizations or custom workflows, allowing you to update a cart's promotions within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/cart/workflows/update-cart-promotions.ts#L76" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/update-cart-promotions.ts#L76" />
## Examples
@@ -144,7 +144,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"updateCartPromotionsWorkflow","steps":[{"type":"when","condition":"{\n return !input.cart\n }","depth":"1","steps":[{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":1}]},{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key.","link":"../../../../Locking/functions/core_flows.Locking.acquireLockStep/page.mdx","depth":2},{"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":3},{"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":4},{"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":5},{"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":6},{"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":7},{"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":7},{"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":7},{"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":7},{"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":7},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key.","link":"../../../../Locking/functions/core_flows.Locking.releaseLockStep/page.mdx","depth":8}]}} />
<WorkflowDiagram workflow={{"name":"updateCartPromotionsWorkflow","steps":[{"type":"when","condition":"{\n return !input.cart\n }","depth":"1","steps":[{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":1}]},{"type":"step","name":"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":2},{"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":3},{"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":4},{"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":5},{"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":6},{"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":7},{"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":7},{"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":7},{"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":7},{"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":7},{"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":8}]}} />
## Input
@@ -41,7 +41,7 @@ then update any associated details related to the cart in the workflow's hook.
You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around updating a cart.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/cart/workflows/update-cart.ts#L81" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/update-cart.ts#L81" />
## Examples
@@ -202,7 +202,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"updateCartWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key.","link":"../../../../Locking/functions/core_flows.Locking.acquireLockStep/page.mdx","depth":1},{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":2},{"type":"step","name":"findSalesChannelStep","description":"This step either retrieves a sales channel either using the ID provided as an input, or, if no ID\nis provided, the default sales channel of the first store.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.findSalesChannelStep/page.mdx","depth":3},{"type":"step","name":"findOrCreateCustomerStep","description":"This step finds or creates a customer based on the provided ID or email. It prioritizes finding the customer by ID, then by email.\n\nThe step creates a new customer either if:\n\n- No customer is found with the provided ID and email;\n- Or if it found the customer by ID but their email does not match the email in the input.\n\nThe step returns the details of the customer found or created, along with their email.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.findOrCreateCustomerStep/page.mdx","depth":3},{"type":"when","condition":"{\n return !!data.input.region_id\n }","depth":"4","steps":[{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":4}]},{"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":5},{"type":"when","condition":"{\n return !!regionUpdated\n }","depth":"6","steps":[{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":6}]},{"type":"step","name":"updateCartsStep","description":"This step updates a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateCartsStep/page.mdx","depth":7},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":7},{"type":"when","condition":"{\n return !!regionUpdated\n }","depth":"8","steps":[{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":8},{"type":"step","name":"deleteLineItemsStep","description":"This step deletes line items.","link":"../../../../Line_Item/Steps_Line_Item/functions/core_flows.Line_Item.Steps_Line_Item.deleteLineItemsStep/page.mdx","depth":8}]},{"type":"workflow","name":"refreshCartItemsWorkflow","description":"Refresh a cart's details after an update.","link":"../core_flows.Cart.Workflows_Cart.refreshCartItemsWorkflow/page.mdx","depth":9},{"type":"hook","name":"cartUpdated","description":"","link":"#cartUpdated","depth":10},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key.","link":"../../../../Locking/functions/core_flows.Locking.releaseLockStep/page.mdx","depth":11}]}} />
<WorkflowDiagram workflow={{"name":"updateCartWorkflow","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":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":2},{"type":"step","name":"findSalesChannelStep","description":"This step either retrieves a sales channel either using the ID provided as an input, or, if no ID\nis provided, the default sales channel of the first store.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.findSalesChannelStep/page.mdx","depth":3},{"type":"step","name":"findOrCreateCustomerStep","description":"This step finds or creates a customer based on the provided ID or email. It prioritizes finding the customer by ID, then by email.\n\nThe step creates a new customer either if:\n\n- No customer is found with the provided ID and email;\n- Or if it found the customer by ID but their email does not match the email in the input.\n\nThe step returns the details of the customer found or created, along with their email.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.findOrCreateCustomerStep/page.mdx","depth":3},{"type":"when","condition":"{\n return !!data.input.region_id\n }","depth":"4","steps":[{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":4}]},{"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":5},{"type":"when","condition":"{\n return !!regionUpdated\n }","depth":"6","steps":[{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":6}]},{"type":"step","name":"updateCartsStep","description":"This step updates a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateCartsStep/page.mdx","depth":7},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":7},{"type":"when","condition":"{\n return !!regionUpdated\n }","depth":"8","steps":[{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":8},{"type":"step","name":"deleteLineItemsStep","description":"This step deletes line items.","link":"../../../../Line_Item/Steps_Line_Item/functions/core_flows.Line_Item.Steps_Line_Item.deleteLineItemsStep/page.mdx","depth":8}]},{"type":"workflow","name":"refreshCartItemsWorkflow","description":"Refresh a cart's details after an update.","link":"../core_flows.Cart.Workflows_Cart.refreshCartItemsWorkflow/page.mdx","depth":9},{"type":"hook","name":"cartUpdated","description":"","link":"#cartUpdated","depth":10},{"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":11}]}} />
## Input
@@ -30,7 +30,7 @@ by the [Update Line Item Store API Route](https://docs.medusajs.com/api/store#ca
You can use this workflow within your own customizations or custom workflows, allowing you to update a line item's details in your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/cart/workflows/update-line-item-in-cart.ts#L108" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/update-line-item-in-cart.ts#L108" />
## Examples
@@ -155,7 +155,7 @@ const myWorkflow = createWorkflow(
## Steps
<WorkflowDiagram workflow={{"name":"updateLineItemInCartWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key.","link":"../../../../Locking/functions/core_flows.Locking.acquireLockStep/page.mdx","depth":1},{"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":"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":3},{"type":"hook","name":"setPricingContext","description":"This hook is executed before the shipping options are retrieved. You can consume this hook to return any custom context useful for the prices retrieval of shipping options.\n\nFor example, assuming you have the following custom pricing rule:\n\n```json\n{\n \"attribute\": \"location_id\",\n \"operator\": \"eq\",\n \"value\": \"sloc_123\",\n}\n```\n\nYou can consume the `setPricingContext` hook to add the `location_id` context to the prices calculation:\n\n```ts\nimport { listShippingOptionsForCartWorkflow } from \"@medusajs/medusa/core-flows\";\nimport { StepResponse } from \"@medusajs/workflows-sdk\";\n\nlistShippingOptionsForCartWorkflow.hooks.setPricingContext((\n { cart, fulfillmentSetIds, additional_data }, { container }\n) => {\n return new StepResponse({\n location_id: \"sloc_123\", // Special price for in-store purchases\n });\n});\n```\n\nThe shipping options' prices will now be retrieved using the context you return.\n\n:::note\n\nLearn more about prices calculation context in the [Prices Calculation](https://docs.medusajs.com/resources/commerce-modules/pricing/price-calculation) documentation.\n\n:::","link":"#setPricingContext","depth":4},{"type":"when","condition":"{\n return !!variantIds.length\n }","depth":"5","steps":[{"type":"step","name":"validateVariantPricesStep","description":"This step validates the specified variant objects to ensure they have prices.\nIf not valid, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateVariantPricesStep/page.mdx","depth":5}]},{"type":"workflow","name":"confirmVariantInventoryWorkflow","description":"Validate that a variant is in-stock before adding to the cart.","link":"../core_flows.Cart.Workflows_Cart.confirmVariantInventoryWorkflow/page.mdx","depth":6},{"type":"step","name":"updateLineItemsStepWithSelector","description":"This step updates line items.","link":"../../../../Line_Item/Steps_Line_Item/functions/core_flows.Line_Item.Steps_Line_Item.updateLineItemsStepWithSelector/page.mdx","depth":7},{"type":"workflow","name":"refreshCartItemsWorkflow","description":"Refresh a cart's details after an update.","link":"../core_flows.Cart.Workflows_Cart.refreshCartItemsWorkflow/page.mdx","depth":8},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":9},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key.","link":"../../../../Locking/functions/core_flows.Locking.releaseLockStep/page.mdx","depth":9}]}} />
<WorkflowDiagram workflow={{"name":"updateLineItemInCartWorkflow","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":"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":"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":3},{"type":"hook","name":"setPricingContext","description":"This hook is executed before the shipping options are retrieved. You can consume this hook to return any custom context useful for the prices retrieval of shipping options.\n\nFor example, assuming you have the following custom pricing rule:\n\n```json\n{\n \"attribute\": \"location_id\",\n \"operator\": \"eq\",\n \"value\": \"sloc_123\",\n}\n```\n\nYou can consume the `setPricingContext` hook to add the `location_id` context to the prices calculation:\n\n```ts\nimport { listShippingOptionsForCartWorkflow } from \"@medusajs/medusa/core-flows\";\nimport { StepResponse } from \"@medusajs/workflows-sdk\";\n\nlistShippingOptionsForCartWorkflow.hooks.setPricingContext((\n { cart, fulfillmentSetIds, additional_data }, { container }\n) => {\n return new StepResponse({\n location_id: \"sloc_123\", // Special price for in-store purchases\n });\n});\n```\n\nThe shipping options' prices will now be retrieved using the context you return.\n\n:::note\n\nLearn more about prices calculation context in the [Prices Calculation](https://docs.medusajs.com/resources/commerce-modules/pricing/price-calculation) documentation.\n\n:::","link":"#setPricingContext","depth":4},{"type":"when","condition":"{\n return !!variantIds.length\n }","depth":"5","steps":[{"type":"step","name":"validateVariantPricesStep","description":"This step validates the specified variant objects to ensure they have prices.\nIf not valid, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateVariantPricesStep/page.mdx","depth":5}]},{"type":"workflow","name":"confirmVariantInventoryWorkflow","description":"Validate that a variant is in-stock before adding to the cart.","link":"../core_flows.Cart.Workflows_Cart.confirmVariantInventoryWorkflow/page.mdx","depth":6},{"type":"step","name":"updateLineItemsStepWithSelector","description":"This step updates line items.","link":"../../../../Line_Item/Steps_Line_Item/functions/core_flows.Line_Item.Steps_Line_Item.updateLineItemsStepWithSelector/page.mdx","depth":7},{"type":"workflow","name":"refreshCartItemsWorkflow","description":"Refresh a cart's details after an update.","link":"../core_flows.Cart.Workflows_Cart.refreshCartItemsWorkflow/page.mdx","depth":8},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":9},{"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
@@ -20,7 +20,7 @@ by the [Calculate Taxes Store API Route](https://docs.medusajs.com/api/store#car
You can use this workflow within your own customizations or custom workflows, allowing you to update a cart's tax lines in your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/cart/workflows/update-tax-lines.ts#L123" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/update-tax-lines.ts#L123" />
## 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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/common/workflows/batch-links.ts#L67" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/common/workflows/batch-links.ts#L67" />
## 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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/common/workflows/create-links.ts#L38" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/common/workflows/dismiss-links.ts#L38" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/common/workflows/update-links.ts#L43" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/customer/workflows/create-customer-account.ts#L54" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/customer/workflows/create-addresses.ts#L75" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/customer/workflows/create-customers.ts#L54" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/customer/workflows/create-customers.ts#L54" />
## 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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/customer/workflows/delete-addresses.ts#L52" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/customer/workflows/delete-customers.ts#L46" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/customer/workflows/remove-customer-account.ts#L43" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/customer/workflows/update-addresses.ts#L66" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/customer/workflows/update-customers.ts#L60" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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": "Taylor"
"name": "Bradford"
})
}
)
@@ -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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/customer-group/workflows/create-customer-groups.ts#L52" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/customer-group/workflows/delete-customer-groups.ts#L34" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/customer-group/workflows/link-customer-groups-customer.ts#L37" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/customer-group/workflows/link-customers-customer-group.ts#L37" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/customer-group/workflows/update-customer-groups.ts#L57" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/defaults/workflows/create-defaults.ts#L25" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/defaults/workflows/create-defaults.ts#L25" />
## Examples
@@ -28,7 +28,7 @@ This workflow adds items to a draft order. It's used by the
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around adding items to
a draft order.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/draft-order/workflows/add-draft-order-items.ts#L50" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/add-draft-order-items.ts#L50" />
## Examples
@@ -19,7 +19,7 @@ This workflow adds promotions to a draft order. It's used by the
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around adding promotions to
a draft order.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/draft-order/workflows/add-draft-order-promotions.ts#L59" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/add-draft-order-promotions.ts#L59" />
## Examples
@@ -21,7 +21,7 @@ This workflow adds shipping methods to a draft order. It's used by the
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around adding shipping methods to
a draft order.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/draft-order/workflows/add-draft-order-shipping-methods.ts#L99" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/add-draft-order-shipping-methods.ts#L99" />
## Examples
@@ -21,7 +21,7 @@ The draft order edit can later be requested using [requestDraftOrderEditWorkflow
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
creating a draft order edit request.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/draft-order/workflows/begin-draft-order-edit.ts#L35" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/begin-draft-order-edit.ts#L35" />
## Examples
@@ -19,7 +19,7 @@ This workflow cancels a draft order edit. It's used by the
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
cancelling a draft order edit.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/draft-order/workflows/cancel-draft-order-edit.ts#L52" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/cancel-draft-order-edit.ts#L52" />
## Examples
@@ -23,7 +23,7 @@ This workflow confirms a draft order edit. It's used by the
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
confirming a draft order edit.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/draft-order/workflows/confirm-draft-order-edit.ts#L59" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/confirm-draft-order-edit.ts#L59" />
## Examples
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
"my-workflow",
() => {
const data = convertDraftOrderStep({
"id": "id_whh0Y2eTDhVmyR"
"id": "id_Z9SbqVSAUJ"
})
}
)
@@ -19,7 +19,7 @@ This workflow converts a draft order to a pending order. It's used by the
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
converting a draft order to a pending order.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/draft-order/workflows/convert-draft-order.ts#L97" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/convert-draft-order.ts#L97" />
## Examples
@@ -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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/draft-order/workflows/delete-draft-order.ts#L59" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/delete-draft-order.ts#L59" />
## Examples
@@ -19,7 +19,7 @@ This workflow removes an item that was added or updated in a draft order edit. I
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
removing an item from a draft order edit.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-item.ts#L48" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-item.ts#L48" />
## Examples
@@ -19,7 +19,7 @@ This workflow removes a shipping method that was added to an edited draft order.
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
removing a shipping method from an edited draft order.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-shipping-method.ts#L52" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-shipping-method.ts#L52" />
## Examples
@@ -19,7 +19,7 @@ This workflow removes promotions from a draft order edit. It's used by the
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
removing promotions from a draft order edit.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-promotions.ts#L60" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-promotions.ts#L60" />
## Examples
@@ -19,7 +19,7 @@ This workflow removes an existing shipping method from a draft order edit. It's
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
removing a shipping method from a draft order edit.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-shipping-method.ts#L60" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-shipping-method.ts#L60" />
## Examples
@@ -21,7 +21,7 @@ This workflow requests a draft order edit. It's used by the
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
requesting a draft order edit.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/draft-order/workflows/request-draft-order-edit.ts#L71" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/request-draft-order-edit.ts#L71" />
## Examples
@@ -19,7 +19,7 @@ This workflow updates a new item that was added to a draft order edit. It's used
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
updating a new item in a draft order edit.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-item.ts#L51" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-item.ts#L51" />
## Examples
@@ -19,7 +19,7 @@ This workflow updates a new shipping method that was added to a draft order edit
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
updating a new shipping method in a draft order edit.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-shipping-method.ts#L56" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-shipping-method.ts#L56" />
## Examples
@@ -19,7 +19,7 @@ This workflow updates an item in a draft order edit. It's used by the
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
updating an item in a draft order edit.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/draft-order/workflows/update-draft-order-item.ts#L53" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/update-draft-order-item.ts#L53" />
## Examples
@@ -21,7 +21,7 @@ This workflow updates an existing shipping method in a draft order edit. It's us
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
updating an existing shipping method in a draft order edit.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/draft-order/workflows/update-draft-order-shipping-method.ts#L79" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/update-draft-order-shipping-method.ts#L79" />
## Examples
@@ -25,7 +25,7 @@ using [requestDraftOrderEditWorkflow](../core_flows.Draft_Order.Workflows_Draft_
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
updating a draft order.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/draft-order/workflows/update-draft-order.ts#L149" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/update-draft-order.ts#L149" />
## Examples
@@ -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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/file/workflows/delete-files.ts#L29" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/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/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/file/workflows/upload-files.ts#L72" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/file/workflows/upload-files.ts#L72" />
## Examples
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
"my-workflow",
() => {
const data = createFulfillmentSets({
"name": "Annabelle",
"name": "Kraig",
"type": "{value}"
})
}
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
"my-workflow",
() => {
const data = createServiceZonesStep({
"name": "Virgie",
"name": "Lilliana",
"fulfillment_set_id": "{value}"
})
}
@@ -24,7 +24,7 @@ const myWorkflow = createWorkflow(
const data = createShippingOptionRulesStep({
"data": [{
"attribute": "{value}",
"operator": "in",
"operator": "lte",
"value": "{value}",
"shipping_option_id": "{value}"
}]
@@ -29,10 +29,10 @@ const myWorkflow = createWorkflow(
"my-workflow",
() => {
const data = createShippingOptionsPriceSetsStep({
"id": "id_DEO5cQCfTGP03",
"id": "id_wCIcUqWmRY8",
"prices": [{
"currency_code": "scr",
"amount": 20
"currency_code": "kyd",
"amount": 28
}]
})
}
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
"my-workflow",
() => {
const data = createShippingProfilesStep({
"name": "Maxwell",
"name": "Brant",
"type": "{value}"
})
}
@@ -23,7 +23,7 @@ const myWorkflow = createWorkflow(
() => {
const data = deleteShippingOptionRulesStep({
"ids": [
"id_9ZnEuqriYTUZY6W"
"id_emQPYK88xAxutjqSJiv"
]
})
}
@@ -19,7 +19,7 @@ This workflow manages shipping option rules allowing you to create, update, or d
You can use this workflow within your own customizations or custom workflows, allowing you to
manage shipping option rules within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/fulfillment/workflows/batch-shipping-option-rules.ts#L76" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/batch-shipping-option-rules.ts#L76" />
## Examples
@@ -26,7 +26,7 @@ This depends on the implementation of the fulfillment provider associated with t
You can use this workflow within your own customizations or custom workflows, allowing you to
calculate the prices of shipping options within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/fulfillment/workflows/calculate-shipping-options-prices.ts#L49" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/calculate-shipping-options-prices.ts#L49" />
## Examples
@@ -19,7 +19,7 @@ This workflow cancels a fulfillment. It's used by the
You can use this workflow within your own customizations or custom workflows, allowing you to
cancel a fulfillment within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/fulfillment/workflows/cancel-fulfillment.ts#L34" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/cancel-fulfillment.ts#L34" />
## Examples
@@ -26,7 +26,7 @@ or [useQueryGraphStep](https://docs.medusajs.com/resources/references/medusa-wor
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/fulfillment/workflows/create-fulfillment.ts#L64" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/create-fulfillment.ts#L64" />
## Examples
@@ -26,7 +26,7 @@ or [useQueryGraphStep](https://docs.medusajs.com/resources/references/medusa-wor
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/fulfillment/workflows/create-return-fulfillment.ts#L65" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/create-return-fulfillment.ts#L65" />
## Examples
@@ -19,7 +19,7 @@ This workflow creates one or more service zones. It's used by the
You can use this workflow within your own customizations or custom workflows, allowing you to
create service zones within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/fulfillment/workflows/create-service-zones.ts#L45" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/create-service-zones.ts#L45" />
## Examples
@@ -19,7 +19,7 @@ This workflow creates shipments for a fulfillment. It's used by the
You can use this workflow within your own customizations or custom workflows, allowing you to
create shipments within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/fulfillment/workflows/create-shipment.ts#L38" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/create-shipment.ts#L38" />
## Examples
@@ -21,7 +21,7 @@ This workflow creates one or more shipping options. It's used by the
You can use this workflow within your own customizations or custom workflows, allowing you to
create shipping options within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/fulfillment/workflows/create-shipping-options.ts#L96" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/create-shipping-options.ts#L96" />
## Examples
@@ -19,7 +19,7 @@ This workflow creates one or more shipping profiles. It's used by the
You can use this workflow within your own customizations or custom workflows, allowing you to
create shipping profiles within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/fulfillment/workflows/create-shipping-profiles.ts#L35" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/create-shipping-profiles.ts#L35" />
## Examples
@@ -20,7 +20,7 @@ This workflow deletes one or more fulfillment sets. It's used by the
You can use this workflow within your own customizations or custom workflows, allowing you to
delete fulfillment sets within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/fulfillment/workflows/delete-fulfillment-sets.ts#L37" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/delete-fulfillment-sets.ts#L37" />
## Examples
@@ -19,7 +19,7 @@ This workflow deletes one or more service zones. It's used by the
You can use this workflow within your own customizations or custom workflows, allowing you to
delete service zones within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/fulfillment/workflows/delete-service-zones.ts#L34" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/delete-service-zones.ts#L34" />
## Examples
@@ -20,7 +20,7 @@ This workflow deletes one or more shipping options. It's used by the
You can use this workflow within your own customizations or custom workflows, allowing you to
delete shipping options within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/fulfillment/workflows/delete-shipping-options.ts#L27" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/delete-shipping-options.ts#L27" />
## Examples
@@ -19,7 +19,7 @@ This workflow marks a fulfillment as delivered. It's used by the markOrderFulfil
You can use this workflow within your customizations or your own custom workflows, allowing you
to mark a fulfillment as delivered in your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/fulfillment/workflows/mark-fulfillment-as-delivered.ts#L84" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/mark-fulfillment-as-delivered.ts#L84" />
## Examples
@@ -19,7 +19,7 @@ fulfillment, such as [markFulfillmentAsDeliveredWorkflow](../core_flows.Fulfillm
You can use this workflow within your own customizations or custom workflows, allowing you to
update a fulfillment within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/fulfillment/workflows/update-fulfillment.ts#L30" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/update-fulfillment.ts#L30" />
## Examples
@@ -19,7 +19,7 @@ This workflow updates one or more service zones. It's used by the
You can use this workflow within your own customizations or custom workflows, allowing you to
update service zones within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/fulfillment/workflows/update-service-zones.ts#L39" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/update-service-zones.ts#L39" />
## Examples
@@ -29,7 +29,7 @@ Learn more about adding rules to the shipping option's prices in the Pricing Mod
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/fulfillment/workflows/update-shipping-options.ts#L53" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/update-shipping-options.ts#L53" />
## Examples
@@ -19,7 +19,7 @@ This workflow updates one or more shipping profiles. It's used by the
You can use this workflow within your own customizations or custom workflows, allowing you to
update shipping profiles within your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/fulfillment/workflows/update-shipping-profiles.ts#L40" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/update-shipping-profiles.ts#L40" />
## Examples
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
"my-workflow",
() => {
const data = updateInventoryItemsStep({
"id": "id_YHnxn0PDACw"
"id": "id_AeUmXgZCoUc0pHoDGbcp"
})
}
)
@@ -20,8 +20,8 @@ const myWorkflow = createWorkflow(
() => {
const data = validateInventoryDeleteStep({
"inventory_items": [{
"id": "id_MZwmb1QvoXNjr",
"reserved_quantity": 16
"id": "id_y0I2d2zASr",
"reserved_quantity": 0
}]
})
}
@@ -19,7 +19,7 @@ This workflow creates, updates and deletes inventory levels in bulk.
You can use this workflow within your own customizations or custom workflows, allowing you
to manage inventory levels in your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/inventory/workflows/batch-inventory-item-levels.ts#L81" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/inventory/workflows/batch-inventory-item-levels.ts#L81" />
## Examples
@@ -22,7 +22,7 @@ Use `batchInventoryItemLevels` instead.
:::
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/inventory/workflows/bulk-create-delete-levels.ts#L25" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/inventory/workflows/bulk-create-delete-levels.ts#L25" />
## Examples
@@ -20,7 +20,7 @@ This workflow creates one or more inventory items. It's used by the
You can use this workflow within your own customizations or custom workflows, allowing you
to create inventory items in your custom flows.
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/core/core-flows/src/inventory/workflows/create-inventory-items.ts#L110" />
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/inventory/workflows/create-inventory-items.ts#L110" />
## Examples
Loaded 100 of 344 files, more files were not shown because too many files have changed in this diff. Show more