Zoho Books - Update Estimate
@sergio
code:
data:privatelast updated:3 years ago
today
Build integrations remarkably fast!
You're viewing a public workflow template.
Sign up to customize, add steps, modify code and more.
Join 1,000,000+ developers using the Pipedream platform
steps.
trigger
HTTP API
Deploy to generate unique URL
This workflow runs on Pipedream's servers and is triggered by HTTP / Webhook requests.
steps.
nodejs
auth
to use OAuth tokens and API keys in code via theauths object
code
Write any Node.jscodeand use anynpm package. You can alsoexport datafor use in later steps via return or this.key = 'value', pass input data to your code viaparams, and maintain state across executions with$checkpoint.
async (event, steps) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
}
29
this.lineitems = JSON.parse(`[
        {
            "item_id": "2366134000000080001"
        }
    ]`);

/*
this.lineitems = JSON.parse(`[
        {
            "item_id": " ",
            "line_item_id": "",
            "name": "Hard Drive",
            "description": "500GB, USB 2.0 interface 1400 rpm, protective hard case.",
            "product_type": "goods",
            "hsn_or_sac": 80540,
            "item_order": 1,
            "bcy_rate": 120,
            "rate": 120,
            "quantity": 1,
            "unit": " ",
            "discount_amount": 0,
            "discount": 0,
            "is_taxable": false,
            "item_total": 120
        }
    ]`);
*/
steps.
zoho_books_update_estimate
Updates an existing estimate.
auth
(auths.zoho_books)
params
Organization id

In Zoho Books, your business is termed as an organization. If you have multiple businesses, you simply set each of those up as an individual organization. Each organization is an independent Zoho Books Organization with it’s own organization ID, base currency, time zone, language, contacts, reports, etc.

The parameter organization_id should be sent in with every API request to identify the organization.

The organization_id can be obtained from the GET /organizations API’s JSON response. Alternatively, it can be obtained from the Manage Organizations page in the admin console.

 
string ·params.organization_id
Estimate id

ID of the estimate to update.

 
string ·params.estimate_id
Customer id

Search estimates by customer id.

 
string ·params.customer_id
Optional
code
async (params, auths) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
}
60
//See the API docs: https://www.zoho.com/books/api/v3/#Estimates_Update_an_Estimate

if (!params.organization_id || !params.estimate_id || !params.customer_id ) {
  throw new Error("Must provide organization_id, estimate_id, and customer_id parameters.");
}

return await require("@pipedreamhq/platform").axios(this, {
  method: "put",
  url: `https://books.${auths.zoho_books.base_api_uri}/api/v3/estimates/${params.estimate_id}?organization_id=${params.organization_id}`,
  headers: {
    Authorization: `Zoho-oauthtoken ${auths.zoho_books.oauth_access_token}`,
  },
  data:{
    customer_id: params.customer_id,
    contact_persons: params.contact_persons,
    template_id: params.template_id,
    place_of_supply: params.place_of_supply,
    gst_treatment: params.gst_treatment,
    gst_no: params.gst_no,
    estimate_number: params.estimate_number,
    reference_number: params.reference_number,
    date: params.date,
    expiry_date: params.expiry_date,
    exchange_rate: params.exchange_rate,
    discount: params.discount,
    is_discount_before_tax: params.is_discount_before_tax,
    discount_type: params.discount_type,
    is_inclusive_tax: params.is_inclusive_tax,
    custom_body: params.custom_body,
    custom_subject: params.custom_subject,
    salesperson_name: params.salesperson_name,
    custom_fields: params.custom_fields,
    line_items: params.line_items,
    notes: params.notes,
    terms: params.terms,
    shipping_charge: params.shipping_charge,
    adjustment: params.adjustment,
    adjustment_description: params.adjustment_description,
    tax_id: params.tax_id,
    tax_exemption_id: params.tax_exemption_id,
    tax_authority_id: params.tax_authority_id,
    avatax_use_code: params.avatax_use_code,
    avatax_exempt_no: params.avatax_exempt_no,
    vat_treatment: params.vat_treatment,
    tax_treatment: params.tax_treatment,
    item_id: params.item_id,
    line_item_id: params.line_item_id,
    name: params.name,
    description: params.description,
    rate: params.rate,
    unit: params.unit,
    quantity: params.quantity,
    project_id: params.project_id
  },
  params: {    
    ignore_auto_number_generation: params.ignore_auto_number_generation
  }
});