0

Update a billing price list entry line tier

by
Published Oct 17, 2025

Updates an existing billing price list entry line tier by setting field values. Any fields not provided remain unchanged.

Script sage_intacct Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type SageIntacct = {
3
	token: string
4
}
5
/**
6
 * Update a billing price list entry line tier
7
 * Updates an existing billing price list entry line tier by setting field values. Any fields not provided remain unchanged.
8
 */
9
export async function main(
10
	auth: SageIntacct,
11
	key: string,
12
	body: {
13
		key?: string
14
		id?: string
15
		href?: string
16
		beginQuantity?: string
17
		tierRate?: string
18
		billingPriceListEntryLine?: { key?: string; id?: string; href?: string }
19
		audit?: {
20
			createdDateTime?: string
21
			modifiedDateTime?: string
22
			createdBy?: string
23
			modifiedBy?: string
24
			createdByUser?: { key?: string; id?: string; href?: string }
25
			modifiedByUser?: { key?: string; id?: string; href?: string }
26
		}
27
	}
28
) {
29
	const url = new URL(
30
		`https://api.intacct.com/ia/api/v1/objects/contracts/billing-price-list-entry-line-tier/${key}`
31
	)
32

33
	const response = await fetch(url, {
34
		method: 'PATCH',
35
		headers: {
36
			'Content-Type': 'application/json',
37
			Authorization: 'Bearer ' + auth.token
38
		},
39
		body: JSON.stringify(body)
40
	})
41
	if (!response.ok) {
42
		const text = await response.text()
43
		throw new Error(`${response.status} ${text}`)
44
	}
45
	return await response.json()
46
}
47