Retrieves the list of tax Authorities.
1
//native
2
type Zoho = {
3
token: string;
4
};
5
/**
6
* Retrieve list of tax Authorities
7
* Retrieves the list of tax Authorities.
8
*/
9
export async function main(
10
auth: Zoho,
11
X_com_zoho_subscriptions_organizationid: string,
12
) {
13
const url = new URL(
14
`https://www.zohoapis.com/billing/v1/settings/taxauthorities`,
15
);
16
17
const response = await fetch(url, {
18
method: "GET",
19
headers: {
20
"X-com-zoho-subscriptions-organizationid":
21
X_com_zoho_subscriptions_organizationid,
22
Authorization: "Zoho-oauthtoken " + auth.token,
23
},
24
body: undefined,
25
});
26
if (!response.ok) {
27
const text = await response.text();
28
throw new Error(`${response.status} ${text}`);
29
}
30
return await response.json();
31
32