# List Orders — ShipStation

> List orders optionally filtered by various criteria. See the documentation

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

## Description

List orders optionally filtered by various criteria. [See the documentation](https://docs.shipstation.com/apis/shipstation-v1/openapi/orders/list_orders)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `customerName` | `string` | No | Returns orders that match the specified customer name. |
| `itemKeyword` | `string` | No | Returns orders that contain items that match the specified keyword. Fields searched are Sku, Description, and Options. |
| `createDateStart` | `string` | No | Returns orders created in ShipStation after the specified date. E.g. 2015-01-01 00:00:00 |
| `createDateEnd` | `string` | No | Returns orders created in ShipStation before the specified date. E.g. 2015-01-08 00:00:00 |
| `modifyDateStart` | `string` | No | Returns orders modified after the specified date. E.g. 2015-01-01 00:00:00 |
| `modifyDateEnd` | `string` | No | Returns orders modified before the specified date. E.g. 2015-01-08 00:00:00 |
| `orderDateStart` | `string` | No | Returns orders greater than the specified date. E.g. 2015-01-01 00:00:00 |
| `orderDateEnd` | `string` | No | Returns orders less than or equal to the specified date. E.g. 2015-01-08 00:00:00 |
| `orderNumber` | `string` | No | Filter by order number using a "starts with" search. |
| `orderStatus` | `string` | No | Filter orders by status. |
| `paymentDateStart` | `string` | No | Returns orders paid after the specified date. E.g. 2015-01-01 00:00:00 |
| `paymentDateEnd` | `string` | No | Returns orders paid before the specified date. E.g. 2015-01-08 00:00:00 |
| `storeId` | `string` | No | A list of stores. Use the List Store ID Options action to get a list of store IDs. Options are loaded from the connected account. |
| `sortBy` | `string` | No | Sort orders by a specific field. |
| `sortDir` | `string` | No | Sort direction for results. |
| `page` | `integer` | No | Page number for pagination. Default is 1. |
| `pageSize` | `integer` | No | Number of results per page. Maximum is 500. |

## 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": "shipstation",
      },
    },
  },
)

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: "shipstation-list-orders",
  arguments: {
    customerName: "Customer Name",
    itemKeyword: "Item Keyword",
  },
})
```

**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: "shipstation-list-orders",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    shipstation: { authProvisionId: "apn_xxxxxxx" },
    customerName: "Customer Name",
    itemKeyword: "Item Keyword",
  },
})

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": "shipstation-list-orders",
    "configured_props": {
      "shipstation": { "authProvisionId": "apn_xxxxxxx" },
      "customerName": "Customer Name",
      "itemKeyword": "Item Keyword"
    }
  }'
```

---

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