# Create Customer — Zoho Books

> Creates a new customer. See the documentation

- Key: `zoho_books-create-customer`
- Type: Action (Write)
- Version: 0.0.2
- App: Zoho Books (`zoho_books`) — https://pipedream.com/apps/zoho-books.md
- This page (HTML): https://pipedream.com/apps/zoho-books/actions/create-customer
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/zoho_books/actions/create-customer/create-customer.mjs

## Description

Creates a new customer. [See the documentation](https://www.zoho.com/books/api/v3/items/#create-an-item)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `contactName` | `string` | Yes | Display Name of the contact. Max-length [200]. |
| `companyName` | `string` | No | Company Name of the contact. Max-length [200]. |
| `website` | `string` | No | Website of the contact. |
| `languageCode` | `string` | No | The language of a contact. |
| `customerSubType` | `string` | No | Type of the customer. |
| `creditLimit` | `string` | No | Credit limit for a customer. |
| `tags` | `string[]` | No | An array of tag objects. Example: {"tag_id":"124567890","tag_option_id":"1234567890"} |
| `isPortalEnabled` | `boolean` | No | To enable client portal for the contact. |
| `currencyId` | `string` | No | The id of the customer. Options are loaded from the connected account. |
| `paymentTerms` | `integer` | No | Net payment term for the customer. |
| `paymentTermsLabel` | `string` | No | Label for the paymet due details. |
| `notes` | `string` | No | Commennts about the payment made by the contact. |
| `exchangeRate` | `string` | No | Exchange rate for the opening balance. |
| `vatTreatment` | `string` | No | Enter vat treatment. |
| `gstNo` | `string` | No | 15 digit GST identification number of the customer. |
| `avataxUseCode` | `string` | No | Used to group like customers for exemption purposes. It is a custom value that links customers to a tax rule. |
| `taxId` | `string` | No | ID of the tax to be associated to the estimate. Options are loaded from the connected account. |

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

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: "zoho_books-create-customer",
  arguments: {
    contactName: "Contact Name",
    companyName: "Company 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: "zoho_books-create-customer",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    zoho_books: { authProvisionId: "apn_xxxxxxx" },
    contactName: "Contact Name",
    companyName: "Company 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": "zoho_books-create-customer",
    "configured_props": {
      "zoho_books": { "authProvisionId": "apn_xxxxxxx" },
      "contactName": "Contact Name",
      "companyName": "Company Name"
    }
  }'
```

---

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