0

Create an account label

by
Published Oct 17, 2025

Creates a new AR account label. Permissions and other requirements SubscriptionAccounts Receivable User typeBusiness PermissionsList, View, Add AR Account Labels

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
7
 * Creates a new AR account label.
8

9

10
Permissions and other requirements
11

12
SubscriptionAccounts Receivable
13
User typeBusiness
14
PermissionsList, View, Add AR Account Labels
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
		description?: string
27
		isTaxable?: false | true
28
		isSubtotal?: false | true
29
		isTax?: false | true
30
		taxGroup?: { key?: string; id?: string; href?: string }
31
		taxCode?: string
32
		offsetGLAccount?: { key?: string; id?: string; href?: string }
33
		glAccount?: { href?: string; id?: string; key?: string }
34
		revenueRecognitionTemplate?: { key?: string; id?: string; href?: string }
35
		deferredRevenueGLAccount?: { key?: string; id?: string; href?: string }
36
		status?: 'active' | 'inactive'
37
		audit?: {
38
			createdDateTime?: string
39
			modifiedDateTime?: string
40
			createdBy?: string
41
			modifiedBy?: string
42
		}
43
		entity?: { key?: string; id?: string; name?: string; href?: string }
44
	} & {}
45
) {
46
	const url = new URL(`https://api.intacct.com/ia/api/v1/objects/accounts-receivable/account-label`)
47

48
	const response = await fetch(url, {
49
		method: 'POST',
50
		headers: {
51
			'Content-Type': 'application/json',
52
			Authorization: 'Bearer ' + auth.token
53
		},
54
		body: JSON.stringify(body)
55
	})
56
	if (!response.ok) {
57
		const text = await response.text()
58
		throw new Error(`${response.status} ${text}`)
59
	}
60
	return await response.json()
61
}
62