0

List base currency adjustment

by
Published Oct 17, 2025

Lists base currency adjustment.

Script zoho Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Zoho = {
3
  token: string;
4
};
5
/**
6
 * List base currency adjustment
7
 * Lists base currency adjustment.
8
 */
9
export async function main(
10
  auth: Zoho,
11
  organization_id: string | undefined,
12
  filter_by: string | undefined,
13
  sort_column: string | undefined,
14
  last_modified_time: string | undefined,
15
) {
16
  const url = new URL(
17
    `https://www.zohoapis.com/books/v3/basecurrencyadjustment`,
18
  );
19
  for (const [k, v] of [
20
    ["organization_id", organization_id],
21
    ["filter_by", filter_by],
22
    ["sort_column", sort_column],
23
    ["last_modified_time", last_modified_time],
24
  ]) {
25
    if (v !== undefined && v !== "" && k !== undefined) {
26
      url.searchParams.append(k, v);
27
    }
28
  }
29
  const response = await fetch(url, {
30
    method: "GET",
31
    headers: {
32
      Authorization: "Zoho-oauthtoken " + auth.token,
33
    },
34
    body: undefined,
35
  });
36
  if (!response.ok) {
37
    const text = await response.text();
38
    throw new Error(`${response.status} ${text}`);
39
  }
40
  return await response.json();
41
}
42