0

Create a row

by
Published Oct 17, 2025

Creates a new row. Permissions and other requirements SubscriptionInventory Control ConfigurationAdvanced workflows is enabled. User typeBusiness PermissionsList, View, Add Rows

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 row
7
 * Creates a new row.
8

9

10
Permissions and other requirements
11

12
SubscriptionInventory Control
13
ConfigurationAdvanced workflows is enabled.
14
User typeBusiness
15
PermissionsList, View, Add Rows
16

17

18

19

20
 */
21
export async function main(
22
	auth: SageIntacct,
23
	body: {
24
		key?: string
25
		id?: string
26
		description?: string
27
		href?: string
28
		audit?: {
29
			createdDateTime?: string
30
			modifiedDateTime?: string
31
			createdBy?: string
32
			modifiedBy?: string
33
		}
34
	} & {}
35
) {
36
	const url = new URL(`https://api.intacct.com/ia/api/v1/objects/inventory-control/row`)
37

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