# Create Estimate — Zoho Books

> Creates a new estimate. See the documentation

- Key: `zoho_books-create-estimate`
- 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-estimate
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/zoho_books/actions/create-estimate/create-estimate.mjs

## Description

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

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `customerId` | `string` | Yes | Customer ID of the customer involved in the payment. Options are loaded from the connected account. |
| `currencyId` | `string` | No | The id of the customer. Options are loaded from the connected account. |
| `contactPersons` | `string[]` | No | Array if contact person(S) for whom estimate has to be sent. Options are loaded from the connected account. |
| `templateId` | `string` | No | ID of the PDF template. |
| `placeOfSupply` | `string` | No | Place where the goods/services are supplied to. (If not given, place of contact given for the contact will be taken). |
| `gstTreatment` | `string` | No | Choose whether the contact is GST registered/unregistered/consumer/overseas. |
| `gstNo` | `string` | No | 15 digit GST identification number of the customer. |
| `estimateNumber` | `string` | No | Search estimates by estimate number. |
| `referenceNumber` | `string` | No | Search estimates by reference number. |
| `date` | `string` | No | Search estimates by estimate date. |
| `expiryDate` | `string` | No | The date of expiration of the estimates. |
| `exchangeRate` | `string` | No | Exchange rate of the currency. |
| `discount` | `string` | No | Discount applied to the invoice. It can be either in % or in amount. e.g. 12.5% or 190. Max-length [100] |
| `isDiscountBeforeTax` | `boolean` | No | Used to specify how the discount has to applied. Either before or after the calculation of tax. |
| `discountType` | `string` | No | How the discount is specified. Allowed values are entity_level or item_level. |
| `isInclusiveTax` | `boolean` | No | Used to specify whether the line item rates are inclusive or exclusive of tax. |
| `customBody` | `string` | No | Custom Body |
| `customSubject` | `string` | No | Custom Subject |
| `salespersonName` | `string` | No | Name of the sales person. |
| `customFields` | `string[]` | No | A list of Additional field objects for the payments. Example: {"index": 1, "value": "value"} |
| `lineItems` | `string[]` | Yes | A list of line items objects of an estimate. Example: {"item_id": "1352827000000156060", "name": "name", "description": "description", "quantity": "1" } See the documentation for further details. |
| `notes` | `string` | No | The notes added below expressing gratitude or for conveying some information. |
| `terms` | `string` | No | The terms added below expressing gratitude or for conveying some information. |
| `shippingCharge` | `string` | No | Shipping charges applied to the invoice. |
| `adjustment` | `string` | No | Adjustment |
| `adjustmentDescription` | `string` | No | Adjustment Description |
| `taxId` | `string` | No | ID of the tax to be associated to the estimate. Options are loaded from the connected account. |
| `taxExemptionId` | `string` | No | ID of the tax exemption. Options are loaded from the connected account. |
| `taxAuthorityId` | `string` | No | ID of the tax authority. Tax authority depends on the location of the customer. For example, if the customer is located in NY, then the tax authority is NY tax authority. Options are loaded from the connected account. |
| `avataxUseCode` | `string` | No | Used to group like customers for exemption purposes. It is a custom value that links customers to a tax rule. |
| `avataxExemptNo` | `string` | No | ID of the tax exemption. Options are loaded from the connected account. |
| `vatTreatment` | `string` | No | Enter vat treatment. |
| `taxTreatment` | `string` | No | VAT treatment for the estimate. |
| `isReverseChargeApplied` | `boolean` | No | Used to specify whether the transaction is applicable for Domestic Reverse Charge (DRC) or not. |
| `itemId` | `string` | No | ID of the item to get details. Options are loaded from the connected account. |
| `lineItemId` | `string` | No | ID of the line item. Mandatory, if the existing line item has to be updated. If empty, a new line item will be created. |
| `name` | `string` | No | Name of the line item. |
| `description` | `string` | No | Description of the line item. |
| `rate` | `string` | No | Rate of the line item. |
| `unit` | `string` | No | Unit of the line item. E.g. kgs, Nos |
| `quantity` | `integer` | No | The quantity of line item. |
| `projectId` | `string` | No | Id of the project |
| `acceptRetainer` | `boolean` | No | The "Accept Retainer" node should be passed for the retainer invoice to be created automatically, provided that the customer has accepted the quote. |
| `retainerPercentage` | `integer` | No | Pass the "Retainer Percentage" node to create the retainer invoice automatically. |
| `send` | `boolean` | No | Send the estimate to the contact person(s) associated with the estimate. |
| `ignoreAutoNumberGeneration` | `boolean` | No | Ignore auto estimate number generation for this estimate. This mandates the estimate number. |

## 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-estimate",
  arguments: {
    customerId: "Customer Id",
    currencyId: "Currency Id",
  },
})
```

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

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-estimate",
    "configured_props": {
      "zoho_books": { "authProvisionId": "apn_xxxxxxx" },
      "customerId": "Customer Id",
      "currencyId": "Currency Id"
    }
  }'
```

---

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