# Create Customer — Setmore

> Create a new customer in Setmore Appointments. See the documentation

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

## Description

Create a new customer in Setmore Appointments. [See the documentation](https://setmore.docs.apiary.io/#introduction/customers/create-a-customer)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `first_name` | `string` | Yes | The first name of the customer. |
| `last_name` | `string` | No | The last name of the customer. |
| `email_id` | `string` | No | The email of the customer. |
| `country_code` | `string` | No | The country code of the customer's phone number. |
| `cell_phone` | `string` | No | The cell phone number of the customer. |
| `work_phone` | `string` | No | The work phone number of the customer. |
| `home_phone` | `string` | No | The home phone number of the customer. |
| `address` | `string` | No | The address of the customer. |
| `city` | `string` | No | The city of the customer. |
| `state` | `string` | No | The state of the customer. |
| `postal_code` | `string` | No | The postal code of the customer. |
| `image_url` | `string` | No | The image URL of the customer. |
| `comment` | `string` | No | Any additional comments about the customer. |

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

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: "setmoreappointments-create-customer",
  arguments: {
    first_name: "First Name",
    last_name: "Last 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: "setmoreappointments-create-customer",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    setmoreappointments: { authProvisionId: "apn_xxxxxxx" },
    first_name: "First Name",
    last_name: "Last 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": "setmoreappointments-create-customer",
    "configured_props": {
      "setmoreappointments": { "authProvisionId": "apn_xxxxxxx" },
      "first_name": "First Name",
      "last_name": "Last Name"
    }
  }'
```

---

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