# Search Picqer Orders — Picqer

> Search for orders in Picqer. See the documentation

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

## Description

Search for orders in Picqer. [See the documentation](https://picqer.com/en/api/orders#get-all-orders)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `search` | `string` | No | Search through the fields orderid, reference, customer name and customer contact name. |
| `sinceId` | `string` | No | Get the orders with a later idorder than given. |
| `beforeId` | `string` | No | Get the orders with a smaller idorder than given. |
| `sinceDate` | `string` | No | Get the orders that are added after this date and time. Format: YYYY-MM-DD HH:MM:SS |
| `untilDate` | `string` | No | Get the orders that are added before this date and time. Format: YYYY-MM-DD HH:MM:SS |
| `status` | `string` | No | Get the orders that have this status. |
| `reference` | `string` | No | Get the orders that have this value as reference. |
| `emailAddress` | `string` | No | Get the orders that have this value as email address. |
| `customerId` | `string` | No | Get all orders for this customer. Options are loaded from the connected account. |
| `warehouseId` | `string` | No | Get the orders that can be delivered from this warehouse. Options are loaded from the connected account. |
| `fulfillmentCustomerId` | `string` | No | Get the orders for this fulfilment. Options are loaded from the connected account. |

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

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: "picqer-search-orders",
  arguments: {
    search: "Search",
    sinceId: "Since ID",
  },
})
```

**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: "picqer-search-orders",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    picqer: { authProvisionId: "apn_xxxxxxx" },
    search: "Search",
    sinceId: "Since ID",
  },
})

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": "picqer-search-orders",
    "configured_props": {
      "picqer": { "authProvisionId": "apn_xxxxxxx" },
      "search": "Search",
      "sinceId": "Since ID"
    }
  }'
```

---

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