# Search Orders by Order Number — Everstox

> Search orders from Everstox. See the documentation

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

## Description

Search orders from Everstox. [See the documentation](https://api.everstox.com/api/v1/ui/#/Order/district_core.api.shops.orders.orders.Orders.index)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `warehouseIds` | `string[]` | No | Warehouse IDs Options are loaded from the connected account. |
| `fields` | `string[]` | No | Fields to filter for |
| `orderNumber` | `string` | No | Filter for order number Options are loaded from the connected account. |
| `hoursLateLte` | `integer` | No | Filter for orders late for the amount of hours less or equal than the provided value |
| `hoursLateGte` | `integer` | No | Filter for orders late for the amount of hours greater or equal than the provided value |
| `search` | `string` | No | Multi-attribute-search filters either for Customer Email or Billing Address or Order Number. Returns set of orders where at least one of those attributes match the search term |
| `fulfillmentState` | `string` | No | Fulfillment State to filter for order where the corresponding fulfillment is in the given state |
| `fulfillmentStategroup` | `string` | No | Fulfillment Stategroup to filter for order where the corresponding fulfillment is in the given stategroup |
| `stategroup` | `string` | No | Stategroup to filter for, e.g. open includes states like new, in_progress etc |
| `cancellationState` | `string` | No | Cancellation State to filter for order with min 1 cancellation in that state |
| `shipmentDateGte` | `string` | No | Find orders whose shipment date is greater than or equal to the provided value |
| `updatedDateGte` | `string` | No | Find orders whose updated date is greater than or equal to the provided value |
| `createdDateGte` | `string` | No | Find orders whose creation date is greater than or equal to the provided value |
| `createdDateLte` | `string` | No | Find orders whose created date is less than or equal to the provided value |
| `shipmentsForwardedToShop` | `boolean` | No | Boolean returning orders with shipments forwarded to shop |

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

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: "everstox-search-orders",
  arguments: {
    warehouseIds: ["Warehouse IDs"],
    fields: ["Fields"],
  },
})
```

**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: "everstox-search-orders",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    everstox: { authProvisionId: "apn_xxxxxxx" },
    warehouseIds: ["Warehouse IDs"],
    fields: ["Fields"],
  },
})

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": "everstox-search-orders",
    "configured_props": {
      "everstox": { "authProvisionId": "apn_xxxxxxx" },
      "warehouseIds": ["Warehouse IDs"],
      "fields": ["Fields"]
    }
  }'
```

---

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