0

Create a billing price list entry line tier

by
Published Oct 17, 2025

Creates a new billing price list entry line tier.

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
 * Create a billing price list entry line tier
7
 * Creates a new billing price list entry line tier.
8
 */
9
export async function main(
10
	auth: SageIntacct,
11
	body: {
12
		key?: string
13
		id?: string
14
		href?: string
15
		beginQuantity?: string
16
		tierRate?: string
17
		billingPriceListEntryLine?: { key?: string; id?: string; href?: string }
18
		audit?: {
19
			createdDateTime?: string
20
			modifiedDateTime?: string
21
			createdBy?: string
22
			modifiedBy?: string
23
			createdByUser?: { key?: string; id?: string; href?: string }
24
			modifiedByUser?: { key?: string; id?: string; href?: string }
25
		}
26
	} & {}
27
) {
28
	const url = new URL(
29
		`https://api.intacct.com/ia/api/v1/objects/contracts/billing-price-list-entry-line-tier`
30
	)
31

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