0

Add/Edit description for a item in line items list

by
Published Oct 17, 2025

Add/Edit description to a particular plan or addon in the line items list.

Script zoho Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Zoho = {
3
  token: string;
4
};
5
/**
6
 * Add/Edit description for a item in line items list
7
 * Add/Edit description to a particular plan or addon in the line items list.
8
 */
9
export async function main(
10
  auth: Zoho,
11
  subscription_id: string,
12
  plan_code: string,
13
  X_com_zoho_subscriptions_organizationid: string,
14
  body: { description: {} },
15
) {
16
  const url = new URL(
17
    `https://www.zohoapis.com/billing/v1/subscriptions/${subscription_id}/lineitems/${plan_code}`,
18
  );
19

20
  const response = await fetch(url, {
21
    method: "POST",
22
    headers: {
23
      "X-com-zoho-subscriptions-organizationid":
24
        X_com_zoho_subscriptions_organizationid,
25
      "Content-Type": "application/json",
26
      Authorization: "Zoho-oauthtoken " + auth.token,
27
    },
28
    body: JSON.stringify(body),
29
  });
30
  if (!response.ok) {
31
    const text = await response.text();
32
    throw new Error(`${response.status} ${text}`);
33
  }
34
  return await response.json();
35
}
36