docs: [23/n] generate core-flows reference (#8807)
This commit is contained in:
1 parent
2b67b87137
commit
6470168526
26 files changed
+639
No files matched your search
+20
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/addShippingMethodToWorkflow
|
||||||
|
sidebar_label: addShippingMethodToWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# addShippingMethodToWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `addShippingMethodToWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow adds shipping methods to a cart.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"addShippingMethodToWorkflow","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/v2/advanced-development/modules/remote-query).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":1},{"type":"step","name":"validateCartShippingOptionsStep","description":"This step validates shipping options to ensure they can be applied on a cart.","link":"../../../../core_flows.Steps_Cart/page.mdx#validatecartshippingoptionsstep","depth":2},{"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/v2/advanced-development/modules/remote-query).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":3},{"type":"step","name":"removeShippingMethodFromCartStep","description":"This step removes shipping methods from a cart.","link":"../../../../core_flows.Steps_Cart/page.mdx#removeshippingmethodfromcartstep","depth":4},{"type":"step","name":"addShippingMethodToCartStep","description":"This step adds shipping methods to a cart.","link":"../../../../core_flows.Steps_Cart/page.mdx#addshippingmethodtocartstep","depth":5},{"type":"workflow","name":"updateTaxLinesWorkflow","description":"This workflow updates a cart's tax lines.","link":"../../../../core_flows.Workflows_Cart/page.mdx#updatetaxlinesworkflow","depth":6},{"type":"workflow","name":"updateCartPromotionsWorkflow","description":"This workflow updates a cart's promotions.","link":"../../../../core_flows.Workflows_Cart/page.mdx#updatecartpromotionsworkflow","depth":7}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"AddShippingMethodToCartWorkflowInput","type":"[AddShippingMethodToCartWorkflowInput](../../../../interfaces/core_flows.AddShippingMethodToCartWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="addShippingMethodToWorkflow"/>
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/addToCartWorkflow
|
||||||
|
sidebar_label: addToCartWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# addToCartWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `addToCartWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow adds items to a cart.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"addToCartWorkflow","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/v2/advanced-development/modules/remote-query).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":1},{"type":"step","name":"validateVariantPricesStep","description":"This step validates the specified variant objects to ensure they have prices.","link":"../../../../core_flows.Steps_Cart/page.mdx#validatevariantpricesstep","depth":2},{"type":"step","name":"getLineItemActionsStep","description":"This step returns lists of cart line items to create or update based on the \nprovided input.","link":"../../../../core_flows.Steps_Cart/page.mdx#getlineitemactionsstep","depth":3},{"type":"workflow","name":"confirmVariantInventoryWorkflow","description":"This workflow confirms for one or more variants that their inventory has a required quantity.","link":"../../../../core_flows.Workflows_Cart/page.mdx#confirmvariantinventoryworkflow","depth":4},{"type":"step","name":"createLineItemsStep","description":"This step creates line item in a cart.","link":"../../../../core_flows.Steps_Cart/page.mdx#createlineitemsstep","depth":5},{"type":"step","name":"updateLineItemsStep","description":"This step updates a cart's line items.","link":"../../../../core_flows.Steps_Cart/page.mdx#updatelineitemsstep","depth":5},{"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/v2/advanced-development/modules/remote-query).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":6},{"type":"step","name":"refreshCartShippingMethodsStep","description":"This step refreshes the shipping methods of a cart.","link":"../../../../core_flows.Steps_Cart/page.mdx#refreshcartshippingmethodsstep","depth":7},{"type":"workflow","name":"updateTaxLinesWorkflow","description":"This workflow updates a cart's tax lines.","link":"../../../../core_flows.Workflows_Cart/page.mdx#updatetaxlinesworkflow","depth":7},{"type":"workflow","name":"updateCartPromotionsWorkflow","description":"This workflow updates a cart's promotions.","link":"../../../../core_flows.Workflows_Cart/page.mdx#updatecartpromotionsworkflow","depth":8},{"type":"workflow","name":"refreshPaymentCollectionForCartWorkflow","description":"This workflow refreshes the payment collections of a cart.","link":"../../../../core_flows.Workflows_Cart/page.mdx#refreshpaymentcollectionforcartworkflow","depth":9}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"AddToCartWorkflowInputDTO","type":"`AddToCartWorkflowInputDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="addToCartWorkflow"/>
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CartLineItemDTO[]","type":"[CartLineItemDTO](../../../../../cart/interfaces/cart.CartLineItemDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CartLineItemDTO","type":"[CartLineItemDTO](../../../../../cart/interfaces/cart.CartLineItemDTO/page.mdx)","optional":false,"defaultValue":"","description":"The cart line item details.","expandable":false,"children":[{"name":"original_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original subtotal of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item subtotal of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber",Line truncated
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/completeCartWorkflow
|
||||||
|
sidebar_label: completeCartWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# completeCartWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `completeCartWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow completes a cart.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"completeCartWorkflow","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/v2/advanced-development/modules/remote-query).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":1},{"type":"step","name":"validateCartPaymentsStep","description":"This step validates a cart's payment sessions. Their status must\nbe `pending` or `requires_more`.","link":"../../../../core_flows.Steps_Cart/page.mdx#validatecartpaymentsstep","depth":2},{"type":"step","name":"authorizePaymentSessionStep","description":"This step authorizes a payment session.","link":"../../../../core_flows.Steps_Payment/page.mdx#authorizepaymentsessionstep","depth":3},{"type":"step","name":"reserveInventoryStep","description":"This step reserves the quantity of line items from the associated\nvariant's inventory.","link":"../../../../core_flows.Steps_Cart/page.mdx#reserveinventorystep","depth":4},{"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/v2/advanced-development/modules/remote-query).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":4},{"type":"step","name":"createOrdersStep","description":"This step creates one or more orders.","link":"../../../../core_flows.Steps_Order/page.mdx#createordersstep","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/v2/advanced-development/modules/remote-link#create-link).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#createremotelinkstep","depth":6},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":7}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CompleteCartWorkflowInput","type":"[CompleteCartWorkflowInput](../../../../types/core_flows.CompleteCartWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="completeCartWorkflow"/>
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"OrderDTO","type":"[OrderDTO](../../../../../fulfillment/interfaces/fulfillment.OrderDTO/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The version of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[OrderStatus](../../../../../fulfillment/types/fulfillment.OrderStatus/page.mdx)","description":"The status of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_tax_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name"Line truncated
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/confirmVariantInventoryWorkflow
|
||||||
|
sidebar_label: confirmVariantInventoryWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# confirmVariantInventoryWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `confirmVariantInventoryWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow confirms for one or more variants that their inventory has a required quantity.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"confirmVariantInventoryWorkflow","steps":[{"type":"step","name":"confirmInventoryStep","description":"This step confirms for one or more variants that their inventory has a required quantity.","link":"../../../../core_flows.Steps_Cart/page.mdx#confirminventorystep","depth":1}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ConfirmVariantInventoryWorkflowInputDTO","type":"`ConfirmVariantInventoryWorkflowInputDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="confirmVariantInventoryWorkflow"/>
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ConfirmVariantInventoryWorkflowOutput","type":"[ConfirmVariantInventoryWorkflowOutput](../../../../interfaces/core_flows.ConfirmVariantInventoryWorkflowOutput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"items","type":"`object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"inventory_item_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"required_quantity","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="confirmVariantInventoryWorkflow"/>
|
||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/createCartWorkflow
|
||||||
|
sidebar_label: createCartWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# createCartWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `createCartWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow creates a cart.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"createCartWorkflow","steps":[{"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":"../../../../core_flows.Steps_Cart/page.mdx#findsaleschannelstep","depth":1},{"type":"step","name":"findOneOrAnyRegionStep","description":"This step retrieves a region either by the provided ID or the first region in the first store.","link":"../../../../core_flows.Steps_Cart/page.mdx#findoneoranyregionstep","depth":1},{"type":"step","name":"findOrCreateCustomerStep","description":"This step either finds a customer matching the specified ID, or finds / create a customer \nmatching the specified email. If both ID and email are provided, ID takes precedence.","link":"../../../../core_flows.Steps_Cart/page.mdx#findorcreatecustomerstep","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/v2/advanced-development/modules/remote-query).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":2},{"type":"step","name":"validateVariantPricesStep","description":"This step validates the specified variant objects to ensure they have prices.","link":"../../../../core_flows.Steps_Cart/page.mdx#validatevariantpricesstep","depth":3},{"type":"workflow","name":"confirmVariantInventoryWorkflow","description":"This workflow confirms for one or more variants that their inventory has a required quantity.","link":"../../../../core_flows.Workflows_Cart/page.mdx#confirmvariantinventoryworkflow","depth":4},{"type":"step","name":"getVariantPriceSetsStep","description":"This step retrieves the calculated price sets of the specified variants.","link":"../../../../core_flows.Steps_Cart/page.mdx#getvariantpricesetsstep","depth":5},{"type":"step","name":"createCartsStep","description":"This step creates a cart.","link":"../../../../core_flows.Steps_Cart/page.mdx#createcartsstep","depth":6},{"type":"workflow","name":"updateTaxLinesWorkflow","description":"This workflow updates a cart's tax lines.","link":"../../../../core_flows.Workflows_Cart/page.mdx#updatetaxlinesworkflow","depth":7},{"type":"workflow","name":"updateCartPromotionsWorkflow","description":"This workflow updates a cart's promotions.","link":"../../../../core_flows.Workflows_Cart/page.mdx#updatecartpromotionsworkflow","depth":8},{"type":"workflow","name":"refreshPaymentCollectionForCartWorkflow","description":"This workflow refreshes the payment collections of a cart.","link":"../../../../core_flows.Workflows_Cart/page.mdx#refreshpaymentcollectionforcartworkflow","depth":9},{"type":"hook","name":"cartCreated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#cartCreated","depth":10}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CreateCartWorkflowInputDTO & AdditionalData","type":"`CreateCartWorkflowInputDTO` & [AdditionalData](../../../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CreateCartWorkflowInputDTO","type":"`CreateCartWorkflowInputDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]},{"name":"AdditionalData","type":"[AdditionalData](../../../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"additional_data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createCartWorkflow"/>
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CartDTO","type":"[CartDTO](../../../../../cart/interfaces/cart.CartDTO/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the cart","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":Line truncated
|
||||||
|
|
||||||
|
## Hooks
|
||||||
|
|
||||||
|
### cartCreated
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { createCartWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
createCartWorkflow.hooks.cartCreated(
|
||||||
|
async (({ cart, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart","type":"[CartDTO](../../../../../cart/interfaces/cart.CartDTO/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the cart","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The subtotal of the cart. (Excluding taxes)","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discount_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The discount total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discount_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The discount tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"gift_card_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The gift card total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"gift_card_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The gift card tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The shipping total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The shipping subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The shipping tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_shipping_total","type":"[BigNumberValue](../../../../../cart/types/cart.BLine truncated
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/createPaymentCollectionForCartWorkflow
|
||||||
|
sidebar_label: createPaymentCollectionForCartWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# createPaymentCollectionForCartWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `createPaymentCollectionForCartWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow creates a payment collection for a cart.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"createPaymentCollectionForCartWorkflow","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/v2/advanced-development/modules/remote-query).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":1},{"type":"step","name":"validateExistingPaymentCollectionStep","description":"This step validates that a cart doesn't have a payment collection.","link":"../../../../core_flows.Workflows_Cart/page.mdx#validateexistingpaymentcollectionstep","depth":2},{"type":"step","name":"createPaymentCollectionsStep","description":"This step creates payment collections in a cart.","link":"../../../../core_flows.Steps_Cart/page.mdx#createpaymentcollectionsstep","depth":3},{"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/v2/advanced-development/modules/remote-link#create-link).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#createremotelinkstep","depth":4}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CreatePaymentCollectionForCartWorkflowInputDTO","type":"`CreatePaymentCollectionForCartWorkflowInputDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createPaymentCollectionForCartWorkflow"/>
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/listShippingOptionsForCartWorkflow
|
||||||
|
sidebar_label: listShippingOptionsForCartWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# listShippingOptionsForCartWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `listShippingOptionsForCartWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow lists the shipping options of a cart.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"listShippingOptionsForCartWorkflow","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/v2/advanced-development/modules/remote-query).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":1}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ListShippingOptionsForCartWorkflowInputDTO","type":"`ListShippingOptionsForCartWorkflowInputDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="listShippingOptionsForCartWorkflow"/>
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"any[]","type":"`any`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"any","type":"`any`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="listShippingOptionsForCartWorkflow"/>
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/refreshPaymentCollectionForCartWorkflow
|
||||||
|
sidebar_label: refreshPaymentCollectionForCartWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# refreshPaymentCollectionForCartWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `refreshPaymentCollectionForCartWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow refreshes the payment collections of a cart.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"refreshPaymentCollectionForCartWorkflow","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/v2/advanced-development/modules/remote-query).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":1},{"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 true\n }","depth":"2","steps":[{"type":"workflow","name":"deletePaymentSessionsWorkflow","description":"This workflow deletes one or more payment sessions.","link":"../../../../core_flows.Workflows_Payment_Collection/page.mdx#deletepaymentsessionsworkflow","depth":2},{"type":"step","name":"updatePaymentCollectionStep","description":"This step updates payment collections matching the specified filters.","link":"../../../../core_flows.Steps_Payment_Collection/page.mdx#updatepaymentcollectionstep","depth":2}]}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"RefreshPaymentCollectionForCartWorklowInput","type":"[RefreshPaymentCollectionForCartWorklowInput](../../../../types/core_flows.RefreshPaymentCollectionForCartWorklowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="refreshPaymentCollectionForCartWorkflow"/>
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/updateCartPromotionsWorkflow
|
||||||
|
sidebar_label: updateCartPromotionsWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# updateCartPromotionsWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `updateCartPromotionsWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow updates a cart's promotions.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"updateCartPromotionsWorkflow","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/v2/advanced-development/modules/remote-query).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":1},{"type":"step","name":"getPromotionCodesToApply","description":"This step retrieves the promotion codes to apply on a cart.","link":"../../../../core_flows.Steps_Cart/page.mdx#getpromotioncodestoapply","depth":2},{"type":"step","name":"getActionsToComputeFromPromotionsStep","description":"This step retrieves the actions to compute based on the promotions\napplied on a cart.","link":"../../../../core_flows.Steps_Cart/page.mdx#getactionstocomputefrompromotionsstep","depth":3},{"type":"step","name":"prepareAdjustmentsFromPromotionActionsStep","description":"This step prepares the line item or shipping method adjustments using\nactions computed by the Promotion Module.","link":"../../../../core_flows.Steps_Cart/page.mdx#prepareadjustmentsfrompromotionactionsstep","depth":4},{"type":"step","name":"removeLineItemAdjustmentsStep","description":"This step removes line item adjustments from a cart.","link":"../../../../core_flows.Steps_Cart/page.mdx#removelineitemadjustmentsstep","depth":5},{"type":"step","name":"removeShippingMethodAdjustmentsStep","description":"This step removes shipping method adjustments from a cart.","link":"../../../../core_flows.Steps_Cart/page.mdx#removeshippingmethodadjustmentsstep","depth":5},{"type":"step","name":"createLineItemAdjustmentsStep","description":"This step creates line item adjustments in a cart.","link":"../../../../core_flows.Steps_Cart/page.mdx#createlineitemadjustmentsstep","depth":5},{"type":"step","name":"createShippingMethodAdjustmentsStep","description":"This step creates shipping method adjustments for a cart.","link":"../../../../core_flows.Steps_Cart/page.mdx#createshippingmethodadjustmentsstep","depth":5},{"type":"step","name":"updateCartPromotionsStep","description":"This step updates the promotions applied on a cart.","link":"../../../../core_flows.Steps_Cart/page.mdx#updatecartpromotionsstep","depth":5}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"UpdateCartPromotionsWorkflowInput","type":"[UpdateCartPromotionsWorkflowInput](../../../../types/core_flows.UpdateCartPromotionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"promo_codes","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"action","type":"[ADD](../../../../../utils/PromotionUtils/enums/utils.PromotionUtils.PromotionActions/page.mdx#add) \\| [REMOVE](../../../../../utils/PromotionUtils/enums/utils.PromotionUtils.PromotionActions/page.mdx#remove) \\| [REPLACE](../../../../../utils/PromotionUtils/enums/utils.PromotionUtils.PromotionActions/page.mdx#replace)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateCartPromotionsWorkflow"/>
|
||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/updateCartWorkflow
|
||||||
|
sidebar_label: updateCartWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# updateCartWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `updateCartWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow updates a cart.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"updateCartWorkflow","steps":[{"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":"../../../../core_flows.Steps_Cart/page.mdx#findsaleschannelstep","depth":1},{"type":"step","name":"findOneOrAnyRegionStep","description":"This step retrieves a region either by the provided ID or the first region in the first store.","link":"../../../../core_flows.Steps_Cart/page.mdx#findoneoranyregionstep","depth":1},{"type":"step","name":"findOrCreateCustomerStep","description":"This step either finds a customer matching the specified ID, or finds / create a customer \nmatching the specified email. If both ID and email are provided, ID takes precedence.","link":"../../../../core_flows.Steps_Cart/page.mdx#findorcreatecustomerstep","depth":1},{"type":"step","name":"updateCartsStep","description":"This step updates a cart.","link":"../../../../core_flows.Steps_Cart/page.mdx#updatecartsstep","depth":2},{"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/v2/advanced-development/modules/remote-query).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":3},{"type":"step","name":"refreshCartShippingMethodsStep","description":"This step refreshes the shipping methods of a cart.","link":"../../../../core_flows.Steps_Cart/page.mdx#refreshcartshippingmethodsstep","depth":4},{"type":"workflow","name":"updateTaxLinesWorkflow","description":"This workflow updates a cart's tax lines.","link":"../../../../core_flows.Workflows_Cart/page.mdx#updatetaxlinesworkflow","depth":4},{"type":"workflow","name":"updateCartPromotionsWorkflow","description":"This workflow updates a cart's promotions.","link":"../../../../core_flows.Workflows_Cart/page.mdx#updatecartpromotionsworkflow","depth":5},{"type":"workflow","name":"refreshPaymentCollectionForCartWorkflow","description":"This workflow refreshes the payment collections of a cart.","link":"../../../../core_flows.Workflows_Cart/page.mdx#refreshpaymentcollectionforcartworkflow","depth":6},{"type":"hook","name":"cartUpdated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#cartUpdated","depth":7}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"UpdateCartWorkflowInputDTO & AdditionalData","type":"`UpdateCartWorkflowInputDTO` & [AdditionalData](../../../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"UpdateCartWorkflowInputDTO","type":"`UpdateCartWorkflowInputDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]},{"name":"AdditionalData","type":"[AdditionalData](../../../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"additional_data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateCartWorkflow"/>
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"undefined","type":"`undefined`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"undefined","type":"`undefined`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateCartWorkflow"/>
|
||||||
|
|
||||||
|
## Hooks
|
||||||
|
|
||||||
|
### cartUpdated
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { updateCartWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
updateCartWorkflow.hooks.cartUpdated(
|
||||||
|
async (({ cart, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="cartUpdated"/>
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/updateLineItemInCartWorkflow
|
||||||
|
sidebar_label: updateLineItemInCartWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# updateLineItemInCartWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `updateLineItemInCartWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow updates a cart's line item.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"updateLineItemInCartWorkflow","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/v2/advanced-development/modules/remote-query).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":1},{"type":"step","name":"validateVariantPricesStep","description":"This step validates the specified variant objects to ensure they have prices.","link":"../../../../core_flows.Steps_Cart/page.mdx#validatevariantpricesstep","depth":2},{"type":"workflow","name":"confirmVariantInventoryWorkflow","description":"This workflow confirms for one or more variants that their inventory has a required quantity.","link":"../../../../core_flows.Workflows_Cart/page.mdx#confirmvariantinventoryworkflow","depth":3},{"type":"step","name":"updateLineItemsStepWithSelector","description":"This step updates line items.","link":"../../../../core_flows.Steps_Line_Item/page.mdx#updatelineitemsstepwithselector","depth":4},{"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/v2/advanced-development/modules/remote-query).\n\n","link":"../../../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":5},{"type":"step","name":"refreshCartShippingMethodsStep","description":"This step refreshes the shipping methods of a cart.","link":"../../../../core_flows.Steps_Cart/page.mdx#refreshcartshippingmethodsstep","depth":6},{"type":"workflow","name":"updateCartPromotionsWorkflow","description":"This workflow updates a cart's promotions.","link":"../../../../core_flows.Workflows_Cart/page.mdx#updatecartpromotionsworkflow","depth":7},{"type":"workflow","name":"refreshPaymentCollectionForCartWorkflow","description":"This workflow refreshes the payment collections of a cart.","link":"../../../../core_flows.Workflows_Cart/page.mdx#refreshpaymentcollectionforcartworkflow","depth":8}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"UpdateLineItemInCartWorkflowInputDTO","type":"`UpdateLineItemInCartWorkflowInputDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateLineItemInCartWorkflow"/>
|
||||||
|
|
||||||
|
## Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CartLineItemDTO","type":"[CartLineItemDTO](../../../../../cart/interfaces/cart.CartLineItemDTO/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"original_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original subtotal of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item subtotal of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":faLine truncated
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/updateTaxLinesWorkflow
|
||||||
|
sidebar_label: updateTaxLinesWorkflow
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# updateTaxLinesWorkflow - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `updateTaxLinesWorkflow`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This workflow updates a cart's tax lines.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"updateTaxLinesWorkflow","steps":[{"type":"step","name":"retrieveCartWithLinksStep","description":"This step retrieves a cart's details with its linked records.","link":"../../../../core_flows.Steps_Cart/page.mdx#retrievecartwithlinksstep","depth":1},{"type":"step","name":"getItemTaxLinesStep","description":"This step retrieves the tax lines of the specified line items in a cart.","link":"../../../../core_flows.Steps_Cart/page.mdx#getitemtaxlinesstep","depth":2},{"type":"step","name":"setTaxLinesForItemsStep","description":"This step sets the tax lines of shipping methods and line items in a cart.","link":"../../../../core_flows.Steps_Cart/page.mdx#settaxlinesforitemsstep","depth":3}]}} />
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"UpdateTaxLinesWorkflowInput","type":"[UpdateTaxLinesWorkflowInput](../../../../types/core_flows.UpdateTaxLinesWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"cart_or_cart_id","type":"`string` \\| `CartWorkflowDTO`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"[CartLineItemDTO](../../../../../cart/interfaces/cart.CartLineItemDTO/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"original_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original subtotal of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item subtotal of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/typeLine truncated
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
slug: /references/medusa-workflows/validateExistingPaymentCollectionStep
|
||||||
|
sidebar_label: validateExistingPaymentCollectionStep
|
||||||
|
---
|
||||||
|
|
||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# validateExistingPaymentCollectionStep - Medusa Workflows API Reference
|
||||||
|
|
||||||
|
This documentation provides a reference to the `validateExistingPaymentCollectionStep`. It belongs to the `@medusajs/core-flows` package.
|
||||||
|
|
||||||
|
This step validates that a cart doesn't have a payment collection.
|
||||||
|
|
||||||
|
## Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"cart","type":"[CartDTO](../../../../../cart/interfaces/cart.CartDTO/page.mdx) & `object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the cart","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}Line truncated
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# addShippingMethodToCartWorkflowId
|
||||||
|
|
||||||
|
`Const` **addShippingMethodToCartWorkflowId**: `"add-shipping-method-to-cart"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# addToCartWorkflowId
|
||||||
|
|
||||||
|
`Const` **addToCartWorkflowId**: `"add-to-cart"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# completeCartWorkflowId
|
||||||
|
|
||||||
|
`Const` **completeCartWorkflowId**: `"complete-cart"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# confirmVariantInventoryWorkflowId
|
||||||
|
|
||||||
|
`Const` **confirmVariantInventoryWorkflowId**: `"confirm-item-inventory"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# createCartWorkflowId
|
||||||
|
|
||||||
|
`Const` **createCartWorkflowId**: `"create-cart"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# createPaymentCollectionForCartWorkflowId
|
||||||
|
|
||||||
|
`Const` **createPaymentCollectionForCartWorkflowId**: `"create-payment-collection-for-cart"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# listShippingOptionsForCartWorkflowId
|
||||||
|
|
||||||
|
`Const` **listShippingOptionsForCartWorkflowId**: `"list-shipping-options-for-cart"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# refreshPaymentCollectionForCartWorkflowId
|
||||||
|
|
||||||
|
`Const` **refreshPaymentCollectionForCartWorkflowId**: `"refresh-payment-collection-for-cart"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# updateCartPromotionsWorkflowId
|
||||||
|
|
||||||
|
`Const` **updateCartPromotionsWorkflowId**: `"update-cart-promotions"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# updateCartWorkflowId
|
||||||
|
|
||||||
|
`Const` **updateCartWorkflowId**: `"update-cart"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# updateLineItemInCartWorkflowId
|
||||||
|
|
||||||
|
`Const` **updateLineItemInCartWorkflowId**: `"update-line-item-in-cart"`
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# updateTaxLinesWorkflowId
|
||||||
|
|
||||||
|
`Const` **updateTaxLinesWorkflowId**: `"update-tax-lines"`
|
||||||
+251
@@ -0,0 +1,251 @@
|
|||||||
|
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||||
|
|
||||||
|
# Workflows\_Cart
|
||||||
|
|
||||||
|
## addShippingMethodToWorkflow
|
||||||
|
|
||||||
|
This workflow adds shipping methods to a cart.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"addShippingMethodToWorkflow","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/v2/advanced-development/modules/remote-query).\n\n","link":"../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":1},{"type":"step","name":"validateCartShippingOptionsStep","description":"This step validates shipping options to ensure they can be applied on a cart.","link":"../../core_flows.Steps_Cart/page.mdx#validatecartshippingoptionsstep","depth":2},{"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/v2/advanced-development/modules/remote-query).\n\n","link":"../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":3},{"type":"step","name":"removeShippingMethodFromCartStep","description":"This step removes shipping methods from a cart.","link":"../../core_flows.Steps_Cart/page.mdx#removeshippingmethodfromcartstep","depth":4},{"type":"step","name":"addShippingMethodToCartStep","description":"This step adds shipping methods to a cart.","link":"../../core_flows.Steps_Cart/page.mdx#addshippingmethodtocartstep","depth":5},{"type":"workflow","name":"updateTaxLinesWorkflow","description":"This workflow updates a cart's tax lines.","link":"../../core_flows.Workflows_Cart/page.mdx#updatetaxlinesworkflow","depth":6},{"type":"workflow","name":"updateCartPromotionsWorkflow","description":"This workflow updates a cart's promotions.","link":"../../core_flows.Workflows_Cart/page.mdx#updatecartpromotionsworkflow","depth":7}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"AddShippingMethodToCartWorkflowInput","type":"[AddShippingMethodToCartWorkflowInput](../../interfaces/core_flows.AddShippingMethodToCartWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="addShippingMethodToWorkflow"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## addToCartWorkflow
|
||||||
|
|
||||||
|
This workflow adds items to a cart.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"addToCartWorkflow","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/v2/advanced-development/modules/remote-query).\n\n","link":"../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":1},{"type":"step","name":"validateVariantPricesStep","description":"This step validates the specified variant objects to ensure they have prices.","link":"../../core_flows.Steps_Cart/page.mdx#validatevariantpricesstep","depth":2},{"type":"step","name":"getLineItemActionsStep","description":"This step returns lists of cart line items to create or update based on the \nprovided input.","link":"../../core_flows.Steps_Cart/page.mdx#getlineitemactionsstep","depth":3},{"type":"workflow","name":"confirmVariantInventoryWorkflow","description":"This workflow confirms for one or more variants that their inventory has a required quantity.","link":"../../core_flows.Workflows_Cart/page.mdx#confirmvariantinventoryworkflow","depth":4},{"type":"step","name":"createLineItemsStep","description":"This step creates line item in a cart.","link":"../../core_flows.Steps_Cart/page.mdx#createlineitemsstep","depth":5},{"type":"step","name":"updateLineItemsStep","description":"This step updates a cart's line items.","link":"../../core_flows.Steps_Cart/page.mdx#updatelineitemsstep","depth":5},{"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/v2/advanced-development/modules/remote-query).\n\n","link":"../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":6},{"type":"step","name":"refreshCartShippingMethodsStep","description":"This step refreshes the shipping methods of a cart.","link":"../../core_flows.Steps_Cart/page.mdx#refreshcartshippingmethodsstep","depth":7},{"type":"workflow","name":"updateTaxLinesWorkflow","description":"This workflow updates a cart's tax lines.","link":"../../core_flows.Workflows_Cart/page.mdx#updatetaxlinesworkflow","depth":7},{"type":"workflow","name":"updateCartPromotionsWorkflow","description":"This workflow updates a cart's promotions.","link":"../../core_flows.Workflows_Cart/page.mdx#updatecartpromotionsworkflow","depth":8},{"type":"workflow","name":"refreshPaymentCollectionForCartWorkflow","description":"This workflow refreshes the payment collections of a cart.","link":"../../core_flows.Workflows_Cart/page.mdx#refreshpaymentcollectionforcartworkflow","depth":9}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"AddToCartWorkflowInputDTO","type":"`AddToCartWorkflowInputDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="addToCartWorkflow"/>
|
||||||
|
|
||||||
|
### Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CartLineItemDTO[]","type":"[CartLineItemDTO](../../../cart/interfaces/cart.CartLineItemDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CartLineItemDTO","type":"[CartLineItemDTO](../../../cart/interfaces/cart.CartLineItemDTO/page.mdx)","optional":false,"defaultValue":"","description":"The cart line item details.","expandable":false,"children":[{"name":"original_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_subtotal","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original subtotal of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_tax_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item subtotal of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_tax_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"chilLine truncated
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## completeCartWorkflow
|
||||||
|
|
||||||
|
This workflow completes a cart.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"completeCartWorkflow","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/v2/advanced-development/modules/remote-query).\n\n","link":"../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":1},{"type":"step","name":"validateCartPaymentsStep","description":"This step validates a cart's payment sessions. Their status must\nbe `pending` or `requires_more`.","link":"../../core_flows.Steps_Cart/page.mdx#validatecartpaymentsstep","depth":2},{"type":"step","name":"authorizePaymentSessionStep","description":"This step authorizes a payment session.","link":"../../core_flows.Steps_Payment/page.mdx#authorizepaymentsessionstep","depth":3},{"type":"step","name":"reserveInventoryStep","description":"This step reserves the quantity of line items from the associated\nvariant's inventory.","link":"../../core_flows.Steps_Cart/page.mdx#reserveinventorystep","depth":4},{"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/v2/advanced-development/modules/remote-query).\n\n","link":"../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":4},{"type":"step","name":"createOrdersStep","description":"This step creates one or more orders.","link":"../../core_flows.Steps_Order/page.mdx#createordersstep","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/v2/advanced-development/modules/remote-link#create-link).\n\n","link":"../../core_flows.Steps_Common/page.mdx#createremotelinkstep","depth":6},{"type":"step","name":"emitEventStep","description":"Emit an event.\n\n","link":"../../core_flows.Steps_Common/page.mdx#emiteventstep","depth":7}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CompleteCartWorkflowInput","type":"[CompleteCartWorkflowInput](../../types/core_flows.CompleteCartWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="completeCartWorkflow"/>
|
||||||
|
|
||||||
|
### Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"OrderDTO","type":"[OrderDTO](../../../fulfillment/interfaces/fulfillment.OrderDTO/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The version of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[OrderStatus](../../../fulfillment/types/fulfillment.OrderStatus/page.mdx)","description":"The status of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_subtotal","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_tax_total","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_tax_total","type":"[BigNumberValue](../../../fulfillment/types/fuLine truncated
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## confirmVariantInventoryWorkflow
|
||||||
|
|
||||||
|
This workflow confirms for one or more variants that their inventory has a required quantity.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"confirmVariantInventoryWorkflow","steps":[{"type":"step","name":"confirmInventoryStep","description":"This step confirms for one or more variants that their inventory has a required quantity.","link":"../../core_flows.Steps_Cart/page.mdx#confirminventorystep","depth":1}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ConfirmVariantInventoryWorkflowInputDTO","type":"`ConfirmVariantInventoryWorkflowInputDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="confirmVariantInventoryWorkflow"/>
|
||||||
|
|
||||||
|
### Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ConfirmVariantInventoryWorkflowOutput","type":"[ConfirmVariantInventoryWorkflowOutput](../../interfaces/core_flows.ConfirmVariantInventoryWorkflowOutput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"items","type":"`object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"inventory_item_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"required_quantity","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"location_ids","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="confirmVariantInventoryWorkflow"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## createCartWorkflow
|
||||||
|
|
||||||
|
This workflow creates a cart.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"createCartWorkflow","steps":[{"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":"../../core_flows.Steps_Cart/page.mdx#findsaleschannelstep","depth":1},{"type":"step","name":"findOneOrAnyRegionStep","description":"This step retrieves a region either by the provided ID or the first region in the first store.","link":"../../core_flows.Steps_Cart/page.mdx#findoneoranyregionstep","depth":1},{"type":"step","name":"findOrCreateCustomerStep","description":"This step either finds a customer matching the specified ID, or finds / create a customer \nmatching the specified email. If both ID and email are provided, ID takes precedence.","link":"../../core_flows.Steps_Cart/page.mdx#findorcreatecustomerstep","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/v2/advanced-development/modules/remote-query).\n\n","link":"../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":2},{"type":"step","name":"validateVariantPricesStep","description":"This step validates the specified variant objects to ensure they have prices.","link":"../../core_flows.Steps_Cart/page.mdx#validatevariantpricesstep","depth":3},{"type":"workflow","name":"confirmVariantInventoryWorkflow","description":"This workflow confirms for one or more variants that their inventory has a required quantity.","link":"../../core_flows.Workflows_Cart/page.mdx#confirmvariantinventoryworkflow","depth":4},{"type":"step","name":"getVariantPriceSetsStep","description":"This step retrieves the calculated price sets of the specified variants.","link":"../../core_flows.Steps_Cart/page.mdx#getvariantpricesetsstep","depth":5},{"type":"step","name":"createCartsStep","description":"This step creates a cart.","link":"../../core_flows.Steps_Cart/page.mdx#createcartsstep","depth":6},{"type":"workflow","name":"updateTaxLinesWorkflow","description":"This workflow updates a cart's tax lines.","link":"../../core_flows.Workflows_Cart/page.mdx#updatetaxlinesworkflow","depth":7},{"type":"workflow","name":"updateCartPromotionsWorkflow","description":"This workflow updates a cart's promotions.","link":"../../core_flows.Workflows_Cart/page.mdx#updatecartpromotionsworkflow","depth":8},{"type":"workflow","name":"refreshPaymentCollectionForCartWorkflow","description":"This workflow refreshes the payment collections of a cart.","link":"../../core_flows.Workflows_Cart/page.mdx#refreshpaymentcollectionforcartworkflow","depth":9},{"type":"hook","name":"cartCreated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#cartCreated","depth":10}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CreateCartWorkflowInputDTO & AdditionalData","type":"`CreateCartWorkflowInputDTO` & [AdditionalData](../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CreateCartWorkflowInputDTO","type":"`CreateCartWorkflowInputDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]},{"name":"AdditionalData","type":"[AdditionalData](../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"additional_data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createCartWorkflow"/>
|
||||||
|
|
||||||
|
### Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CartDTO","type":"[CartDTO](../../../cart/interfaces/cart.CartDTO/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the cart","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_subtotal","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_tax_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_tax_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaLine truncated
|
||||||
|
|
||||||
|
### Hooks
|
||||||
|
|
||||||
|
#### cartCreated
|
||||||
|
|
||||||
|
##### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { createCartWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
createCartWorkflow.hooks.cartCreated(
|
||||||
|
async (({ cart, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart","type":"[CartDTO](../../../cart/interfaces/cart.CartDTO/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the cart","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_subtotal","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_tax_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_subtotal","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_tax_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_subtotal","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_tax_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtotal","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The subtotal of the cart. (Excluding taxes)","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tax_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discount_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The discount total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discount_tax_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The discount tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"gift_card_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The gift card total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"gift_card_tax_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The gift card tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The shipping total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_subtotal","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The shipping subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_tax_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The shipping tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_shipping_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original shipping total of the cart.","optional":false,"defaultValue":"","expandabLine truncated
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## validateExistingPaymentCollectionStep
|
||||||
|
|
||||||
|
This step validates that a cart doesn't have a payment collection.
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"cart","type":"[CartDTO](../../../cart/interfaces/cart.CartDTO/page.mdx) & `object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the cart","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_subtotal","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_tax_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_tax_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":Line truncated
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## createPaymentCollectionForCartWorkflow
|
||||||
|
|
||||||
|
This workflow creates a payment collection for a cart.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"createPaymentCollectionForCartWorkflow","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/v2/advanced-development/modules/remote-query).\n\n","link":"../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":1},{"type":"step","name":"validateExistingPaymentCollectionStep","description":"This step validates that a cart doesn't have a payment collection.","link":"../../core_flows.Workflows_Cart/page.mdx#validateexistingpaymentcollectionstep","depth":2},{"type":"step","name":"createPaymentCollectionsStep","description":"This step creates payment collections in a cart.","link":"../../core_flows.Steps_Cart/page.mdx#createpaymentcollectionsstep","depth":3},{"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/v2/advanced-development/modules/remote-link#create-link).\n\n","link":"../../core_flows.Steps_Common/page.mdx#createremotelinkstep","depth":4}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CreatePaymentCollectionForCartWorkflowInputDTO","type":"`CreatePaymentCollectionForCartWorkflowInputDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createPaymentCollectionForCartWorkflow"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## listShippingOptionsForCartWorkflow
|
||||||
|
|
||||||
|
This workflow lists the shipping options of a cart.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"listShippingOptionsForCartWorkflow","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/v2/advanced-development/modules/remote-query).\n\n","link":"../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":1}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"ListShippingOptionsForCartWorkflowInputDTO","type":"`ListShippingOptionsForCartWorkflowInputDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="listShippingOptionsForCartWorkflow"/>
|
||||||
|
|
||||||
|
### Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"any[]","type":"`any`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"any","type":"`any`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="listShippingOptionsForCartWorkflow"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## refreshPaymentCollectionForCartWorkflow
|
||||||
|
|
||||||
|
This workflow refreshes the payment collections of a cart.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"refreshPaymentCollectionForCartWorkflow","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/v2/advanced-development/modules/remote-query).\n\n","link":"../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":1},{"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 true\n }","depth":"2","steps":[{"type":"workflow","name":"deletePaymentSessionsWorkflow","description":"This workflow deletes one or more payment sessions.","link":"../../core_flows.Workflows_Payment_Collection/page.mdx#deletepaymentsessionsworkflow","depth":2},{"type":"step","name":"updatePaymentCollectionStep","description":"This step updates payment collections matching the specified filters.","link":"../../core_flows.Steps_Payment_Collection/page.mdx#updatepaymentcollectionstep","depth":2}]}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"RefreshPaymentCollectionForCartWorklowInput","type":"[RefreshPaymentCollectionForCartWorklowInput](../../types/core_flows.RefreshPaymentCollectionForCartWorklowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="refreshPaymentCollectionForCartWorkflow"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## updateCartPromotionsWorkflow
|
||||||
|
|
||||||
|
This workflow updates a cart's promotions.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"updateCartPromotionsWorkflow","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/v2/advanced-development/modules/remote-query).\n\n","link":"../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":1},{"type":"step","name":"getPromotionCodesToApply","description":"This step retrieves the promotion codes to apply on a cart.","link":"../../core_flows.Steps_Cart/page.mdx#getpromotioncodestoapply","depth":2},{"type":"step","name":"getActionsToComputeFromPromotionsStep","description":"This step retrieves the actions to compute based on the promotions\napplied on a cart.","link":"../../core_flows.Steps_Cart/page.mdx#getactionstocomputefrompromotionsstep","depth":3},{"type":"step","name":"prepareAdjustmentsFromPromotionActionsStep","description":"This step prepares the line item or shipping method adjustments using\nactions computed by the Promotion Module.","link":"../../core_flows.Steps_Cart/page.mdx#prepareadjustmentsfrompromotionactionsstep","depth":4},{"type":"step","name":"removeLineItemAdjustmentsStep","description":"This step removes line item adjustments from a cart.","link":"../../core_flows.Steps_Cart/page.mdx#removelineitemadjustmentsstep","depth":5},{"type":"step","name":"removeShippingMethodAdjustmentsStep","description":"This step removes shipping method adjustments from a cart.","link":"../../core_flows.Steps_Cart/page.mdx#removeshippingmethodadjustmentsstep","depth":5},{"type":"step","name":"createLineItemAdjustmentsStep","description":"This step creates line item adjustments in a cart.","link":"../../core_flows.Steps_Cart/page.mdx#createlineitemadjustmentsstep","depth":5},{"type":"step","name":"createShippingMethodAdjustmentsStep","description":"This step creates shipping method adjustments for a cart.","link":"../../core_flows.Steps_Cart/page.mdx#createshippingmethodadjustmentsstep","depth":5},{"type":"step","name":"updateCartPromotionsStep","description":"This step updates the promotions applied on a cart.","link":"../../core_flows.Steps_Cart/page.mdx#updatecartpromotionsstep","depth":5}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"UpdateCartPromotionsWorkflowInput","type":"[UpdateCartPromotionsWorkflowInput](../../types/core_flows.UpdateCartPromotionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"promo_codes","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"action","type":"[ADD](../../../utils/PromotionUtils/enums/utils.PromotionUtils.PromotionActions/page.mdx#add) \\| [REMOVE](../../../utils/PromotionUtils/enums/utils.PromotionUtils.PromotionActions/page.mdx#remove) \\| [REPLACE](../../../utils/PromotionUtils/enums/utils.PromotionUtils.PromotionActions/page.mdx#replace)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateCartPromotionsWorkflow"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## updateCartWorkflow
|
||||||
|
|
||||||
|
This workflow updates a cart.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"updateCartWorkflow","steps":[{"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":"../../core_flows.Steps_Cart/page.mdx#findsaleschannelstep","depth":1},{"type":"step","name":"findOneOrAnyRegionStep","description":"This step retrieves a region either by the provided ID or the first region in the first store.","link":"../../core_flows.Steps_Cart/page.mdx#findoneoranyregionstep","depth":1},{"type":"step","name":"findOrCreateCustomerStep","description":"This step either finds a customer matching the specified ID, or finds / create a customer \nmatching the specified email. If both ID and email are provided, ID takes precedence.","link":"../../core_flows.Steps_Cart/page.mdx#findorcreatecustomerstep","depth":1},{"type":"step","name":"updateCartsStep","description":"This step updates a cart.","link":"../../core_flows.Steps_Cart/page.mdx#updatecartsstep","depth":2},{"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/v2/advanced-development/modules/remote-query).\n\n","link":"../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":3},{"type":"step","name":"refreshCartShippingMethodsStep","description":"This step refreshes the shipping methods of a cart.","link":"../../core_flows.Steps_Cart/page.mdx#refreshcartshippingmethodsstep","depth":4},{"type":"workflow","name":"updateTaxLinesWorkflow","description":"This workflow updates a cart's tax lines.","link":"../../core_flows.Workflows_Cart/page.mdx#updatetaxlinesworkflow","depth":4},{"type":"workflow","name":"updateCartPromotionsWorkflow","description":"This workflow updates a cart's promotions.","link":"../../core_flows.Workflows_Cart/page.mdx#updatecartpromotionsworkflow","depth":5},{"type":"workflow","name":"refreshPaymentCollectionForCartWorkflow","description":"This workflow refreshes the payment collections of a cart.","link":"../../core_flows.Workflows_Cart/page.mdx#refreshpaymentcollectionforcartworkflow","depth":6},{"type":"hook","name":"cartUpdated","description":"This step is a hook that you can inject custom functionality into.\n\n","link":"#cartUpdated","depth":7}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"UpdateCartWorkflowInputDTO & AdditionalData","type":"`UpdateCartWorkflowInputDTO` & [AdditionalData](../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"UpdateCartWorkflowInputDTO","type":"`UpdateCartWorkflowInputDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]},{"name":"AdditionalData","type":"[AdditionalData](../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"additional_data","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateCartWorkflow"/>
|
||||||
|
|
||||||
|
### Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"undefined","type":"`undefined`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"undefined","type":"`undefined`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateCartWorkflow"/>
|
||||||
|
|
||||||
|
### Hooks
|
||||||
|
|
||||||
|
#### cartUpdated
|
||||||
|
|
||||||
|
##### Example
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { updateCartWorkflow } from "@medusajs/core-flows"
|
||||||
|
|
||||||
|
updateCartWorkflow.hooks.cartUpdated(
|
||||||
|
async (({ cart, additional_data }, { container }) => {
|
||||||
|
//TODO
|
||||||
|
})
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Input
|
||||||
|
|
||||||
|
Handlers consuming this hook accept the following input.
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"input","type":"object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="cartUpdated"/>
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## updateLineItemInCartWorkflow
|
||||||
|
|
||||||
|
This workflow updates a cart's line item.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"updateLineItemInCartWorkflow","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/v2/advanced-development/modules/remote-query).\n\n","link":"../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":1},{"type":"step","name":"validateVariantPricesStep","description":"This step validates the specified variant objects to ensure they have prices.","link":"../../core_flows.Steps_Cart/page.mdx#validatevariantpricesstep","depth":2},{"type":"workflow","name":"confirmVariantInventoryWorkflow","description":"This workflow confirms for one or more variants that their inventory has a required quantity.","link":"../../core_flows.Workflows_Cart/page.mdx#confirmvariantinventoryworkflow","depth":3},{"type":"step","name":"updateLineItemsStepWithSelector","description":"This step updates line items.","link":"../../core_flows.Steps_Line_Item/page.mdx#updatelineitemsstepwithselector","depth":4},{"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/v2/advanced-development/modules/remote-query).\n\n","link":"../../core_flows.Steps_Common/page.mdx#useremotequerystep","depth":5},{"type":"step","name":"refreshCartShippingMethodsStep","description":"This step refreshes the shipping methods of a cart.","link":"../../core_flows.Steps_Cart/page.mdx#refreshcartshippingmethodsstep","depth":6},{"type":"workflow","name":"updateCartPromotionsWorkflow","description":"This workflow updates a cart's promotions.","link":"../../core_flows.Workflows_Cart/page.mdx#updatecartpromotionsworkflow","depth":7},{"type":"workflow","name":"refreshPaymentCollectionForCartWorkflow","description":"This workflow refreshes the payment collections of a cart.","link":"../../core_flows.Workflows_Cart/page.mdx#refreshpaymentcollectionforcartworkflow","depth":8}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"UpdateLineItemInCartWorkflowInputDTO","type":"`UpdateLineItemInCartWorkflowInputDTO`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateLineItemInCartWorkflow"/>
|
||||||
|
|
||||||
|
### Output
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"CartLineItemDTO","type":"[CartLineItemDTO](../../../cart/interfaces/cart.CartLineItemDTO/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"original_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_subtotal","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original subtotal of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_tax_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item subtotal of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_tax_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"total","type":"[BigNumberValue](../../../cart/tyLine truncated
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
|
## updateTaxLinesWorkflow
|
||||||
|
|
||||||
|
This workflow updates a cart's tax lines.
|
||||||
|
|
||||||
|
### Steps
|
||||||
|
|
||||||
|
<WorkflowDiagram workflow={{"name":"updateTaxLinesWorkflow","steps":[{"type":"step","name":"retrieveCartWithLinksStep","description":"This step retrieves a cart's details with its linked records.","link":"../../core_flows.Steps_Cart/page.mdx#retrievecartwithlinksstep","depth":1},{"type":"step","name":"getItemTaxLinesStep","description":"This step retrieves the tax lines of the specified line items in a cart.","link":"../../core_flows.Steps_Cart/page.mdx#getitemtaxlinesstep","depth":2},{"type":"step","name":"setTaxLinesForItemsStep","description":"This step sets the tax lines of shipping methods and line items in a cart.","link":"../../core_flows.Steps_Cart/page.mdx#settaxlinesforitemsstep","depth":3}]}} />
|
||||||
|
|
||||||
|
### Input
|
||||||
|
|
||||||
|
<TypeList types={[{"name":"UpdateTaxLinesWorkflowInput","type":"[UpdateTaxLinesWorkflowInput](../../types/core_flows.UpdateTaxLinesWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"cart_or_cart_id","type":"`string` \\| `CartWorkflowDTO`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"[CartLineItemDTO](../../../cart/interfaces/cart.CartLineItemDTO/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"original_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_subtotal","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original subtotal of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_tax_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item subtotal of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_tax_total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"total","type":"[BigNumberValue](../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandabLine truncated
|
||||||
Reference in new issue
Block a user