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 CodeExamples#
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#
GetOrdersListWorkflowInput
GetOrdersListWorkflowInput
GetOrdersListWorkflowInput
GetOrdersListWorkflowInputfields
string[]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.
fields
string[]variables
Record<string, any> & objectOptionalFilters and pagination configurations to apply on the retrieved orders.
variables
Record<string, any> & objectOptionalOutput#
GetOrdersListWorkflowOutput
GetOrdersListWorkflowOutputThe 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.
GetOrdersListWorkflowOutput
GetOrdersListWorkflowOutputrows
OrderDTO[]The list of orders.
rows
OrderDTO[]metadata
objectPagination details.
metadata
objectWas this page helpful?