getOrdersListWorkflow - Medusa Core Workflows Reference

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

This workflow retrieves a list of orders. It's used by the List Orders Admin API Route, and the List Orders Store API Route.

You can use this workflow within your customizations or your own custom workflows, allowing you to retrieve a list of orders in your custom flows. For example, you can retrieve the list of orders to export them to a third-party system.

Source Code

Examples#

To retrieve the list of orders:

To retrieve the list of orders with pagination:

Steps#

Workflow hook

Step conditioned by when

View step details

Input#

GetOrdersListWorkflowInputGetOrdersListWorkflowInput
fieldsstring[]
The fields and relations to retrieve in the order. These fields are passed to Query, so you can pass names of custom models linked to the order.
variablesRecord<string, any> & objectOptional
Filters and pagination configurations to apply on the retrieved orders.

Output#

GetOrdersListWorkflowOutputGetOrdersListWorkflowOutput
The retrieved list of orders. If you passed pagination configurations in the input, the response will return an object that includes the list of orders and their pagination details. Otherwise, only the list of orders are returned.
rowsOrderDTO[]
The list of orders.
metadataobject
Pagination 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