listLineItemsStep - Medusa Core Workflows Reference

This documentation provides a reference to the listLineItemsStep. It belongs to the @medusajs/medusa/core-flows package.

This step retrieves a list of a cart's line items matching the specified filters.

Example#

To retrieve the line items of a cart:

Code
1const data = listLineItemsStep({2  filters: {3    cart_id: "cart_123"4  },5  config: {6    select: ["*"]7  }8})

To retrieve the line items of a cart with pagination:

Code
1const data = listLineItemsStep({2  filters: {3    cart_id: "cart_123"4  },5  config: {6    select: ["*"],7    skip: 0,8    take: 159  }10})

Learn more about listing items in this service factory reference.

Input#

ListLineItemsStepInputListLineItemsStepInput
The data to list line items.
The filters to select the line items.
Configurations to select the line items' fields and relations, and to paginate the results. Learn more in the service factory reference.

Output#

CartLineItemDTO[]CartLineItemDTO[]
CartLineItemDTOCartLineItemDTO
The cart line item details.
Was this page helpful?
Ask Anything
FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break