0

Create an account label tax group

by
Published Oct 17, 2025

Creates a new account label tax group.

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 an account label tax group
7
 * Creates a new account label tax group.
8
 */
9
export async function main(
10
	auth: SageIntacct,
11
	body: {
12
		key?: string
13
		id?: string
14
		href?: string
15
		name?: string
16
		groupType?: string
17
		isSystemGenerated?: false | true
18
		taxSolution?: { key?: string; href?: string; id?: 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(`https://api.intacct.com/ia/api/v1/objects/tax/account-label-tax-group`)
30

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