# Create Booking — Uplisting

> Create a confirmed booking. See the documentation

- Key: `uplisting-create-booking`
- Type: Action (Write)
- Version: 0.0.2
- App: Uplisting (`uplisting`) — https://pipedream.com/apps/uplisting.md
- This page (HTML): https://pipedream.com/apps/uplisting/actions/create-booking
- Hints: destructive · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/uplisting/actions/create-booking/create-booking.mjs

## Description

Create a confirmed booking. [See the documentation](https://documenter.getpostman.com/view/1320372/SWTBfdW6#ce173dfb-5d88-4af4-a55f-43ffc238487a)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `clientId` | `string` | Yes | Contact Uplisting if you don't have a partner specific client ID. |
| `checkIn` | `string` | Yes | The date of the check in. |
| `checkOut` | `string` | Yes | The date of the check out. |
| `propertyId` | `string` | Yes | The id of the property that will be used to the booking. Options are loaded from the connected account. |
| `guestName` | `string` | No | Guest name shown on the booking calendar and used for automated messaging. |
| `guestEmail` | `string` | No | A valid email is required for any scheduled messages to be delivered to the guest. |
| `guestPhone` | `string` | No | The guest's phone number. |
| `numberOfGuests` | `integer` | No | Used for price calculation. |

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

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: "uplisting-create-booking",
  arguments: {
    clientId: "X-Uplisting-Client-ID",
    checkIn: "Check In",
  },
})
```

**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: "uplisting-create-booking",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    uplisting: { authProvisionId: "apn_xxxxxxx" },
    clientId: "X-Uplisting-Client-ID",
    checkIn: "Check In",
  },
})

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": "uplisting-create-booking",
    "configured_props": {
      "uplisting": { "authProvisionId": "apn_xxxxxxx" },
      "clientId": "X-Uplisting-Client-ID",
      "checkIn": "Check In"
    }
  }'
```

---

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