# List Orders — Order Desk

> List Orders based on a search criteria See the documentation.

- Key: `order_desk-list-orders`
- Type: Action (Read-only)
- Version: 0.0.2
- App: Order Desk (`order_desk`) — https://pipedream.com/apps/order-desk.md
- This page (HTML): https://pipedream.com/apps/order-desk/actions/list-orders
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/order_desk/actions/list-orders/list-orders.mjs

## Description

List Orders based on a search criteria [See the documentation](https://apidocs.orderdesk.com/#get-multiple-orders).

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `search_start_date_local` | `string` | No | Start date from when an order was added. Search in local store time. |
| `search_end_date_local` | `string` | No | End date from when an order was added. Search in local store time. |
| `search_start_date` | `string` | No | Start date from when an order was added. Search in UTC time. |
| `search_end_date` | `string` | No | End date from when an order was added. Search in UTC time. |
| `modified_start_date` | `string` | No | Start date from when an order was last modified. Search in UTC time. |
| `modified_end_date` | `string` | No | End date from when an order was last modified. Search in UTC time. |
| `order_by` | `string` | No | Order the query by an order field. Defaults to date_added |
| `order` | `string` | No | Order the query by asc or desc. Defaults to desc |
| `folder_id` | `string` | No | Search for orders from a particular folder. For multiple folders, enter multiple ID's separated by a comma: 1004,1009,1010 |
| `folder_name` | `string` | No | Search for orders from a particular folder. Enter the folder's exact name instead of its ID. |
| `source_id` | `string` | No | The Source Id |
| `source_name` | `string` | No | The Source Name |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "order_desk",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "order_desk-list-orders",
  arguments: {
    search_start_date_local: "Search Start Date Local",
    search_end_date_local: "Search End Date Local",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "order_desk-list-orders",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    order_desk: { authProvisionId: "apn_xxxxxxx" },
    search_start_date_local: "Search Start Date Local",
    search_end_date_local: "Search End Date Local",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "order_desk-list-orders",
    "configured_props": {
      "order_desk": { "authProvisionId": "apn_xxxxxxx" },
      "search_start_date_local": "Search Start Date Local",
      "search_end_date_local": "Search End Date Local"
    }
  }'
```

---

- App: https://pipedream.com/apps/order-desk.md · All apps: https://pipedream.com/apps
