Zoho Books - Email Sales Order
@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.
zoho_books_email_salesorder
Emails a sales order to the customer.
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
Salesorder id

ID of the sales order to be sent by email.

 
string ·params.salesorder_id
To mail_ids

Array of email address of the recipients.

[0]:
 
array ·params.to_mail_ids
Subject

Subject of the mail.

 
string ·params.subject
Body

Body of the mail.

 
string ·params.body
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
//See the API docs: https://www.zoho.com/books/api/v3/#Sales-Order_Email_a_sales_order

if (!params.organization_id || !params.salesorder_id || !params.to_mail_ids || !params.subject || !params.body) {
  throw new Error("Must provide organization_id, salesorder_id, to_mail_ids, subject, and body parameters.");
}

return await require("@pipedreamhq/platform").axios(this, {
  method: "post",
  url: `https://books.${auths.zoho_books.base_api_uri}/api/v3/salesorders/${params.salesorder_id}/email?organization_id=${params.organization_id}`,
  headers: {
    Authorization: `Zoho-oauthtoken ${auths.zoho_books.oauth_access_token}`,
  },
  data: {
    from_address_id: params.from_address_id,
    send_from_org_email_id: params.send_from_org_email_id,
    to_mail_ids: params.to_mail_ids,
    cc_mail_ids: params.cc_mail_ids,
    bcc_mail_ids: params.bcc_mail_ids,
    subject: params.subject,
    documents: params.documents,
    invoice_id: params.invoice_id,
    body: params.body
  },
  params: {
    salesorder_id: params.salesorder_id,
    attachments: params.attachments,
    send_attachment: params.send_attachment,
    file_name: params.file_name
  }
})