0

Bulk print Quotes

by
Published Oct 17, 2025

Export Quotes as pdf and print them. Maximum of 25 quotes can be printed.

Script zoho Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Zoho = {
3
  token: string;
4
};
5
/**
6
 * Bulk print Quotes
7
 * Export Quotes as pdf and print them. Maximum of 25 quotes can be printed.
8
 */
9
export async function main(
10
  auth: Zoho,
11
  estimate_ids: string | undefined,
12
  X_com_zoho_subscriptions_organizationid: string,
13
) {
14
  const url = new URL(`https://www.zohoapis.com/billing/v1/estimates/print`);
15
  for (const [k, v] of [["estimate_ids", estimate_ids]]) {
16
    if (v !== undefined && v !== "" && k !== undefined) {
17
      url.searchParams.append(k, v);
18
    }
19
  }
20
  const response = await fetch(url, {
21
    method: "GET",
22
    headers: {
23
      "X-com-zoho-subscriptions-organizationid":
24
        X_com_zoho_subscriptions_organizationid,
25
      Authorization: "Zoho-oauthtoken " + auth.token,
26
    },
27
    body: undefined,
28
  });
29
  if (!response.ok) {
30
    const text = await response.text();
31
    throw new Error(`${response.status} ${text}`);
32
  }
33
  return await response.json();
34
}
35