# Create Customer — Invoiced

> Creates a new customer in Invoiced. See the documentation

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

## Description

Creates a new customer in Invoiced. [See the documentation](https://developer.invoiced.com/api/customers#create-a-customer)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `name` | `string` | Yes | Customer name |
| `number` | `string` | No | A unique ID to help tie your customer to your external systems. Invoiced will generate one if not supplied |
| `email` | `string` | No | Customer email address |
| `autoplay` | `boolean` | No | AutoPay enabled? Defaults to false |
| `autoplayDelayDays` | `integer` | No | Number of days to delay AutoPay |
| `paymentTerms` | `string` | No | Payment terms when AutoPay is off. (i.e., "NET 30") |
| `attentionTo` | `string` | No | Used for ATTN: address line if company |
| `address1` | `string` | No | Customer address line 1 |
| `address2` | `string` | No | Optional second address line |
| `city` | `string` | No | Customer city |
| `state` | `string` | No | State or province |
| `postalCode` | `string` | No | Zip or postal code |
| `country` | `string` | No | Customer country Two-letter ISO code |
| `language` | `string` | No | Customer language Two-letter ISO code |
| `currency` | `string` | No | Customer currency 3-letter ISO code |
| `chase` | `boolean` | No | Chasing enabled? - defaults to true |
| `chasingCadence` | `integer` | No | The ID of the chasing cadence Options are loaded from the connected account. |
| `nextChaseStep` | `integer` | No | Cadence step ID Options are loaded from the connected account. |
| `phone` | `string` | No | Customer phone number |
| `creditHold` | `boolean` | No | When true, customer is on credit hold |
| `creditLimit` | `string` | No | Customer credit limit |
| `ownerId` | `string` | No | The ID of the member Options are loaded from the connected account. |
| `taxable` | `boolean` | No | Customer taxable? |
| `taxes` | `string[]` | No | Array of Tax Rate IDs Options are loaded from the connected account. |
| `taxId` | `string` | No | Tax ID to be displayed on documents Options are loaded from the connected account. |
| `avalaraEntityUseCode` | `string` | No | Avalara-specific entity use code |
| `avalaraExemptionNumber` | `string` | No | Tax-exempt number to pass to Avalara |
| `type` | `string` | No | Organization type |
| `parentCustomer` | `string` | No | The parent customer to which this customer belongs Options are loaded from the connected account. |
| `notes` | `string` | No | Private customer notes |
| `signUpPage` | `string` | No | Sign up page ID |
| `metadata` | `object` | No | A hash of key/value pairs that can store additional information about this object. |
| `disabledPaymentMethods` | `string[]` | No | Array of payment method IDs to disable for the customer. i.e., ["wire_transfer", "credit_card"] |
| `achGateway` | `integer` | No | Gateway configuration ID to process payments with |
| `ccGateway` | `integer` | No | Gateway configuration ID to process payments with |

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

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: "invoiced-create-customer",
  arguments: {
    name: "Name",
    number: "Number",
  },
})
```

**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: "invoiced-create-customer",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    invoiced: { authProvisionId: "apn_xxxxxxx" },
    name: "Name",
    number: "Number",
  },
})

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": "invoiced-create-customer",
    "configured_props": {
      "invoiced": { "authProvisionId": "apn_xxxxxxx" },
      "name": "Name",
      "number": "Number"
    }
  }'
```

---

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