0

Delete an installment from a deal

by
Published Oct 17, 2025

Removes an installment from a deal. Only available in Advanced and above plans.

Script pipedrive Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Pipedrive = {
3
  apiToken: string;
4
};
5
/**
6
 * Delete an installment from a deal
7
 * Removes an installment from a deal.
8

9
Only available in Advanced and above plans.
10

11
 */
12
export async function main(
13
  auth: Pipedrive,
14
  id: string,
15
  installment_id: string,
16
) {
17
  const url = new URL(
18
    `https://api.pipedrive.com/api/v2/deals/${id}/installments/${installment_id}`,
19
  );
20

21
  const response = await fetch(url, {
22
    method: "DELETE",
23
    headers: {
24
      "x-api-token": auth.apiToken,
25
    },
26
    body: undefined,
27
  });
28
  if (!response.ok) {
29
    const text = await response.text();
30
    throw new Error(`${response.status} ${text}`);
31
  }
32
  return await response.json();
33
}
34