# Create Customer — Pennylane

> Creates a new customer in Pennylane. See the documentation

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

## Description

Creates a new customer in Pennylane. [See the documentation](https://pennylane.readme.io/reference/customers-post-1)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `customerType` | `string` | Yes | The type of the customer you want to create. |
| `firstName` | `string` | Yes | Customer first name. |
| `lastName` | `string` | Yes | Customer last name. |
| `gender` | `string` | No | Customer Gender |
| `name` | `string` | Yes | The name of the company. |
| `regNo` | `string` | No | Customer registration number (SIREN). |
| `address` | `string` | Yes | Customer address (billing address). |
| `postalCode` | `string` | Yes | Postal code (billing address). |
| `city` | `string` | Yes | City (billing address). |
| `country` | `string` | Yes | Any ISO 3166 Alpha-2 country code (billing address). |
| `recipient` | `string` | No | Recipient displayed in the invoice. |
| `vatNumber` | `string` | No | Customer's VAT number. |
| `sourceId` | `string` | No | You can use your own id when creating the customer. If not provided, Pennylane will pick one for you. Id must be unique. |
| `emails` | `string[]` | No | A list of customer emails. |
| `billingIban` | `string` | No | The billing IBAN of the customer. This is the iban on which you wish to receive payment from this customer. |
| `deliveryAddress` | `string` | No | Address (shipping address). |
| `deliveryPostalCode` | `string` | No | Postal code (shipping address). |
| `deliveryCity` | `string` | No | City (shipping address). |
| `deliveryCountry` | `string` | No | Any ISO 3166 Alpha-2 country code (shipping address). |
| `paymentConditions` | `string` | No | Customer payment conditions |
| `phone` | `string` | No | Customer phone number. |
| `reference` | `string` | No | This reference doesn't appear on the invoice. |
| `notes` | `string` | No | Notes about the customer. |
| `mandate` | `object` | No | The mandate object. Example: {"provider": "gocardless","source_id": "MD001H23WP8E7XN"}. |
| `planItem` | `object` | No | The plan item object. Example: {"enabled": true,"number": "123","label": "label","vat_rate": "123","country_alpha2": "US","description": "description"}. |

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

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

---

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