# Get Orders — PlentyONE

> Retrieves a list of orders from PlentyONE. See the documentation

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

## Description

Retrieves a list of orders from PlentyONE. [See the documentation](https://developers.plentymarkets.com/en-gb/plentymarkets-rest-api/index.html#/Order/get_rest_orders)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `typeID` | `integer` | No | Type of order to retrieve. If not provided, all order types will be retrieved. |
| `contactId` | `string` | No | ID of the contact to retrieve orders for. Options are loaded from the connected account. |
| `contactData` | `string` | No | Filter that restricts the search result to orders with a specific contact data. |
| `referrerId` | `integer` | No | Filter that restricts the search result to orders of a specific order referrer. The ID of the order referrer must be specified. |
| `shippingProfileId` | `integer` | No | Filter that restricts the search result to orders with a specific shipping profile. The ID of shipping profile must be specified. |
| `shippingServiceProviderId` | `integer` | No | Filter that restricts the search result to orders with a specific shipping service provider (like DHL, UPS, etc.). The ID of shipping service provider must be specified. |
| `ownerUserId` | `integer` | No | Filter that restricts the search result to orders with a specific owner. The user ID of the owner must be specified. |
| `warehouseId` | `integer` | No | Filter that restricts the search result to orders with a specific main warehouse. The ID of the warehouse must be specified. |
| `isEbayPlus` | `boolean` | No | Filter that restricts the search result to orders with the referrer eBay PLUS. |
| `includedVariation` | `integer` | No | Filter that restricts the search result to orders including a specific variation. The ID of the variation must be specified. |
| `includedItem` | `integer` | No | Filter that restricts the search result to orders including a specific item. The ID of the item must be specified. |
| `orderIds` | `string[]` | No | Filter that restricts the search result to orders with a specific ID. Options are loaded from the connected account. |
| `countryId` | `integer` | No | Filter that restricts the search result to orders with a specific delivery or invoice country. Options are loaded from the connected account. |
| `orderItemName` | `string` | No | Filter that restricts the search result to orders including a specific item name. The name of the item must be specified. |
| `variationNumber` | `integer` | No | Filter that restricts the search result to orders including a specific variation number. The number of the variation must be specified. |
| `packageNumber` | `string` | No | Filter that restricts the search result to orders including a specific package number. The number of the package must be specified. |
| `externalOrderId` | `string` | No | Filter that restricts the search result to orders including a specific external order ID. The external order ID must be specified. |
| `clientId` | `integer` | No | Filter that restricts the search result to orders belonging to a specific client. The ID of the client must be specified. |
| `paymentStatus` | `string` | No | Filter that restricts the search result to orders with a specific payment status. |
| `paymentMethodId` | `integer` | No | Filter that restricts the search result to orders with a specific payment method. The ID of the payment method must be specified. |
| `with` | `string[]` | No | Load additional relations for an order. |

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

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: "plentyone-get-orders",
  arguments: {
    typeID: 10,
    contactId: "Contact 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: "plentyone-get-orders",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    plentyone: { authProvisionId: "apn_xxxxxxx" },
    typeID: 10,
    contactId: "Contact 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": "plentyone-get-orders",
    "configured_props": {
      "plentyone": { "authProvisionId": "apn_xxxxxxx" },
      "typeID": 10,
      "contactId": "Contact ID"
    }
  }'
```

---

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