# Get Orders — TicketSauce

> Get a list of orders from the specified event. See documentation

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

## Description

Get a list of orders from the specified event. [See documentation](https://speca.io/ticketsauce/ticketsauce-public-api?key=204000d6bda66da78315e721920f43aa#orders)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `partnerId` | `string` | No | Including this ID will limit the result set to the specific partner. |
| `organizationId` | `string` | No | Including this ID will limit the result set to the specific organization. |
| `eventId` | `string` | Yes | Select an event Options are loaded from the connected account. |
| `perPage` | `string` | No | How many results to retrieve (per page). Max 500. |
| `page` | `string` | No | Which page to return. For example, if per_page is 20, and page is 3, the results would show 41-60. |
| `q` | `string` | No | Exact email address or last name attached to an order. |
| `returnQuestionnaires` | `boolean` | No | Whether or not to return the question responses from questionnaires (will include attendee responses as well IF tickets are returned) |
| `returnTickets` | `boolean` | No | Whether or not to return the tickets for each order as well. |
| `returnLineItemFees` | `boolean` | No | Whether or not to return the itemized line item fees for each order (if they exist). |
| `orderedAfter` | `string` | No | Only retrieve orders that were ordered AFTER the specified date/time (format: YYYY-MM-DD or YYYY-MM-DD HH:MM:SS). |
| `orderedBefore` | `string` | No | Only retrieve orders that were ordered BEFORE the specified date/time (format: YYYY-MM-DD or YYYY-MM-DD HH:MM:SS). |
| `modifiedAfter` | `string` | No | Only retrieve orders that were modified AFTER the specified date/time (format: YYYY-MM-DD or YYYY-MM-DD HH:MM:SS). |
| `modifiedBefore` | `string` | No | Only retrieve orders that were modified BEFORE the specified date/time (format: YYYY-MM-DD or YYYY-MM-DD HH:MM:SS). |
| `sortBy` | `string` | No | Field to sort orders by. |
| `sortDir` | `string` | No | Direction to sort results. |
| `totalAbove` | `string` | No | Return only orders whose order total is greater than this value. |
| `totalBelow` | `string` | No | Return only orders whose order total is less than this value. |

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

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: "ticketsauce-get-orders",
  arguments: {
    partnerId: "Partner ID",
    organizationId: "Organization 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: "ticketsauce-get-orders",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    ticketsauce: { authProvisionId: "apn_xxxxxxx" },
    partnerId: "Partner ID",
    organizationId: "Organization 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": "ticketsauce-get-orders",
    "configured_props": {
      "ticketsauce": { "authProvisionId": "apn_xxxxxxx" },
      "partnerId": "Partner ID",
      "organizationId": "Organization ID"
    }
  }'
```

---

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