0

Create a price list

by
Published Oct 17, 2025

Creates a new purchasing price list. Permissions and other requirements SubscriptionPurchasing User typeBusiness, Warehouse PermissionsList, View, Add Price Lists

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 price list
7
 * Creates a new purchasing price list.
8

9

10
Permissions and other requirements
11

12
SubscriptionPurchasing
13
User typeBusiness, Warehouse
14
PermissionsList, View, Add Price Lists
15

16

17

18

19
 */
20
export async function main(
21
	auth: SageIntacct,
22
	body: {
23
		key?: string
24
		id?: string
25
		href?: string
26
		appliesTo?: 'purchasing' | 'orderEntry'
27
		startDate?: string
28
		endDate?: string
29
		status?: 'active' | 'inactive'
30
		entity?: { key?: string; id?: string; name?: string; href?: string }
31
	} & {}
32
) {
33
	const url = new URL(`https://api.intacct.com/ia/api/v1/objects/purchasing/price-list`)
34

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