# List Customers — Orderspace

> List a list of customers. See the documentation

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

## Description

List a list of customers. [See the documentation](https://apidocs.orderspace.com/#list-customers)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `createdSince` | `string` | No | Return records created since the given date and time in ISO 8601 format, e.g. 2019-10-29T21:00 |
| `companyName` | `string` | No | Return customers with the specified company name |
| `buyersEmailAddress` | `string` | No | Return customers with the specified buyers email address |
| `status` | `string` | No | Return customers with the specified status |
| `reference` | `string` | No | Return customers with the specified reference |
| `paymentTermId` | `string` | No | Return customers with the specified payment terms Options are loaded from the connected account. |
| `customerGroupId` | `string` | No | Return customers in the specified group Options are loaded from the connected account. |
| `priceListId` | `string` | No | Return customers with the specified price list Options are loaded from the connected account. |
| `maxResults` | `integer` | No | The maximum number of results to return. The default is 50 and the maximum limit is 200 |

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

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: "orderspace-list-customers",
  arguments: {
    createdSince: "Created Since",
    companyName: "Company Name",
  },
})
```

**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: "orderspace-list-customers",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    orderspace: { authProvisionId: "apn_xxxxxxx" },
    createdSince: "Created Since",
    companyName: "Company Name",
  },
})

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": "orderspace-list-customers",
    "configured_props": {
      "orderspace": { "authProvisionId": "apn_xxxxxxx" },
      "createdSince": "Created Since",
      "companyName": "Company Name"
    }
  }'
```

---

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