- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Menu
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
addOrderLineItemsWorkflow - Medusa Core Workflows Reference
This documentation provides a reference to the addOrderLineItemsWorkflow
. It belongs to the @medusajs/medusa/core-flows
package.
This workflow adds line items to an order. This is useful when making edits to an order. It's used by other workflows, such as orderEditAddNewItemWorkflow.
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around adding items to an order.
Source CodeExamples#
Steps#
Workflow Hook
Step conditioned by when
Input#
OrderAddLineItemWorkflowInput
OrderAddLineItemWorkflowInput
OrderAddLineItemWorkflowInput
OrderAddLineItemWorkflowInputorder_id
stringThe ID of the order to add the line items to.
order_id
stringitems
NewItem[]The items to add to the order.
items
NewItem[]Output#
OrderAddLineItemWorkflowOutput
OrderAddLineItemWorkflowOutputThe created order line items.
OrderAddLineItemWorkflowOutput
OrderAddLineItemWorkflowOutputoriginal_total
BigNumberValueThe original total of the order line item.
original_total
BigNumberValueoriginal_subtotal
BigNumberValueThe original subtotal of the order line item.
original_subtotal
BigNumberValueoriginal_tax_total
BigNumberValueThe original tax total of the order line item.
original_tax_total
BigNumberValueitem_total
BigNumberValueThe item total of the order line item.
item_total
BigNumberValueitem_subtotal
BigNumberValueThe item subtotal of the order line item.
item_subtotal
BigNumberValueitem_tax_total
BigNumberValueThe item tax total of the order line item.
item_tax_total
BigNumberValuetotal
BigNumberValueThe total of the order line item.
total
BigNumberValuesubtotal
BigNumberValueThe subtotal of the order line item.
subtotal
BigNumberValuetax_total
BigNumberValueThe tax total of the order line item.
tax_total
BigNumberValuediscount_total
BigNumberValueThe discount total of the order line item.
discount_total
BigNumberValuediscount_tax_total
BigNumberValueThe discount tax total of the order line item.
discount_tax_total
BigNumberValuerefundable_total
BigNumberValueThe refundable total of the order line item.
refundable_total
BigNumberValuerefundable_total_per_unit
BigNumberValueThe refundable total per unit of the order line item.
refundable_total_per_unit
BigNumberValueid
stringThe ID of the line item.
id
stringtitle
stringThe title of the line item.
title
stringrequires_shipping
booleanIndicates whether the line item requires shipping.
requires_shipping
booleanis_discountable
booleanIndicates whether the line item is discountable.
is_discountable
booleanis_tax_inclusive
booleanIndicates whether the line item price is tax inclusive.
is_tax_inclusive
booleanunit_price
numberThe unit price of the line item.
unit_price
numberquantity
numberThe quantity of the line item.
quantity
numberdetail
OrderItemDTOThe details of the item
detail
OrderItemDTOcreated_at
DateThe date when the line item was created.
created_at
Dateupdated_at
DateThe date when the line item was last updated.
updated_at
Datesubtitle
null | stringOptionalThe subtitle of the line item.
subtitle
null | stringOptionalthumbnail
null | stringOptionalThe thumbnail of the line item.
thumbnail
null | stringOptionalvariant_id
null | stringOptionalThe ID of the variant associated with the line item.
variant_id
null | stringOptionalproduct_id
null | stringOptionalThe ID of the product associated with the line item.
product_id
null | stringOptionalproduct_title
null | stringOptionalThe title of the product associated with the line item.
product_title
null | stringOptionalproduct_description
null | stringOptionalThe description of the product associated with the line item.
product_description
null | stringOptionalproduct_subtitle
null | stringOptionalThe subtitle of the product associated with the line item.
product_subtitle
null | stringOptionalproduct_type_id
null | stringOptionalThe ID of the type of the product associated with the line item.
product_type_id
null | stringOptionalproduct_type
null | stringOptionalThe type of the product associated with the line item.
product_type
null | stringOptionalproduct_collection
null | stringOptionalThe collection of the product associated with the line item.
product_collection
null | stringOptionalproduct_handle
null | stringOptionalThe handle of the product associated with the line item.
product_handle
null | stringOptionalvariant_sku
null | stringOptionalThe SKU (stock keeping unit) of the variant associated with the line item.
variant_sku
null | stringOptionalvariant_barcode
null | stringOptionalThe barcode of the variant associated with the line item.
variant_barcode
null | stringOptionalvariant_title
null | stringOptionalThe title of the variant associated with the line item.
variant_title
null | stringOptionalvariant_option_values
null | Record<string, unknown>OptionalThe option values of the variant associated with the line item.
variant_option_values
null | Record<string, unknown>Optionalcompare_at_unit_price
numberOptionalThe compare at unit price of the line item.
compare_at_unit_price
numberOptionalThe associated tax lines.
The associated adjustments.
metadata
null | Record<string, unknown>OptionalHolds custom data in key-value pairs.
metadata
null | Record<string, unknown>OptionalWas this page helpful?