Creator Help

Create Estimate

Overview

The Deluge task zoho.invoice.createEstimate() will create an estimate in your Zoho Invoice account.

To create an estimate for a single item

Deluge syntax

<Inv Response> = zoho.invoice.createEstimate( <customerID>, <estimateInfo>, send);

where,
<customerID> refers to the name of the expense category. ( Mandatory )
<estimate info> is the map variable that holds the key,value pairs. The map key is the column name of the table and the map value is the field value as submitted in the ZC form.
<Inv Response> is the map variable returned by Zoho Invoice as response.
send - sends the estimate to the customer via email.

Map Key names to create an estimate:

EstimateNumber - will be used only if estimate number auto-generation is disbaled otherwise an error wll be thrown.
ExchangeRate - Optional, If not passed, default value is 1.
Custom.Body - Optional. If not passed, content from Invoice Notification will be used
Custom.Subject - Optional. If not passed, subject from Invoice Notification will be used
ItemName - Mandatory, if ProductID is not specified.
Price - Mandatory, if ProductID is not specified.
ProductID - Alredy created ItemID. Mandatory, if ItemName and Price are not provided.
ItemDescription - Optional.
Description - Optional
Notes - Optional
Terms - Optional

Example

customerID = 141995000000022001;
send = true;
estimateInfo <>= { "EstimateDate" : zoho.currentdate, "ReferenceNumber" : 123, "Custom.Body" : "This is the mail content", "Custom.Subject" : "This is mail subject",
"Description" : "Comment added to an invoice", "Notes" : "Estimate Notes will be shown in PDF", "Terms" : "Terms and Conditions apply", "ItemName" : "Sample Item",
"ItemDescription" : "Sample Description", "Price" : 50 };
resp = zoho.invoice.createEstimate(customerID, estimateInfo, send);

Response format

{
"Items":
"[{ItemID=141995000000069009, Quantity=1.000000, ItemName=Sample Item, Price=50.000000, ItemTotal=50.000, Discount=0.00, Tax2Type=0,
ItemDescription=Sample Description}]","CreatedTimeInMillis":"1331721028262","Description":"Comment added to an invoice",
"CreatedTime":"2012-03-14 16:00:28 IST","InvoiceID":"141995000000069003", "Terms":"Terms and Conditions apply","CommentID":"141995000000069005",
"CurrencyCode":"AWG","CustomerName":"test","EstimateID":"141995000000069003","Source":"3","Notes":"Estimate Notes will be shown in PDF","Status":"2",
"DecimalPlace":"2","ExchangeRate":"1.000000","EstimateDate":"2012-03-14","ReferenceNumber":"123","CustomerID":
"141995000000022001",
"EstimateNumber":"EST-19","TaxTotal":"0.0","LastModifiedTime":"2012-03-14 16:00:28 IST","EstimateItemTotal":"50.000","Total":"50.000"
}

To create an estimate for multiple items

Deluge syntax

<Inv Response> = zoho.invoice.createEstimate( <customerID>, <estimateInfo> , send);

where,
<customerID> refers to the name of the expense category. (Mandatory)
<estimate info> is the list variable that holds the key,value pairs. The map key is the column name of the table and the map value is the field value as submitted in the ZC form.
<Inv Response> is the list of map returned by Zoho Invoice as response.
send - sends the estimate to the customer via email.

Example

customerID = 141995000000022001;
send = true;
itemList = List:Map();
itemList.add({ "ItemName" : "Test", "ItemDescription" : "Sample Description", "Price" : 50 });
itemList.add({ "ItemName" : "Test1", "ItemDescription" : "Sample Description", "Price" : 50 });
estimateInfo = { "EstimateDate" : zoho.currentdate, "ReferenceNumber" : 123, "Custom.Body" : "This is the mail content", "Custom.Subject" : "This is mail subject",
"Description" : "Comment added to an invoice", "Notes" : "Estimate Notes will be shown in PDF", "Terms" : "Terms and Conditions apply", "Items" : itemList };
resp = zoho.invoice.createEstimate(customerID, estimateInfo , send);

Response format

{
"Items":
"[{ItemID=141995000000069039, Quantity=1.000000, ItemName=Test, Price=50.000000, ItemTotal=50.000, Discount=0.00, Tax2Type=0, ItemDescription=Sample Description}, {ItemID=141995000000069041, Quantity=1.000000, , ItemName=Test1, Price=50.000000, ItemTotal=50.000, Discount=0.00, Tax2Type=0, ItemDescription=Sample Description}]",
"CreatedTimeInMillis":"1331721256519","Description":"Comment added to an invoice","CreatedTime":"2012-03-14 16:04:16 IST","InvoiceID":"141995000000069033",
"Terms":"Terms and Conditions apply","CommentID":"141995000000069035","CurrencyCode":"AWG","CustomerName":"test","EstimateID":
"141995000000069033","Source":"3",
"Notes":"Estimate Notes will be shown in PDF","Status":"2","DecimalPlace":"2","ExchangeRate":"1.000000","EstimateDate":"2012-03-14","ReferenceNumber":"123",
"CustomerID":"141995000000022001","EstimateNumber":"EST-21", "TaxTotal":"0.0","LastModifiedTime":"2012-03-14 16:04:16 IST","EstimateItemTotal":"100.000","Total":"100.000"
}

Related Links

http://www.zoho.com/invoice/api/estimates/estimates.html#how-do-i-add-an-estimate?

Top