# Create Customer Payment — Zoho Books

> Creates a new payment. See the documentation

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

## Description

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

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `customerId` | `string` | Yes | Customer ID of the customer involved in the payment. Options are loaded from the connected account. |
| `paymentMode` | `string` | Yes | Mode through which payment is made. |
| `amount` | `string` | Yes | Amount paid in the respective payment. |
| `date` | `string` | Yes | Date on which payment is made. Format [yyyy-mm-dd] |
| `referenceNumber` | `string` | No | Reference number generated for the payment. A string of your choice can also be used as the reference number. Max-length [100] |
| `description` | `string` | No | Description about the payment. |
| `invoices` | `string[]` | Yes | List of invoice objects associated with the payment. Each invoice object contains invoice_id, invoice_number, date, invoice_amount, amount_applied and balance_amount. Example: {"invoice_id": "90300000079426", "amount_applied": 450} |
| `exchangeRate` | `string` | No | Exchange rate for the currency used in the invoices and customer's currency. The payment amount would be the multiplicative product of the original amount and the exchange rate. Default is 1. |
| `bankCharges` | `string` | No | Denotes any additional bank charges. |
| `customFields` | `string[]` | No | A list of Additional field objects for the payments. Example: {"label": "label", "value": 129890} |
| `invoiceId` | `string` | Yes | ID of the invoice to get payments of. Options are loaded from the connected account. |
| `amountApplied` | `string` | No | Amount paid for the invoice. |
| `taxAmountWithheld` | `string` | No | Amount withheld for tax. |
| `accountId` | `string` | No | ID of the cash/bank account the payment has to be deposited. Options are loaded from the connected account. |
| `contactPersons` | `string[]` | No | IDs of the contact persons the thank you mail has to be triggered. 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-payment",
  arguments: {
    customerId: "Customer Id",
    paymentMode: "Payment Mode",
  },
})
```

**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-payment",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    zoho_books: { authProvisionId: "apn_xxxxxxx" },
    customerId: "Customer Id",
    paymentMode: "Payment Mode",
  },
})

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-payment",
    "configured_props": {
      "zoho_books": { "authProvisionId": "apn_xxxxxxx" },
      "customerId": "Customer Id",
      "paymentMode": "Payment Mode"
    }
  }'
```

---

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