# Create Reservation — Mews

> Create a reservation in Mews. See reservation parameters in the docs. See the documentation

- Key: `mews-create-reservation`
- Type: Action (Write)
- Version: 0.0.4
- App: Mews (`mews`) — https://pipedream.com/apps/mews.md
- This page (HTML): https://pipedream.com/apps/mews/actions/create-reservation
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/mews/actions/create-reservation/create-reservation.mjs

## Description

Create a reservation in Mews. See reservation parameters in the docs. [See the documentation](https://mews-systems.gitbook.io/connector-api/operations/reservations#add-reservations)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `serviceId` | `string` | Yes | Identifier of the Service (bookable service). See the documentation Options are loaded from the connected account. |
| `startUtc` | `string` | Yes | Start of the reservation in ISO 8601 (UTC). Eg. 2025-01-01T00:00:00Z |
| `endUtc` | `string` | Yes | End of the reservation in ISO 8601 (UTC). Eg. 2025-01-01T00:00:00Z |
| `personCounts` | `string[]` | Yes | Number of people per age category the reservation was booked for. At least one category with valid count must be provided. Parameters: AgeCategoryId (string, required): Unique identifier of the Age category Count (integer, required): Number of people of a given age category. Only positive value is accepted Example: [ { "AgeCategoryId": "3ed9e2f3-4bba-4df6-8d41-ab1400b21942", "Count": 2 }, { "AgeCategoryId": "ab7e1cf3-5fda-4cd2-8f41-ab1400b21943", "Count": 1 } ] |
| `customerId` | `string` | Yes | Identifier of the Customer who owns the reservation. See the documentation Options are loaded from the connected account. |
| `requestedCategoryId` | `string` | Yes | The category of the resource requested for the reservation. Options are loaded from the connected account. |
| `rateId` | `string` | Yes | Identifier of the Rate. See the documentation Options are loaded from the connected account. |
| `state` | `string` | No | State of the reservation. |
| `channelNumber` | `string` | No | The number of the channel that made the reservation. |
| `notes` | `string` | No | Notes of the reservation. |
| `companyId` | `string` | No | Identifier of the Company. See the documentation Options are loaded from the connected account. |
| `travelAgencyId` | `string` | No | Identifier of the Travel Agency. (Company with a TravelAgencyContract) Options are loaded from the connected account. |
| `businessSegmentId` | `string` | No | Identifier of the Business Segment. See the documentation Options are loaded from the connected account. |
| `additionalFields` | `object` | No | Raw payload fields to include in the request (e.g. filters). |

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

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: "mews-create-reservation",
  arguments: {
    serviceId: "Service ID",
    startUtc: "Start (UTC)",
  },
})
```

**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: "mews-create-reservation",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    mews: { authProvisionId: "apn_xxxxxxx" },
    serviceId: "Service ID",
    startUtc: "Start (UTC)",
  },
})

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": "mews-create-reservation",
    "configured_props": {
      "mews": { "authProvisionId": "apn_xxxxxxx" },
      "serviceId": "Service ID",
      "startUtc": "Start (UTC)"
    }
  }'
```

---

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